From 5f4b263466b5ab7bdf052f4dfe916a942883b62a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 21 Jul 2021 05:09:21 +0000 Subject: [PATCH] CodeGen from PR 15282 in Azure/azure-rest-api-specs Merge 33ead479947af2f15360078f197c986b2eac991c into dc90355ba177c3412bdb5b5569595834e1da33a4 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 101 + .../pom.xml | 86 + .../network/generated/NetworkManager.java | 1549 ++++ ...tewayPrivateEndpointConnectionsClient.java | 224 + ...tionGatewayPrivateLinkResourcesClient.java | 46 + .../fluent/ApplicationGatewaysClient.java | 697 ++ .../ApplicationSecurityGroupsClient.java | 245 + .../fluent/AvailableDelegationsClient.java | 39 + .../AvailableEndpointServicesClient.java | 39 + .../AvailablePrivateEndpointTypesClient.java | 67 + ...ailableResourceGroupDelegationsClient.java | 43 + .../fluent/AvailableServiceAliasesClient.java | 67 + .../fluent/AzureFirewallFqdnTagsClient.java | 36 + .../fluent/AzureFirewallsClient.java | 268 + .../generated/fluent/BastionHostsClient.java | 205 + .../fluent/BgpServiceCommunitiesClient.java | 36 + .../fluent/ConnectionMonitorsClient.java | 458 ++ .../fluent/CustomIpPrefixesClient.java | 239 + .../fluent/DdosCustomPoliciesClient.java | 190 + .../fluent/DdosProtectionPlansClient.java | 238 + .../fluent/DefaultSecurityRulesClient.java | 72 + .../fluent/DscpConfigurationsClient.java | 207 + ...pressRouteCircuitAuthorizationsClient.java | 221 + .../ExpressRouteCircuitConnectionsClient.java | 236 + .../ExpressRouteCircuitPeeringsClient.java | 211 + .../fluent/ExpressRouteCircuitsClient.java | 511 ++ .../fluent/ExpressRouteConnectionsClient.java | 213 + ...essRouteCrossConnectionPeeringsClient.java | 222 + .../ExpressRouteCrossConnectionsClient.java | 428 ++ .../fluent/ExpressRouteGatewaysClient.java | 290 + .../fluent/ExpressRouteLinksClient.java | 72 + .../fluent/ExpressRoutePortsClient.java | 274 + .../ExpressRoutePortsLocationsClient.java | 66 + .../ExpressRouteServiceProvidersClient.java | 36 + .../fluent/FirewallPoliciesClient.java | 208 + ...ewallPolicyRuleCollectionGroupsClient.java | 218 + .../generated/fluent/FlowLogsClient.java | 244 + .../fluent/HubRouteTablesClient.java | 212 + .../HubVirtualNetworkConnectionsClient.java | 217 + .../fluent/InboundNatRulesClient.java | 213 + .../InboundSecurityRuleOperationsClient.java | 99 + .../generated/fluent/IpAllocationsClient.java | 237 + .../generated/fluent/IpGroupsClient.java | 254 + ...LoadBalancerBackendAddressPoolsClient.java | 212 + ...alancerFrontendIpConfigurationsClient.java | 77 + .../LoadBalancerLoadBalancingRulesClient.java | 72 + .../LoadBalancerNetworkInterfacesClient.java | 41 + .../LoadBalancerOutboundRulesClient.java | 72 + .../fluent/LoadBalancerProbesClient.java | 72 + .../generated/fluent/LoadBalancersClient.java | 292 + .../fluent/LocalNetworkGatewaysClient.java | 217 + .../generated/fluent/NatGatewaysClient.java | 237 + .../generated/fluent/NatRulesClient.java | 206 + ...etworkInterfaceIpConfigurationsClient.java | 76 + .../NetworkInterfaceLoadBalancersClient.java | 41 + ...tworkInterfaceTapConfigurationsClient.java | 218 + .../fluent/NetworkInterfacesClient.java | 646 ++ .../fluent/NetworkManagementClient.java | 789 +++ .../fluent/NetworkProfilesClient.java | 208 + .../fluent/NetworkSecurityGroupsClient.java | 246 + .../NetworkVirtualAppliancesClient.java | 246 + .../fluent/NetworkWatchersClient.java | 989 +++ .../generated/fluent/OperationsClient.java | 36 + .../fluent/P2SVpnGatewaysClient.java | 579 ++ .../fluent/PacketCapturesClient.java | 328 + ...rExpressRouteCircuitConnectionsClient.java | 81 + .../fluent/PrivateDnsZoneGroupsClient.java | 214 + .../fluent/PrivateEndpointsClient.java | 222 + .../fluent/PrivateLinkServicesClient.java | 583 ++ .../fluent/PublicIpAddressesClient.java | 489 ++ .../fluent/PublicIpPrefixesClient.java | 239 + .../fluent/ResourceNavigationLinksClient.java | 44 + .../fluent/ResourceProvidersClient.java | 338 + .../fluent/RouteFilterRulesClient.java | 212 + .../generated/fluent/RouteFiltersClient.java | 238 + .../generated/fluent/RouteTablesClient.java | 237 + .../generated/fluent/RoutesClient.java | 197 + .../SecurityPartnerProvidersClient.java | 245 + .../generated/fluent/SecurityRulesClient.java | 212 + .../fluent/ServiceAssociationLinksClient.java | 44 + .../fluent/ServiceEndpointPoliciesClient.java | 246 + ...erviceEndpointPolicyDefinitionsClient.java | 233 + .../generated/fluent/ServiceTagsClient.java | 43 + .../generated/fluent/SubnetsClient.java | 373 + .../generated/fluent/UsagesClient.java | 39 + .../fluent/VirtualApplianceSitesClient.java | 213 + .../fluent/VirtualApplianceSkusClient.java | 62 + .../VirtualHubBgpConnectionsClient.java | 329 + .../VirtualHubIpConfigurationsClient.java | 210 + .../fluent/VirtualHubRouteTableV2SClient.java | 222 + .../generated/fluent/VirtualHubsClient.java | 316 + ...irtualNetworkGatewayConnectionsClient.java | 740 ++ .../VirtualNetworkGatewayNatRulesClient.java | 215 + .../fluent/VirtualNetworkGatewaysClient.java | 1303 ++++ .../fluent/VirtualNetworkPeeringsClient.java | 251 + .../fluent/VirtualNetworkTapsClient.java | 236 + .../fluent/VirtualNetworksClient.java | 300 + .../fluent/VirtualRouterPeeringsClient.java | 218 + .../fluent/VirtualRoutersClient.java | 221 + .../generated/fluent/VirtualWansClient.java | 236 + .../fluent/VpnConnectionsClient.java | 405 ++ .../generated/fluent/VpnGatewaysClient.java | 486 ++ .../fluent/VpnLinkConnectionsClient.java | 192 + ...ationsAssociatedWithVirtualWansClient.java | 74 + .../fluent/VpnServerConfigurationsClient.java | 252 + .../fluent/VpnSiteLinkConnectionsClient.java | 51 + .../generated/fluent/VpnSiteLinksClient.java | 72 + .../generated/fluent/VpnSitesClient.java | 236 + .../fluent/VpnSitesConfigurationsClient.java | 74 + .../WebApplicationFirewallPoliciesClient.java | 175 + .../generated/fluent/WebCategoriesClient.java | 63 + ...cationGatewayAvailableSslOptionsInner.java | 180 + ...atewayAvailableWafRuleSetsResultInner.java | 56 + .../ApplicationGatewayBackendHealthInner.java | 56 + ...tionGatewayBackendHealthOnDemandInner.java | 87 + ...cationGatewayBackendHealthServerInner.java | 133 + .../models/ApplicationGatewayInner.java | 1065 +++ ...GatewayPrivateEndpointConnectionInner.java | 176 + ...cationGatewayPrivateLinkResourceInner.java | 148 + ...cationGatewaySslPredefinedPolicyInner.java | 118 + .../models/ApplicationSecurityGroupInner.java | 118 + .../AutoApprovedPrivateLinkServiceInner.java | 50 + .../models/AvailableDelegationInner.java | 155 + .../AvailablePrivateEndpointTypeInner.java | 154 + .../models/AvailableProvidersListInner.java | 60 + .../models/AvailableServiceAliasInner.java | 128 + .../models/AzureFirewallFqdnTagInner.java | 114 + .../fluent/models/AzureFirewallInner.java | 463 ++ .../models/AzureReachabilityReportInner.java | 130 + .../fluent/models/AzureWebCategoryInner.java | 112 + .../models/BackendAddressPoolInner.java | 264 + .../models/BastionActiveSessionInner.java | 190 + .../fluent/models/BastionHostInner.java | 186 + .../models/BastionSessionStateInner.java | 69 + .../models/BastionShareableLinkInner.java | 105 + .../fluent/models/BgpConnectionInner.java | 174 + .../models/BgpPeerStatusListResultInner.java | 55 + .../models/BgpServiceCommunityInner.java | 125 + .../ConnectionMonitorQueryResultInner.java | 82 + .../models/ConnectionMonitorResultInner.java | 381 + .../models/ConnectionResetSharedKeyInner.java | 51 + .../models/ConnectionSharedKeyInner.java | 63 + .../models/ConnectivityInformationInner.java | 135 + .../fluent/models/CustomIpPrefixInner.java | 358 + .../fluent/models/DdosCustomPolicyInner.java | 167 + .../models/DdosProtectionPlanInner.java | 111 + .../DnsNameAvailabilityResultInner.java | 50 + .../fluent/models/DscpConfigurationInner.java | 319 + ...veNetworkSecurityGroupListResultInner.java | 71 + .../models/EffectiveRouteListResultInner.java | 70 + .../models/EndpointServiceResultInner.java | 62 + ...ExpressRouteCircuitAuthorizationInner.java | 163 + .../ExpressRouteCircuitConnectionInner.java | 269 + .../models/ExpressRouteCircuitInner.java | 477 ++ .../ExpressRouteCircuitPeeringInner.java | 612 ++ .../models/ExpressRouteCircuitStatsInner.java | 128 + ...sRouteCircuitsArpTableListResultInner.java | 81 + ...uteCircuitsRoutesTableListResultInner.java | 82 + ...uitsRoutesTableSummaryListResultInner.java | 83 + .../models/ExpressRouteConnectionInner.java | 250 + .../ExpressRouteConnectionListInner.java | 54 + .../ExpressRouteCrossConnectionInner.java | 291 + ...pressRouteCrossConnectionPeeringInner.java | 428 ++ ...ionsRoutesTableSummaryListResultInner.java | 73 + .../models/ExpressRouteGatewayInner.java | 179 + .../models/ExpressRouteGatewayListInner.java | 54 + .../fluent/models/ExpressRouteLinkInner.java | 225 + .../fluent/models/ExpressRoutePortInner.java | 335 + .../ExpressRoutePortsLocationInner.java | 146 + .../ExpressRouteServiceProviderInner.java | 142 + .../fluent/models/FirewallPolicyInner.java | 440 ++ ...irewallPolicyRuleCollectionGroupInner.java | 168 + .../models/FlowLogInformationInner.java | 210 + .../generated/fluent/models/FlowLogInner.java | 282 + .../models/FrontendIpConfigurationInner.java | 394 ++ .../models/GatewayRouteListResultInner.java | 55 + ...nerateExpressRoutePortsLoaResultInner.java | 50 + .../models/HubIpConfigurationInner.java | 217 + .../fluent/models/HubRouteTableInner.java | 196 + .../HubVirtualNetworkConnectionInner.java | 232 + .../fluent/models/InboundNatRuleInner.java | 334 + .../models/InboundSecurityRuleInner.java | 137 + .../IpAddressAvailabilityResultInner.java | 106 + .../fluent/models/IpAllocationInner.java | 272 + .../fluent/models/IpConfigurationInner.java | 205 + .../models/IpConfigurationProfileInner.java | 138 + .../generated/fluent/models/IpGroupInner.java | 160 + .../fluent/models/LoadBalancerInner.java | 410 ++ .../fluent/models/LoadBalancingRuleInner.java | 454 ++ .../models/LocalNetworkGatewayInner.java | 226 + .../fluent/models/NatGatewayInner.java | 267 + ...kConfigurationDiagnosticResponseInner.java | 44 + .../fluent/models/NetworkInterfaceInner.java | 509 ++ .../NetworkInterfaceIpConfigurationInner.java | 486 ++ ...NetworkInterfaceTapConfigurationInner.java | 139 + .../fluent/models/NetworkProfileInner.java | 167 + .../models/NetworkSecurityGroupInner.java | 216 + .../models/NetworkVirtualApplianceInner.java | 356 + .../NetworkVirtualApplianceSkuInner.java | 145 + .../fluent/models/NetworkWatcherInner.java | 99 + .../fluent/models/NextHopResultInner.java | 109 + .../fluent/models/OperationInner.java | 138 + .../fluent/models/OutboundRuleInner.java | 274 + .../models/P2SVpnConnectionHealthInner.java | 53 + .../fluent/models/P2SVpnGatewayInner.java | 284 + .../PacketCaptureQueryStatusResultInner.java | 184 + .../models/PacketCaptureResultInner.java | 252 + ...eerExpressRouteCircuitConnectionInner.java | 267 + .../fluent/models/PeerRouteListInner.java | 55 + .../models/PrivateDnsZoneGroupInner.java | 128 + .../PrivateEndpointConnectionInner.java | 176 + .../fluent/models/PrivateEndpointInner.java | 276 + .../models/PrivateLinkServiceInner.java | 356 + ...rivateLinkServiceIpConfigurationInner.java | 243 + .../PrivateLinkServiceVisibilityInner.java | 50 + .../generated/fluent/models/ProbeInner.java | 283 + .../fluent/models/PublicIpAddressInner.java | 587 ++ .../fluent/models/PublicIpPrefixInner.java | 394 ++ ...esourceNavigationLinksListResultInner.java | 70 + .../fluent/models/RouteFilterInner.java | 165 + .../fluent/models/RouteFilterRuleInner.java | 204 + .../generated/fluent/models/RouteInner.java | 231 + .../fluent/models/RouteTableInner.java | 191 + .../models/SecurityGroupViewResultInner.java | 55 + .../models/SecurityPartnerProviderInner.java | 169 + .../fluent/models/SecurityRuleInner.java | 550 ++ ...erviceAssociationLinksListResultInner.java | 70 + .../ServiceEndpointPolicyDefinitionInner.java | 174 + .../models/ServiceEndpointPolicyInner.java | 182 + .../models/ServiceTagsListResultInner.java | 134 + .../generated/fluent/models/SubnetInner.java | 578 ++ .../fluent/models/TopologyInner.java | 102 + .../models/TroubleshootingResultInner.java | 134 + .../generated/fluent/models/UsageInner.java | 157 + .../models/VerificationIpFlowResultInner.java | 80 + .../models/VirtualApplianceSiteInner.java | 162 + .../fluent/models/VirtualHubInner.java | 547 ++ .../models/VirtualHubRouteTableV2Inner.java | 151 + .../VirtualNetworkGatewayConnectionInner.java | 715 ++ ...tworkGatewayConnectionListEntityInner.java | 617 ++ .../models/VirtualNetworkGatewayInner.java | 629 ++ .../VirtualNetworkGatewayNatRuleInner.java | 249 + .../fluent/models/VirtualNetworkInner.java | 440 ++ .../models/VirtualNetworkPeeringInner.java | 465 ++ .../fluent/models/VirtualNetworkTapInner.java | 228 + .../models/VirtualNetworkUsageInner.java | 103 + .../fluent/models/VirtualRouterInner.java | 220 + .../models/VirtualRouterPeeringInner.java | 159 + .../fluent/models/VirtualWanInner.java | 251 + .../VirtualWanSecurityProvidersInner.java | 56 + ...ConnectionHealthDetailListResultInner.java | 56 + .../models/VpnClientIPsecParametersInner.java | 280 + .../fluent/models/VpnConnectionInner.java | 551 ++ .../fluent/models/VpnGatewayInner.java | 289 + .../fluent/models/VpnGatewayNatRuleInner.java | 279 + .../models/VpnProfileResponseInner.java | 50 + .../models/VpnServerConfigurationInner.java | 490 ++ .../VpnServerConfigurationsResponseInner.java | 52 + .../generated/fluent/models/VpnSiteInner.java | 354 + .../models/VpnSiteLinkConnectionInner.java | 501 ++ .../fluent/models/VpnSiteLinkInner.java | 221 + .../WebApplicationFirewallPolicyInner.java | 255 + .../generated/fluent/models/package-info.java | 6 + .../generated/fluent/package-info.java | 6 + ...icationGatewayAvailableSslOptionsImpl.java | 92 + ...GatewayAvailableWafRuleSetsResultImpl.java | 42 + .../ApplicationGatewayBackendHealthImpl.java | 41 + ...ationGatewayBackendHealthOnDemandImpl.java | 39 + ...icationGatewayBackendHealthServerImpl.java | 53 + .../ApplicationGatewayImpl.java | 647 ++ ...nGatewayPrivateEndpointConnectionImpl.java | 71 + ...yPrivateEndpointConnectionsClientImpl.java | 1187 ++++ ...GatewayPrivateEndpointConnectionsImpl.java | 121 + ...icationGatewayPrivateLinkResourceImpl.java | 69 + ...GatewayPrivateLinkResourcesClientImpl.java | 355 + ...cationGatewayPrivateLinkResourcesImpl.java | 51 + ...icationGatewaySslPredefinedPolicyImpl.java | 54 + .../ApplicationGatewaysClientImpl.java | 3705 ++++++++++ .../ApplicationGatewaysImpl.java | 407 ++ .../ApplicationSecurityGroupImpl.java | 188 + .../ApplicationSecurityGroupsClientImpl.java | 1497 ++++ .../ApplicationSecurityGroupsImpl.java | 190 + .../AutoApprovedPrivateLinkServiceImpl.java | 33 + .../AvailableDelegationImpl.java | 56 + .../AvailableDelegationsClientImpl.java | 309 + .../AvailableDelegationsImpl.java | 47 + .../AvailableEndpointServicesClientImpl.java | 312 + .../AvailableEndpointServicesImpl.java | 47 + .../AvailablePrivateEndpointTypeImpl.java | 49 + ...ailablePrivateEndpointTypesClientImpl.java | 599 ++ .../AvailablePrivateEndpointTypesImpl.java | 60 + .../AvailableProvidersListImpl.java | 41 + ...bleResourceGroupDelegationsClientImpl.java | 343 + ...AvailableResourceGroupDelegationsImpl.java | 47 + .../AvailableServiceAliasImpl.java | 45 + .../AvailableServiceAliasesClientImpl.java | 589 ++ .../AvailableServiceAliasesImpl.java | 60 + .../AzureFirewallFqdnTagImpl.java | 69 + .../AzureFirewallFqdnTagsClientImpl.java | 288 + .../AzureFirewallFqdnTagsImpl.java | 47 + .../implementation/AzureFirewallImpl.java | 338 + .../AzureFirewallsClientImpl.java | 1536 ++++ .../implementation/AzureFirewallsImpl.java | 174 + .../AzureReachabilityReportImpl.java | 50 + .../implementation/AzureWebCategoryImpl.java | 48 + .../BackendAddressPoolImpl.java | 238 + .../BastionActiveSessionImpl.java | 74 + .../implementation/BastionHostImpl.java | 201 + .../BastionHostsClientImpl.java | 1254 ++++ .../implementation/BastionHostsImpl.java | 170 + .../BastionSessionStateImpl.java | 41 + .../BastionShareableLinkImpl.java | 46 + .../implementation/BgpConnectionImpl.java | 159 + .../BgpPeerStatusListResultImpl.java | 41 + .../BgpServiceCommunitiesClientImpl.java | 287 + .../BgpServiceCommunitiesImpl.java | 47 + .../BgpServiceCommunityImpl.java | 71 + .../ConnectionMonitorQueryResultImpl.java | 46 + .../ConnectionMonitorResultImpl.java | 366 + .../ConnectionMonitorsClientImpl.java | 2204 ++++++ .../ConnectionMonitorsImpl.java | 251 + .../ConnectionResetSharedKeyImpl.java | 33 + .../ConnectionSharedKeyImpl.java | 37 + .../ConnectivityInformationImpl.java | 66 + .../implementation/CustomIpPrefixImpl.java | 292 + .../CustomIpPrefixesClientImpl.java | 1478 ++++ .../implementation/CustomIpPrefixesImpl.java | 181 + .../DdosCustomPoliciesClientImpl.java | 959 +++ .../DdosCustomPoliciesImpl.java | 158 + .../implementation/DdosCustomPolicyImpl.java | 212 + .../DdosProtectionPlanImpl.java | 198 + .../DdosProtectionPlansClientImpl.java | 1464 ++++ .../DdosProtectionPlansImpl.java | 181 + .../DefaultSecurityRulesClientImpl.java | 536 ++ .../DefaultSecurityRulesImpl.java | 78 + .../DnsNameAvailabilityResultImpl.java | 33 + .../implementation/DscpConfigurationImpl.java | 275 + .../DscpConfigurationsClientImpl.java | 1263 ++++ .../DscpConfigurationsImpl.java | 181 + ...iveNetworkSecurityGroupListResultImpl.java | 45 + .../EffectiveRouteListResultImpl.java | 45 + .../EndpointServiceResultImpl.java | 41 + .../ExpressRouteCircuitAuthorizationImpl.java | 162 + ...sRouteCircuitAuthorizationsClientImpl.java | 1181 ++++ ...ExpressRouteCircuitAuthorizationsImpl.java | 210 + .../ExpressRouteCircuitConnectionImpl.java | 204 + ...ressRouteCircuitConnectionsClientImpl.java | 1283 ++++ .../ExpressRouteCircuitConnectionsImpl.java | 238 + .../ExpressRouteCircuitImpl.java | 336 + .../ExpressRouteCircuitPeeringImpl.java | 343 + ...ExpressRouteCircuitPeeringsClientImpl.java | 1147 +++ .../ExpressRouteCircuitPeeringsImpl.java | 204 + .../ExpressRouteCircuitStatsImpl.java | 45 + ...ssRouteCircuitsArpTableListResultImpl.java | 45 + .../ExpressRouteCircuitsClientImpl.java | 2747 ++++++++ .../ExpressRouteCircuitsImpl.java | 309 + ...outeCircuitsRoutesTableListResultImpl.java | 45 + ...cuitsRoutesTableSummaryListResultImpl.java | 46 + .../ExpressRouteConnectionImpl.java | 68 + .../ExpressRouteConnectionListImpl.java | 48 + .../ExpressRouteConnectionsClientImpl.java | 1079 +++ .../ExpressRouteConnectionsImpl.java | 137 + .../ExpressRouteCrossConnectionImpl.java | 259 + ...xpressRouteCrossConnectionPeeringImpl.java | 106 + ...outeCrossConnectionPeeringsClientImpl.java | 1182 ++++ ...pressRouteCrossConnectionPeeringsImpl.java | 118 + ...xpressRouteCrossConnectionsClientImpl.java | 2257 ++++++ .../ExpressRouteCrossConnectionsImpl.java | 214 + ...tionsRoutesTableSummaryListResultImpl.java | 46 + .../ExpressRouteGatewayImpl.java | 221 + .../ExpressRouteGatewayListImpl.java | 48 + .../ExpressRouteGatewaysClientImpl.java | 1425 ++++ .../ExpressRouteGatewaysImpl.java | 211 + .../implementation/ExpressRouteLinkImpl.java | 76 + .../ExpressRouteLinksClientImpl.java | 525 ++ .../implementation/ExpressRouteLinksImpl.java | 75 + .../implementation/ExpressRoutePortImpl.java | 273 + .../ExpressRoutePortsClientImpl.java | 1647 +++++ .../implementation/ExpressRoutePortsImpl.java | 212 + .../ExpressRoutePortsLocationImpl.java | 80 + .../ExpressRoutePortsLocationsClientImpl.java | 439 ++ .../ExpressRoutePortsLocationsImpl.java | 71 + .../ExpressRouteServiceProviderImpl.java | 81 + ...xpressRouteServiceProvidersClientImpl.java | 289 + .../ExpressRouteServiceProvidersImpl.java | 47 + .../FirewallPoliciesClientImpl.java | 1289 ++++ .../implementation/FirewallPoliciesImpl.java | 181 + .../implementation/FirewallPolicyImpl.java | 296 + ...FirewallPolicyRuleCollectionGroupImpl.java | 173 + ...lPolicyRuleCollectionGroupsClientImpl.java | 1185 ++++ ...irewallPolicyRuleCollectionGroupsImpl.java | 219 + .../generated/implementation/FlowLogImpl.java | 246 + .../FlowLogInformationImpl.java | 56 + .../implementation/FlowLogsClientImpl.java | 1336 ++++ .../implementation/FlowLogsImpl.java | 192 + .../FrontendIpConfigurationImpl.java | 142 + .../GatewayRouteListResultImpl.java | 41 + ...enerateExpressRoutePortsLoaResultImpl.java | 33 + .../HubIpConfigurationImpl.java | 189 + .../implementation/HubRouteTableImpl.java | 185 + .../HubRouteTablesClientImpl.java | 1139 +++ .../implementation/HubRouteTablesImpl.java | 192 + .../HubVirtualNetworkConnectionImpl.java | 68 + ...ubVirtualNetworkConnectionsClientImpl.java | 1178 ++++ .../HubVirtualNetworkConnectionsImpl.java | 120 + .../implementation/InboundNatRuleImpl.java | 216 + .../InboundNatRulesClientImpl.java | 1200 ++++ .../implementation/InboundNatRulesImpl.java | 198 + .../InboundSecurityRuleImpl.java | 148 + ...boundSecurityRuleOperationsClientImpl.java | 437 ++ .../InboundSecurityRuleOperationsImpl.java | 37 + .../IpAddressAvailabilityResultImpl.java | 48 + .../implementation/IpAllocationImpl.java | 248 + .../IpAllocationsClientImpl.java | 1477 ++++ .../implementation/IpAllocationsImpl.java | 173 + .../implementation/IpConfigurationImpl.java | 76 + .../IpConfigurationProfileImpl.java | 61 + .../generated/implementation/IpGroupImpl.java | 216 + .../implementation/IpGroupsClientImpl.java | 1463 ++++ .../implementation/IpGroupsImpl.java | 173 + ...BalancerBackendAddressPoolsClientImpl.java | 1174 ++++ .../LoadBalancerBackendAddressPoolsImpl.java | 202 + ...cerFrontendIpConfigurationsClientImpl.java | 541 ++ ...dBalancerFrontendIpConfigurationsImpl.java | 80 + .../implementation/LoadBalancerImpl.java | 347 + ...dBalancerLoadBalancingRulesClientImpl.java | 531 ++ .../LoadBalancerLoadBalancingRulesImpl.java | 75 + ...adBalancerNetworkInterfacesClientImpl.java | 346 + .../LoadBalancerNetworkInterfacesImpl.java | 48 + .../LoadBalancerOutboundRulesClientImpl.java | 527 ++ .../LoadBalancerOutboundRulesImpl.java | 74 + .../LoadBalancerProbesClientImpl.java | 521 ++ .../LoadBalancerProbesImpl.java | 73 + .../LoadBalancersClientImpl.java | 1727 +++++ .../implementation/LoadBalancersImpl.java | 182 + .../implementation/LoadBalancingRuleImpl.java | 107 + .../LocalNetworkGatewayImpl.java | 225 + .../LocalNetworkGatewaysClientImpl.java | 1254 ++++ .../LocalNetworkGatewaysImpl.java | 175 + .../implementation/NatGatewayImpl.java | 259 + .../implementation/NatGatewaysClientImpl.java | 1464 ++++ .../implementation/NatGatewaysImpl.java | 173 + .../implementation/NatRulesClientImpl.java | 1127 +++ .../implementation/NatRulesImpl.java | 191 + ...rkConfigurationDiagnosticResponseImpl.java | 41 + .../implementation/NetworkInterfaceImpl.java | 387 + .../NetworkInterfaceIpConfigurationImpl.java | 177 + ...rkInterfaceIpConfigurationsClientImpl.java | 537 ++ .../NetworkInterfaceIpConfigurationsImpl.java | 78 + ...tworkInterfaceLoadBalancersClientImpl.java | 346 + .../NetworkInterfaceLoadBalancersImpl.java | 48 + .../NetworkInterfaceTapConfigurationImpl.java | 162 + ...kInterfaceTapConfigurationsClientImpl.java | 1189 ++++ ...NetworkInterfaceTapConfigurationsImpl.java | 215 + .../NetworkInterfacesClientImpl.java | 4507 ++++++++++++ .../implementation/NetworkInterfacesImpl.java | 472 ++ .../NetworkManagementClientBuilder.java | 149 + .../NetworkManagementClientImpl.java | 1773 +++++ .../implementation/NetworkProfileImpl.java | 217 + .../NetworkProfilesClientImpl.java | 1379 ++++ .../implementation/NetworkProfilesImpl.java | 177 + .../NetworkSecurityGroupImpl.java | 268 + .../NetworkSecurityGroupsClientImpl.java | 1514 ++++ .../NetworkSecurityGroupsImpl.java | 190 + .../NetworkVirtualApplianceImpl.java | 296 + .../NetworkVirtualApplianceSkuImpl.java | 84 + .../NetworkVirtualAppliancesClientImpl.java | 1528 ++++ .../NetworkVirtualAppliancesImpl.java | 190 + .../implementation/NetworkWatcherImpl.java | 337 + .../NetworkWatchersClientImpl.java | 4714 +++++++++++++ .../implementation/NetworkWatchersImpl.java | 483 ++ .../implementation/NextHopResultImpl.java | 41 + .../implementation/OperationImpl.java | 46 + .../implementation/OperationsClientImpl.java | 270 + .../implementation/OperationsImpl.java | 46 + .../implementation/OutboundRuleImpl.java | 82 + .../P2SVpnConnectionHealthImpl.java | 33 + .../implementation/P2SVpnGatewayImpl.java | 293 + .../P2SVpnGatewaysClientImpl.java | 2931 ++++++++ .../implementation/P2SVpnGatewaysImpl.java | 272 + .../PacketCaptureQueryStatusResultImpl.java | 63 + .../PacketCaptureResultImpl.java | 79 + .../PacketCapturesClientImpl.java | 1614 +++++ .../implementation/PacketCapturesImpl.java | 143 + ...PeerExpressRouteCircuitConnectionImpl.java | 76 + ...ressRouteCircuitConnectionsClientImpl.java | 562 ++ ...eerExpressRouteCircuitConnectionsImpl.java | 79 + .../implementation/PeerRouteListImpl.java | 40 + .../PrivateDnsZoneGroupImpl.java | 58 + .../PrivateDnsZoneGroupsClientImpl.java | 1175 ++++ .../PrivateDnsZoneGroupsImpl.java | 122 + .../PrivateEndpointConnectionImpl.java | 70 + .../implementation/PrivateEndpointImpl.java | 258 + .../PrivateEndpointsClientImpl.java | 1293 ++++ .../implementation/PrivateEndpointsImpl.java | 184 + .../PrivateLinkServiceImpl.java | 304 + ...PrivateLinkServiceIpConfigurationImpl.java | 79 + .../PrivateLinkServiceVisibilityImpl.java | 33 + .../PrivateLinkServicesClientImpl.java | 3447 +++++++++ .../PrivateLinkServicesImpl.java | 360 + .../generated/implementation/ProbeImpl.java | 81 + .../implementation/PublicIpAddressImpl.java | 380 + .../PublicIpAddressesClientImpl.java | 3543 ++++++++++ .../implementation/PublicIpAddressesImpl.java | 401 ++ .../implementation/PublicIpPrefixImpl.java | 300 + .../PublicIpPrefixesClientImpl.java | 1478 ++++ .../implementation/PublicIpPrefixesImpl.java | 181 + .../ResourceNavigationLinksClientImpl.java | 242 + .../ResourceNavigationLinksImpl.java | 64 + ...ResourceNavigationLinksListResultImpl.java | 45 + .../ResourceProvidersClientImpl.java | 2287 ++++++ .../implementation/ResourceProvidersImpl.java | 196 + .../implementation/RouteFilterImpl.java | 236 + .../implementation/RouteFilterRuleImpl.java | 70 + .../RouteFilterRulesClientImpl.java | 1156 +++ .../implementation/RouteFilterRulesImpl.java | 116 + .../RouteFiltersClientImpl.java | 1479 ++++ .../implementation/RouteFiltersImpl.java | 173 + .../generated/implementation/RouteImpl.java | 177 + .../implementation/RouteTableImpl.java | 229 + .../implementation/RouteTablesClientImpl.java | 1464 ++++ .../implementation/RouteTablesImpl.java | 173 + .../implementation/RoutesClientImpl.java | 1115 +++ .../generated/implementation/RoutesImpl.java | 188 + .../SecurityGroupViewResultImpl.java | 41 + .../SecurityPartnerProviderImpl.java | 209 + .../SecurityPartnerProvidersClientImpl.java | 1494 ++++ .../SecurityPartnerProvidersImpl.java | 189 + .../implementation/SecurityRuleImpl.java | 331 + .../SecurityRulesClientImpl.java | 1173 ++++ .../implementation/SecurityRulesImpl.java | 208 + .../ServiceAssociationLinksClientImpl.java | 242 + .../ServiceAssociationLinksImpl.java | 64 + ...ServiceAssociationLinksListResultImpl.java | 45 + .../ServiceEndpointPoliciesClientImpl.java | 1524 ++++ .../ServiceEndpointPoliciesImpl.java | 190 + .../ServiceEndpointPolicyDefinitionImpl.java | 65 + ...ceEndpointPolicyDefinitionsClientImpl.java | 1290 ++++ .../ServiceEndpointPolicyDefinitionsImpl.java | 142 + .../ServiceEndpointPolicyImpl.java | 230 + .../implementation/ServiceTagsClientImpl.java | 206 + .../implementation/ServiceTagsImpl.java | 59 + .../ServiceTagsListResultImpl.java | 65 + .../generated/implementation/SubnetImpl.java | 417 ++ .../implementation/SubnetsClientImpl.java | 1887 +++++ .../generated/implementation/SubnetsImpl.java | 243 + .../implementation/TopologyImpl.java | 52 + .../TroubleshootingResultImpl.java | 54 + .../generated/implementation/UsageImpl.java | 49 + .../implementation/UsagesClientImpl.java | 307 + .../generated/implementation/UsagesImpl.java | 46 + .../generated/implementation/Utils.java | 204 + .../VerificationIpFlowResultImpl.java | 38 + .../VirtualApplianceSiteImpl.java | 160 + .../VirtualApplianceSitesClientImpl.java | 1173 ++++ .../VirtualApplianceSitesImpl.java | 217 + .../VirtualApplianceSkusClientImpl.java | 427 ++ .../VirtualApplianceSkusImpl.java | 71 + .../VirtualHubBgpConnectionsClientImpl.java | 1672 +++++ .../VirtualHubBgpConnectionsImpl.java | 236 + .../implementation/VirtualHubImpl.java | 378 + .../VirtualHubIpConfigurationsClientImpl.java | 1140 +++ .../VirtualHubIpConfigurationsImpl.java | 198 + .../VirtualHubRouteTableV2Impl.java | 67 + .../VirtualHubRouteTableV2SClientImpl.java | 1161 +++ .../VirtualHubRouteTableV2SImpl.java | 117 + .../implementation/VirtualHubsClientImpl.java | 1770 +++++ .../implementation/VirtualHubsImpl.java | 190 + .../VirtualNetworkGatewayConnectionImpl.java | 490 ++ ...etworkGatewayConnectionListEntityImpl.java | 170 + ...alNetworkGatewayConnectionsClientImpl.java | 3480 +++++++++ .../VirtualNetworkGatewayConnectionsImpl.java | 317 + .../VirtualNetworkGatewayImpl.java | 557 ++ .../VirtualNetworkGatewayNatRuleImpl.java | 204 + ...rtualNetworkGatewayNatRulesClientImpl.java | 1194 ++++ .../VirtualNetworkGatewayNatRulesImpl.java | 208 + .../VirtualNetworkGatewaysClientImpl.java | 6250 +++++++++++++++++ .../VirtualNetworkGatewaysImpl.java | 507 ++ .../implementation/VirtualNetworkImpl.java | 319 + .../VirtualNetworkPeeringImpl.java | 297 + .../VirtualNetworkPeeringsClientImpl.java | 1330 ++++ .../VirtualNetworkPeeringsImpl.java | 215 + .../implementation/VirtualNetworkTapImpl.java | 249 + .../VirtualNetworkTapsClientImpl.java | 1439 ++++ .../VirtualNetworkTapsImpl.java | 180 + .../VirtualNetworkUsageImpl.java | 50 + .../VirtualNetworksClientImpl.java | 1947 +++++ .../implementation/VirtualNetworksImpl.java | 222 + .../implementation/VirtualRouterImpl.java | 220 + .../VirtualRouterPeeringImpl.java | 156 + .../VirtualRouterPeeringsClientImpl.java | 1137 +++ .../VirtualRouterPeeringsImpl.java | 196 + .../VirtualRoutersClientImpl.java | 1288 ++++ .../implementation/VirtualRoutersImpl.java | 177 + .../implementation/VirtualWanImpl.java | 242 + .../VirtualWanSecurityProvidersImpl.java | 41 + .../implementation/VirtualWansClientImpl.java | 1435 ++++ .../implementation/VirtualWansImpl.java | 170 + ...tConnectionHealthDetailListResultImpl.java | 41 + .../VpnClientIPsecParametersImpl.java | 67 + .../implementation/VpnConnectionImpl.java | 148 + .../VpnConnectionsClientImpl.java | 1898 +++++ .../implementation/VpnConnectionsImpl.java | 163 + .../implementation/VpnGatewayImpl.java | 305 + .../implementation/VpnGatewayNatRuleImpl.java | 216 + .../implementation/VpnGatewaysClientImpl.java | 2434 +++++++ .../implementation/VpnGatewaysImpl.java | 224 + .../VpnLinkConnectionsClientImpl.java | 1001 +++ .../VpnLinkConnectionsImpl.java | 83 + .../VpnProfileResponseImpl.java | 33 + .../VpnServerConfigurationImpl.java | 368 + ...nsAssociatedWithVirtualWansClientImpl.java | 330 + ...urationsAssociatedWithVirtualWansImpl.java | 57 + .../VpnServerConfigurationsClientImpl.java | 1529 ++++ .../VpnServerConfigurationsImpl.java | 187 + .../VpnServerConfigurationsResponseImpl.java | 40 + .../generated/implementation/VpnSiteImpl.java | 280 + .../VpnSiteLinkConnectionImpl.java | 136 + .../VpnSiteLinkConnectionsClientImpl.java | 265 + .../VpnSiteLinkConnectionsImpl.java | 70 + .../implementation/VpnSiteLinkImpl.java | 67 + .../VpnSiteLinksClientImpl.java | 522 ++ .../implementation/VpnSiteLinksImpl.java | 73 + .../implementation/VpnSitesClientImpl.java | 1432 ++++ .../VpnSitesConfigurationsClientImpl.java | 339 + .../VpnSitesConfigurationsImpl.java | 44 + .../implementation/VpnSitesImpl.java | 170 + ...ApplicationFirewallPoliciesClientImpl.java | 1160 +++ .../WebApplicationFirewallPoliciesImpl.java | 190 + .../WebApplicationFirewallPolicyImpl.java | 253 + .../WebCategoriesClientImpl.java | 458 ++ .../implementation/WebCategoriesImpl.java | 70 + .../implementation/package-info.java | 6 + .../models/AadAuthenticationParameters.java | 102 + .../network/generated/models/Access.java | 34 + .../generated/models/AddressSpace.java | 52 + .../generated/models/ApplicationGateway.java | 936 +++ ...ationGatewayAuthenticationCertificate.java | 132 + ...licationGatewayAutoscaleConfiguration.java | 76 + ...ApplicationGatewayAvailableSslOptions.java | 84 + ...GatewayAvailableSslPredefinedPolicies.java | 83 + ...tionGatewayAvailableWafRuleSetsResult.java | 27 + .../ApplicationGatewayBackendAddress.java | 76 + .../ApplicationGatewayBackendAddressPool.java | 156 + .../ApplicationGatewayBackendHealth.java | 26 + ...ationGatewayBackendHealthHttpSettings.java | 86 + ...plicationGatewayBackendHealthOnDemand.java | 32 + .../ApplicationGatewayBackendHealthPool.java | 85 + ...ApplicationGatewayBackendHealthServer.java | 46 + ...ationGatewayBackendHealthServerHealth.java | 44 + ...ApplicationGatewayBackendHttpSettings.java | 465 ++ ...icationGatewayClientAuthConfiguration.java | 50 + .../ApplicationGatewayConnectionDraining.java | 82 + ...ApplicationGatewayCookieBasedAffinity.java | 35 + .../models/ApplicationGatewayCustomError.java | 76 + ...plicationGatewayCustomErrorStatusCode.java | 35 + ...ationGatewayFirewallDisabledRuleGroup.java | 87 + .../ApplicationGatewayFirewallExclusion.java | 127 + .../ApplicationGatewayFirewallMode.java | 34 + .../ApplicationGatewayFirewallRule.java | 76 + .../ApplicationGatewayFirewallRuleGroup.java | 117 + .../ApplicationGatewayFirewallRuleSet.java | 165 + ...icationGatewayFrontendIpConfiguration.java | 238 + .../ApplicationGatewayFrontendPort.java | 131 + ...ApplicationGatewayHeaderConfiguration.java | 76 + .../ApplicationGatewayHttpListener.java | 373 + .../ApplicationGatewayIpConfiguration.java | 136 + .../models/ApplicationGatewayListResult.java | 81 + .../ApplicationGatewayOnDemandProbe.java | 253 + .../ApplicationGatewayOperationalState.java | 40 + .../models/ApplicationGatewayPathRule.java | 262 + ...ationGatewayPrivateEndpointConnection.java | 77 + ...ayPrivateEndpointConnectionListResult.java | 86 + ...tionGatewayPrivateEndpointConnections.java | 132 + ...cationGatewayPrivateLinkConfiguration.java | 138 + ...tionGatewayPrivateLinkIpConfiguration.java | 213 + ...ApplicationGatewayPrivateLinkResource.java | 68 + ...nGatewayPrivateLinkResourceListResult.java | 86 + ...pplicationGatewayPrivateLinkResources.java | 37 + .../models/ApplicationGatewayProbe.java | 395 ++ ...cationGatewayProbeHealthResponseMatch.java | 81 + .../models/ApplicationGatewayProtocol.java | 34 + ...plicationGatewayRedirectConfiguration.java | 300 + .../ApplicationGatewayRedirectType.java | 40 + .../ApplicationGatewayRequestRoutingRule.java | 314 + ...licationGatewayRequestRoutingRuleType.java | 35 + .../models/ApplicationGatewayRewriteRule.java | 138 + ...pplicationGatewayRewriteRuleActionSet.java | 115 + ...pplicationGatewayRewriteRuleCondition.java | 137 + .../ApplicationGatewayRewriteRuleSet.java | 121 + .../models/ApplicationGatewaySku.java | 102 + .../models/ApplicationGatewaySkuName.java | 49 + .../ApplicationGatewaySslCertificate.java | 205 + .../ApplicationGatewaySslCipherSuite.java | 140 + .../models/ApplicationGatewaySslPolicy.java | 157 + .../ApplicationGatewaySslPolicyName.java | 40 + .../ApplicationGatewaySslPolicyType.java | 34 + ...ApplicationGatewaySslPredefinedPolicy.java | 47 + .../models/ApplicationGatewaySslProfile.java | 195 + .../models/ApplicationGatewaySslProtocol.java | 37 + .../models/ApplicationGatewayTier.java | 40 + ...cationGatewayTrustedClientCertificate.java | 162 + ...licationGatewayTrustedRootCertificate.java | 161 + .../ApplicationGatewayUrlConfiguration.java | 111 + .../models/ApplicationGatewayUrlPathMap.java | 239 + ...ayWebApplicationFirewallConfiguration.java | 318 + .../generated/models/ApplicationGateways.java | 452 ++ .../generated/models/ApplicationRule.java | 282 + .../models/ApplicationSecurityGroup.java | 215 + .../ApplicationSecurityGroupListResult.java | 70 + .../models/ApplicationSecurityGroups.java | 156 + .../generated/models/AssociationType.java | 34 + .../models/AuthenticationMethod.java | 34 + .../models/AuthorizationListResult.java | 83 + .../models/AuthorizationUseStatus.java | 34 + .../AutoApprovedPrivateLinkService.java | 25 + ...AutoApprovedPrivateLinkServicesResult.java | 70 + .../generated/models/Availability.java | 102 + .../generated/models/AvailableDelegation.java | 53 + .../models/AvailableDelegations.java | 34 + .../models/AvailableDelegationsResult.java | 70 + .../models/AvailableEndpointServices.java | 34 + .../models/AvailablePrivateEndpointType.java | 53 + .../models/AvailablePrivateEndpointTypes.java | 60 + .../AvailablePrivateEndpointTypesResult.java | 70 + .../models/AvailableProvidersList.java | 25 + .../models/AvailableProvidersListCity.java | 77 + .../models/AvailableProvidersListCountry.java | 106 + .../AvailableProvidersListParameters.java | 129 + .../models/AvailableProvidersListState.java | 106 + .../AvailableResourceGroupDelegations.java | 36 + .../models/AvailableServiceAlias.java | 45 + .../models/AvailableServiceAliases.java | 60 + .../models/AvailableServiceAliasesResult.java | 70 + .../generated/models/AzureFirewall.java | 438 ++ .../models/AzureFirewallApplicationRule.java | 210 + ...zureFirewallApplicationRuleCollection.java | 178 + .../AzureFirewallApplicationRuleProtocol.java | 78 + ...reFirewallApplicationRuleProtocolType.java | 38 + .../models/AzureFirewallFqdnTag.java | 74 + .../AzureFirewallFqdnTagListResult.java | 81 + .../models/AzureFirewallFqdnTags.java | 31 + .../models/AzureFirewallIpConfiguration.java | 183 + .../models/AzureFirewallIpGroups.java | 54 + .../models/AzureFirewallListResult.java | 81 + .../models/AzureFirewallNatRCAction.java | 50 + .../models/AzureFirewallNatRCActionType.java | 34 + .../models/AzureFirewallNatRule.java | 288 + .../AzureFirewallNatRuleCollection.java | 178 + .../models/AzureFirewallNetworkRule.java | 259 + .../AzureFirewallNetworkRuleCollection.java | 178 + .../AzureFirewallNetworkRuleProtocol.java | 40 + .../models/AzureFirewallPublicIpAddress.java | 50 + .../models/AzureFirewallRCAction.java | 50 + .../models/AzureFirewallRCActionType.java | 34 + .../generated/models/AzureFirewallSku.java | 76 + .../models/AzureFirewallSkuName.java | 34 + .../models/AzureFirewallSkuTier.java | 34 + .../models/AzureFirewallThreatIntelMode.java | 37 + .../generated/models/AzureFirewalls.java | 156 + .../models/AzureReachabilityReport.java | 40 + .../models/AzureReachabilityReportItem.java | 106 + .../AzureReachabilityReportLatencyInfo.java | 80 + .../AzureReachabilityReportLocation.java | 108 + .../AzureReachabilityReportParameters.java | 176 + .../generated/models/AzureWebCategory.java | 52 + .../models/AzureWebCategoryListResult.java | 81 + .../generated/models/BackendAddressPool.java | 293 + .../models/BastionActiveSession.java | 94 + .../BastionActiveSessionListResult.java | 81 + .../models/BastionConnectProtocol.java | 34 + .../network/generated/models/BastionHost.java | 296 + .../models/BastionHostIpConfiguration.java | 186 + .../models/BastionHostListResult.java | 81 + .../generated/models/BastionHostSkuName.java | 34 + .../generated/models/BastionHosts.java | 156 + .../models/BastionSessionDeleteResult.java | 81 + .../generated/models/BastionSessionState.java | 38 + .../models/BastionShareableLink.java | 46 + .../BastionShareableLinkListRequest.java | 55 + .../BastionShareableLinkListResult.java | 81 + .../generated/models/BgpCommunity.java | 184 + .../generated/models/BgpConnection.java | 218 + .../generated/models/BgpPeerState.java | 43 + .../generated/models/BgpPeerStatus.java | 144 + .../models/BgpPeerStatusListResult.java | 25 + .../models/BgpServiceCommunities.java | 31 + .../generated/models/BgpServiceCommunity.java | 68 + .../models/BgpServiceCommunityListResult.java | 81 + .../network/generated/models/BgpSettings.java | 133 + .../models/BreakOutCategoryPolicies.java | 102 + ...ckPrivateLinkServiceVisibilityRequest.java | 50 + .../models/CircuitConnectionStatus.java | 37 + .../generated/models/CommissionedState.java | 46 + .../generated/models/ConnectionMonitor.java | 333 + .../models/ConnectionMonitorDestination.java | 102 + .../models/ConnectionMonitorEndpoint.java | 217 + .../ConnectionMonitorEndpointFilter.java | 81 + .../ConnectionMonitorEndpointFilterItem.java | 77 + ...nnectionMonitorEndpointFilterItemType.java | 32 + .../ConnectionMonitorEndpointFilterType.java | 32 + .../ConnectionMonitorEndpointScope.java | 83 + .../ConnectionMonitorEndpointScopeItem.java | 53 + .../ConnectionMonitorHttpConfiguration.java | 190 + .../ConnectionMonitorIcmpConfiguration.java | 51 + .../models/ConnectionMonitorListResult.java | 55 + .../models/ConnectionMonitorOutput.java | 81 + .../models/ConnectionMonitorParameters.java | 279 + .../models/ConnectionMonitorQueryResult.java | 33 + .../models/ConnectionMonitorResult.java | 460 ++ .../ConnectionMonitorResultProperties.java | 152 + .../models/ConnectionMonitorSource.java | 82 + .../models/ConnectionMonitorSourceStatus.java | 37 + .../ConnectionMonitorSuccessThreshold.java | 82 + .../ConnectionMonitorTcpConfiguration.java | 104 + .../ConnectionMonitorTestConfiguration.java | 262 + ...ctionMonitorTestConfigurationProtocol.java | 38 + .../models/ConnectionMonitorTestGroup.java | 178 + .../models/ConnectionMonitorType.java | 34 + .../ConnectionMonitorWorkspaceSettings.java | 50 + .../generated/models/ConnectionMonitors.java | 221 + .../models/ConnectionResetSharedKey.java | 24 + .../generated/models/ConnectionSharedKey.java | 31 + .../generated/models/ConnectionState.java | 37 + .../models/ConnectionStateSnapshot.java | 278 + .../generated/models/ConnectionStatus.java | 40 + .../models/ConnectivityDestination.java | 103 + .../generated/models/ConnectivityHop.java | 169 + .../models/ConnectivityInformation.java | 67 + .../generated/models/ConnectivityIssue.java | 86 + .../models/ConnectivityParameters.java | 172 + .../generated/models/ConnectivitySource.java | 82 + .../network/generated/models/Container.java | 31 + .../models/ContainerNetworkInterface.java | 174 + ...ontainerNetworkInterfaceConfiguration.java | 170 + ...tainerNetworkInterfaceIpConfiguration.java | 99 + .../generated/models/CoverageLevel.java | 46 + .../CustomDnsConfigPropertiesFormat.java | 77 + .../generated/models/CustomIpPrefix.java | 367 + .../models/CustomIpPrefixListResult.java | 81 + .../generated/models/CustomIpPrefixes.java | 158 + .../generated/models/DdosCustomPolicies.java | 112 + .../generated/models/DdosCustomPolicy.java | 243 + .../models/DdosCustomPolicyProtocol.java | 37 + ...ustomPolicyTriggerSensitivityOverride.java | 41 + .../generated/models/DdosProtectionPlan.java | 225 + .../models/DdosProtectionPlanListResult.java | 70 + .../generated/models/DdosProtectionPlans.java | 156 + .../generated/models/DdosSettings.java | 106 + .../DdosSettingsProtectionCoverage.java | 34 + .../models/DefaultSecurityRules.java | 65 + .../network/generated/models/Delegation.java | 164 + .../generated/models/DeleteOptions.java | 34 + .../models/DestinationPortBehavior.java | 34 + .../generated/models/DeviceProperties.java | 102 + .../network/generated/models/DhGroup.java | 52 + .../network/generated/models/DhcpOptions.java | 54 + .../network/generated/models/Dimension.java | 102 + .../network/generated/models/Direction.java | 34 + .../models/DnsNameAvailabilityResult.java | 24 + .../network/generated/models/DnsSettings.java | 103 + .../generated/models/DscpConfiguration.java | 404 ++ .../models/DscpConfigurationListResult.java | 70 + .../generated/models/DscpConfigurations.java | 156 + .../models/EffectiveNetworkSecurityGroup.java | 137 + ...ectiveNetworkSecurityGroupAssociation.java | 103 + ...fectiveNetworkSecurityGroupListResult.java | 33 + .../models/EffectiveNetworkSecurityRule.java | 433 ++ .../generated/models/EffectiveRoute.java | 210 + .../models/EffectiveRouteListResult.java | 32 + .../models/EffectiveRouteSource.java | 40 + .../generated/models/EffectiveRouteState.java | 34 + .../models/EffectiveRoutesParameters.java | 80 + .../models/EffectiveSecurityRuleProtocol.java | 37 + .../models/EndpointServiceResult.java | 38 + .../models/EndpointServicesListResult.java | 81 + .../generated/models/EndpointType.java | 46 + .../network/generated/models/Error.java | 40 + .../generated/models/ErrorException.java | 37 + .../models/EvaluatedNetworkSecurityGroup.java | 124 + .../generated/models/EvaluationState.java | 37 + .../generated/models/ExpressRouteCircuit.java | 461 ++ .../models/ExpressRouteCircuitArpTable.java | 128 + .../ExpressRouteCircuitAuthorization.java | 220 + .../ExpressRouteCircuitAuthorizations.java | 142 + .../models/ExpressRouteCircuitConnection.java | 335 + ...pressRouteCircuitConnectionListResult.java | 85 + .../ExpressRouteCircuitConnections.java | 151 + .../models/ExpressRouteCircuitListResult.java | 81 + .../models/ExpressRouteCircuitPeering.java | 680 ++ ...uitPeeringAdvertisedPublicPrefixState.java | 43 + .../ExpressRouteCircuitPeeringConfig.java | 170 + .../models/ExpressRouteCircuitPeeringId.java | 50 + .../ExpressRouteCircuitPeeringListResult.java | 81 + .../ExpressRouteCircuitPeeringState.java | 34 + .../models/ExpressRouteCircuitPeerings.java | 142 + .../models/ExpressRouteCircuitReference.java | 50 + .../ExpressRouteCircuitRoutesTable.java | 157 + ...ExpressRouteCircuitRoutesTableSummary.java | 160 + ...RouteCircuitServiceProviderProperties.java | 103 + .../models/ExpressRouteCircuitSku.java | 102 + .../models/ExpressRouteCircuitSkuFamily.java | 34 + .../models/ExpressRouteCircuitSkuTier.java | 40 + .../models/ExpressRouteCircuitStats.java | 45 + .../models/ExpressRouteCircuits.java | 305 + ...xpressRouteCircuitsArpTableListResult.java | 33 + ...essRouteCircuitsRoutesTableListResult.java | 33 + ...eCircuitsRoutesTableSummaryListResult.java | 34 + .../models/ExpressRouteConnection.java | 81 + .../models/ExpressRouteConnectionId.java | 39 + .../models/ExpressRouteConnectionList.java | 25 + .../models/ExpressRouteConnections.java | 129 + .../models/ExpressRouteCrossConnection.java | 323 + ...ExpressRouteCrossConnectionListResult.java | 70 + .../ExpressRouteCrossConnectionPeering.java | 146 + ...xpressRouteCrossConnectionPeeringList.java | 70 + .../ExpressRouteCrossConnectionPeerings.java | 132 + ...outeCrossConnectionRoutesTableSummary.java | 135 + .../models/ExpressRouteCrossConnections.java | 211 + ...nnectionsRoutesTableSummaryListResult.java | 34 + .../generated/models/ExpressRouteGateway.java | 253 + .../models/ExpressRouteGatewayList.java | 25 + ...tewayPropertiesAutoScaleConfiguration.java | 55 + ...ropertiesAutoScaleConfigurationBounds.java | 78 + .../models/ExpressRouteGateways.java | 159 + .../generated/models/ExpressRouteLink.java | 94 + .../models/ExpressRouteLinkAdminState.java | 34 + .../models/ExpressRouteLinkConnectorType.java | 34 + .../models/ExpressRouteLinkListResult.java | 81 + .../models/ExpressRouteLinkMacSecCipher.java | 40 + .../models/ExpressRouteLinkMacSecConfig.java | 128 + .../ExpressRouteLinkMacSecSciState.java | 34 + .../generated/models/ExpressRouteLinks.java | 65 + .../models/ExpressRoutePeeringState.java | 34 + .../models/ExpressRoutePeeringType.java | 37 + .../generated/models/ExpressRoutePort.java | 346 + .../models/ExpressRoutePortListResult.java | 81 + .../generated/models/ExpressRoutePorts.java | 188 + .../ExpressRoutePortsEncapsulation.java | 34 + .../models/ExpressRoutePortsLocation.java | 82 + .../ExpressRoutePortsLocationBandwidths.java | 54 + .../ExpressRoutePortsLocationListResult.java | 81 + .../models/ExpressRoutePortsLocations.java | 59 + .../models/ExpressRouteServiceProvider.java | 75 + ...RouteServiceProviderBandwidthsOffered.java | 77 + ...ExpressRouteServiceProviderListResult.java | 81 + .../models/ExpressRouteServiceProviders.java | 31 + .../generated/models/ExtendedLocation.java | 76 + .../models/ExtendedLocationTypes.java | 31 + .../generated/models/FirewallPolicies.java | 158 + .../generated/models/FirewallPolicy.java | 521 ++ .../FirewallPolicyCertificateAuthority.java | 79 + .../FirewallPolicyFilterRuleCollection.java | 103 + ...ewallPolicyFilterRuleCollectionAction.java | 50 + ...lPolicyFilterRuleCollectionActionType.java | 35 + .../models/FirewallPolicyInsights.java | 105 + .../FirewallPolicyIntrusionDetection.java | 80 + ...nDetectionBypassTrafficSpecifications.java | 240 + ...PolicyIntrusionDetectionConfiguration.java | 86 + ...ewallPolicyIntrusionDetectionProtocol.java | 41 + ...rusionDetectionSignatureSpecification.java | 78 + ...wallPolicyIntrusionDetectionStateType.java | 38 + .../models/FirewallPolicyListResult.java | 81 + .../FirewallPolicyLogAnalyticsResources.java | 81 + .../FirewallPolicyLogAnalyticsWorkspace.java | 77 + .../FirewallPolicyNatRuleCollection.java | 103 + ...FirewallPolicyNatRuleCollectionAction.java | 50 + ...wallPolicyNatRuleCollectionActionType.java | 32 + .../generated/models/FirewallPolicyRule.java | 90 + ...FirewallPolicyRuleApplicationProtocol.java | 77 + ...wallPolicyRuleApplicationProtocolType.java | 35 + .../models/FirewallPolicyRuleCollection.java | 89 + .../FirewallPolicyRuleCollectionGroup.java | 219 + ...llPolicyRuleCollectionGroupListResult.java | 81 + .../FirewallPolicyRuleCollectionGroups.java | 144 + .../FirewallPolicyRuleCollectionType.java | 36 + .../FirewallPolicyRuleNetworkProtocol.java | 40 + .../models/FirewallPolicyRuleType.java | 37 + .../generated/models/FirewallPolicySku.java | 50 + .../models/FirewallPolicySkuTier.java | 34 + .../generated/models/FirewallPolicySnat.java | 51 + .../FirewallPolicyThreatIntelWhitelist.java | 77 + .../FirewallPolicyTransportSecurity.java | 54 + .../network/generated/models/FlowLog.java | 324 + .../models/FlowLogFormatParameters.java | 76 + .../generated/models/FlowLogFormatType.java | 31 + .../generated/models/FlowLogInformation.java | 60 + .../generated/models/FlowLogListResult.java | 70 + .../models/FlowLogStatusParameters.java | 59 + .../network/generated/models/FlowLogs.java | 142 + .../models/FrontendIpConfiguration.java | 141 + .../GatewayLoadBalancerTunnelInterface.java | 128 + ...atewayLoadBalancerTunnelInterfaceType.java | 38 + .../GatewayLoadBalancerTunnelProtocol.java | 37 + .../generated/models/GatewayRoute.java | 129 + .../models/GatewayRouteListResult.java | 25 + .../GenerateExpressRoutePortsLoaRequest.java | 56 + .../GenerateExpressRoutePortsLoaResult.java | 25 + .../GetVpnSitesConfigurationRequest.java | 84 + .../network/generated/models/HopLink.java | 151 + .../generated/models/HttpConfiguration.java | 106 + .../models/HttpConfigurationMethod.java | 34 + .../network/generated/models/HttpHeader.java | 76 + .../network/generated/models/HttpMethod.java | 31 + .../models/HubBgpConnectionStatus.java | 40 + .../generated/models/HubIpAddresses.java | 79 + .../generated/models/HubIpConfiguration.java | 276 + .../models/HubPublicIpAddresses.java | 83 + .../network/generated/models/HubRoute.java | 182 + .../generated/models/HubRouteTable.java | 231 + .../generated/models/HubRouteTables.java | 142 + .../models/HubVirtualNetworkConnection.java | 84 + .../models/HubVirtualNetworkConnections.java | 131 + .../generated/models/IkeEncryption.java | 49 + .../generated/models/IkeIntegrity.java | 46 + .../generated/models/InboundNatPool.java | 343 + .../generated/models/InboundNatRule.java | 410 ++ .../models/InboundNatRuleListResult.java | 70 + .../generated/models/InboundNatRules.java | 144 + .../generated/models/InboundSecurityRule.java | 171 + .../models/InboundSecurityRuleOperations.java | 16 + .../models/InboundSecurityRules.java | 103 + .../models/InboundSecurityRulesProtocol.java | 34 + .../models/IpAddressAvailabilityResult.java | 40 + .../generated/models/IpAllocation.java | 323 + .../models/IpAllocationListResult.java | 81 + .../generated/models/IpAllocationMethod.java | 34 + .../generated/models/IpAllocationType.java | 34 + .../generated/models/IpAllocations.java | 158 + .../generated/models/IpConfiguration.java | 74 + .../IpConfigurationBgpPeeringAddress.java | 110 + .../models/IpConfigurationProfile.java | 60 + .../generated/models/IpFlowProtocol.java | 34 + .../network/generated/models/IpGroup.java | 240 + .../generated/models/IpGroupListResult.java | 81 + .../network/generated/models/IpGroups.java | 172 + .../network/generated/models/IpTag.java | 76 + .../network/generated/models/IpVersion.java | 34 + .../generated/models/IpsecEncryption.java | 55 + .../generated/models/IpsecIntegrity.java | 46 + .../network/generated/models/IpsecPolicy.java | 268 + .../models/Ipv6CircuitConnectionConfig.java | 65 + .../Ipv6ExpressRouteCircuitPeeringConfig.java | 159 + .../network/generated/models/IssueType.java | 55 + .../models/ListHubRouteTablesResult.java | 81 + ...istHubVirtualNetworkConnectionsResult.java | 81 + .../models/ListP2SVpnGatewaysResult.java | 84 + .../ListVirtualHubBgpConnectionResults.java | 81 + .../ListVirtualHubIpConfigurationResults.java | 81 + .../ListVirtualHubRouteTableV2SResult.java | 81 + .../models/ListVirtualHubsResult.java | 84 + ...stVirtualNetworkGatewayNatRulesResult.java | 84 + .../models/ListVirtualWansResult.java | 84 + .../models/ListVpnConnectionsResult.java | 84 + .../models/ListVpnGatewayNatRulesResult.java | 84 + .../models/ListVpnGatewaysResult.java | 84 + .../ListVpnServerConfigurationsResult.java | 84 + .../ListVpnSiteLinkConnectionsResult.java | 84 + .../models/ListVpnSiteLinksResult.java | 84 + .../generated/models/ListVpnSitesResult.java | 84 + .../generated/models/LoadBalancer.java | 413 ++ .../models/LoadBalancerBackendAddress.java | 176 + ...dBalancerBackendAddressPoolListResult.java | 70 + .../LoadBalancerBackendAddressPools.java | 142 + ...ncerFrontendIpConfigurationListResult.java | 71 + .../LoadBalancerFrontendIpConfigurations.java | 65 + .../models/LoadBalancerListResult.java | 70 + ...adBalancerLoadBalancingRuleListResult.java | 70 + .../LoadBalancerLoadBalancingRules.java | 65 + .../models/LoadBalancerNetworkInterfaces.java | 36 + .../LoadBalancerOutboundRuleListResult.java | 70 + .../LoadBalancerOutboundRuleProtocol.java | 37 + .../models/LoadBalancerOutboundRules.java | 65 + .../models/LoadBalancerProbeListResult.java | 70 + .../generated/models/LoadBalancerProbes.java | 65 + .../generated/models/LoadBalancerSku.java | 76 + .../generated/models/LoadBalancerSkuName.java | 37 + .../generated/models/LoadBalancerSkuTier.java | 34 + .../models/LoadBalancerVipSwapRequest.java | 55 + ...VipSwapRequestFrontendIpConfiguration.java | 80 + .../generated/models/LoadBalancers.java | 181 + .../generated/models/LoadBalancingRule.java | 147 + .../generated/models/LoadDistribution.java | 37 + .../generated/models/LocalNetworkGateway.java | 286 + .../models/LocalNetworkGatewayListResult.java | 70 + .../models/LocalNetworkGateways.java | 136 + .../generated/models/LogSpecification.java | 102 + .../models/ManagedRuleEnabledState.java | 31 + .../models/ManagedRuleGroupOverride.java | 89 + .../generated/models/ManagedRuleOverride.java | 81 + .../generated/models/ManagedRuleSet.java | 116 + .../models/ManagedRulesDefinition.java | 88 + .../models/ManagedServiceIdentity.java | 135 + ...ServiceIdentityUserAssignedIdentities.java | 55 + .../generated/models/MatchCondition.java | 172 + .../generated/models/MatchVariable.java | 81 + .../network/generated/models/MatchedRule.java | 77 + .../generated/models/MetricSpecification.java | 395 ++ .../network/generated/models/NatGateway.java | 316 + .../models/NatGatewayListResult.java | 81 + .../generated/models/NatGatewaySku.java | 50 + .../generated/models/NatGatewaySkuName.java | 31 + .../network/generated/models/NatGateways.java | 158 + .../network/generated/models/NatRule.java | 253 + .../network/generated/models/NatRules.java | 142 + ...workConfigurationDiagnosticParameters.java | 122 + ...NetworkConfigurationDiagnosticProfile.java | 188 + ...etworkConfigurationDiagnosticResponse.java | 26 + .../NetworkConfigurationDiagnosticResult.java | 83 + .../generated/models/NetworkIntentPolicy.java | 81 + .../NetworkIntentPolicyConfiguration.java | 83 + .../generated/models/NetworkInterface.java | 491 ++ .../models/NetworkInterfaceAssociation.java | 70 + .../models/NetworkInterfaceDnsSettings.java | 143 + .../NetworkInterfaceIpConfiguration.java | 150 + ...orkInterfaceIpConfigurationListResult.java | 70 + ...rationPrivateLinkConnectionProperties.java | 72 + .../NetworkInterfaceIpConfigurations.java | 67 + .../models/NetworkInterfaceListResult.java | 70 + ...etworkInterfaceLoadBalancerListResult.java | 70 + .../models/NetworkInterfaceLoadBalancers.java | 36 + .../NetworkInterfaceMigrationPhase.java | 43 + .../models/NetworkInterfaceNicType.java | 34 + .../NetworkInterfaceTapConfiguration.java | 190 + ...rkInterfaceTapConfigurationListResult.java | 70 + .../NetworkInterfaceTapConfigurations.java | 144 + .../generated/models/NetworkInterfaces.java | 484 ++ .../models/NetworkOperationStatus.java | 37 + .../generated/models/NetworkProfile.java | 242 + .../models/NetworkProfileListResult.java | 81 + .../generated/models/NetworkProfiles.java | 158 + .../network/generated/models/NetworkRule.java | 227 + .../models/NetworkSecurityGroup.java | 260 + .../NetworkSecurityGroupListResult.java | 81 + .../models/NetworkSecurityGroupResult.java | 69 + .../models/NetworkSecurityGroups.java | 158 + .../NetworkSecurityRulesEvaluationResult.java | 180 + .../models/NetworkVirtualAppliance.java | 364 + .../NetworkVirtualApplianceListResult.java | 81 + ...NetworkVirtualApplianceSiteListResult.java | 81 + .../models/NetworkVirtualApplianceSku.java | 82 + .../NetworkVirtualApplianceSkuInstances.java | 54 + .../NetworkVirtualApplianceSkuListResult.java | 81 + .../models/NetworkVirtualAppliances.java | 158 + .../generated/models/NetworkWatcher.java | 498 ++ .../models/NetworkWatcherListResult.java | 55 + .../generated/models/NetworkWatchers.java | 527 ++ .../generated/models/NextHopParameters.java | 152 + .../generated/models/NextHopResult.java | 40 + .../network/generated/models/NextHopType.java | 46 + .../models/O365BreakOutCategoryPolicies.java | 102 + .../models/O365PolicyProperties.java | 53 + .../models/Office365PolicyProperties.java | 53 + .../models/OfficeTrafficCategory.java | 40 + .../network/generated/models/Operation.java | 45 + .../generated/models/OperationDisplay.java | 128 + .../generated/models/OperationListResult.java | 84 + ...nPropertiesFormatServiceSpecification.java | 86 + .../network/generated/models/Operations.java | 31 + .../network/generated/models/Origin.java | 37 + .../generated/models/OutboundRule.java | 99 + .../network/generated/models/OutputType.java | 31 + .../models/OwaspCrsExclusionEntry.java | 126 + .../OwaspCrsExclusionEntryMatchVariable.java | 38 + ...rsExclusionEntrySelectorMatchOperator.java | 44 + .../models/P2SConnectionConfiguration.java | 186 + .../models/P2SVpnConnectionHealth.java | 25 + .../models/P2SVpnConnectionHealthRequest.java | 80 + .../models/P2SVpnConnectionRequest.java | 51 + .../generated/models/P2SVpnGateway.java | 419 ++ .../generated/models/P2SVpnGateways.java | 295 + .../models/P2SVpnProfileParameters.java | 50 + .../generated/models/PacketCapture.java | 198 + .../generated/models/PacketCaptureFilter.java | 182 + .../models/PacketCaptureListResult.java | 55 + .../models/PacketCaptureParameters.java | 197 + .../PacketCaptureQueryStatusResult.java | 62 + .../generated/models/PacketCaptureResult.java | 89 + .../models/PacketCaptureResultProperties.java | 84 + .../models/PacketCaptureStorageLocation.java | 115 + .../generated/models/PacketCaptures.java | 179 + .../network/generated/models/PcError.java | 43 + .../network/generated/models/PcProtocol.java | 37 + .../network/generated/models/PcStatus.java | 43 + .../PeerExpressRouteCircuitConnection.java | 101 + ...pressRouteCircuitConnectionListResult.java | 87 + .../PeerExpressRouteCircuitConnections.java | 72 + .../network/generated/models/PeerRoute.java | 129 + .../generated/models/PeerRouteList.java | 25 + .../network/generated/models/PfsGroup.java | 55 + .../generated/models/PolicySettings.java | 154 + .../generated/models/PreferredIpVersion.java | 34 + .../models/PreferredRoutingGateway.java | 37 + .../models/PrepareNetworkPoliciesRequest.java | 81 + .../models/PrivateDnsZoneConfig.java | 102 + .../generated/models/PrivateDnsZoneGroup.java | 55 + .../models/PrivateDnsZoneGroupListResult.java | 70 + .../models/PrivateDnsZoneGroups.java | 131 + .../generated/models/PrivateEndpoint.java | 380 + .../models/PrivateEndpointConnection.java | 75 + .../PrivateEndpointConnectionListResult.java | 71 + .../models/PrivateEndpointListResult.java | 70 + .../generated/models/PrivateEndpoints.java | 170 + .../generated/models/PrivateLinkService.java | 445 ++ .../models/PrivateLinkServiceConnection.java | 226 + .../PrivateLinkServiceConnectionState.java | 108 + .../PrivateLinkServiceIpConfiguration.java | 90 + .../models/PrivateLinkServiceListResult.java | 70 + ...vateLinkServicePropertiesAutoApproval.java | 33 + ...rivateLinkServicePropertiesVisibility.java | 33 + .../models/PrivateLinkServiceVisibility.java | 25 + .../generated/models/PrivateLinkServices.java | 413 ++ .../network/generated/models/Probe.java | 105 + .../generated/models/ProbeProtocol.java | 37 + .../models/ProcessorArchitecture.java | 34 + .../models/PropagatedRouteTable.java | 78 + .../network/generated/models/Protocol.java | 40 + .../models/ProtocolConfiguration.java | 53 + .../models/ProtocolCustomSettingsFormat.java | 139 + .../generated/models/ProtocolType.java | 55 + .../generated/models/ProvisioningState.java | 40 + .../generated/models/PublicIpAddress.java | 519 ++ .../models/PublicIpAddressDnsSettings.java | 121 + .../models/PublicIpAddressListResult.java | 81 + .../models/PublicIpAddressMigrationPhase.java | 43 + .../generated/models/PublicIpAddressSku.java | 76 + .../models/PublicIpAddressSkuName.java | 34 + .../models/PublicIpAddressSkuTier.java | 34 + .../generated/models/PublicIpAddresses.java | 395 ++ .../generated/models/PublicIpPrefix.java | 385 + .../models/PublicIpPrefixListResult.java | 81 + .../generated/models/PublicIpPrefixSku.java | 76 + .../models/PublicIpPrefixSkuName.java | 31 + .../models/PublicIpPrefixSkuTier.java | 34 + .../generated/models/PublicIpPrefixes.java | 158 + .../network/generated/models/QosIpRange.java | 76 + .../generated/models/QosPortRange.java | 76 + .../QueryTroubleshootingParameters.java | 56 + .../generated/models/RadiusServer.java | 108 + .../network/generated/models/RecordSet.java | 170 + .../models/ReferencedPublicIpAddress.java | 50 + .../models/ResourceIdentityType.java | 53 + .../models/ResourceNavigationLink.java | 160 + .../models/ResourceNavigationLinks.java | 39 + .../ResourceNavigationLinksListResult.java | 33 + .../generated/models/ResourceProviders.java | 240 + .../network/generated/models/ResourceSet.java | 51 + .../models/RetentionPolicyParameters.java | 76 + .../network/generated/models/Route.java | 311 + .../network/generated/models/RouteFilter.java | 239 + .../models/RouteFilterListResult.java | 81 + .../generated/models/RouteFilterRule.java | 76 + .../models/RouteFilterRuleListResult.java | 81 + .../generated/models/RouteFilterRuleType.java | 31 + .../generated/models/RouteFilterRules.java | 129 + .../generated/models/RouteFilters.java | 158 + .../generated/models/RouteListResult.java | 81 + .../generated/models/RouteNextHopType.java | 43 + .../network/generated/models/RouteTable.java | 262 + .../models/RouteTableListResult.java | 81 + .../network/generated/models/RouteTables.java | 158 + .../network/generated/models/Routes.java | 141 + .../models/RoutingConfiguration.java | 112 + .../generated/models/RoutingState.java | 40 + .../models/SecurityGroupNetworkInterface.java | 80 + .../models/SecurityGroupViewParameters.java | 56 + .../models/SecurityGroupViewResult.java | 25 + .../models/SecurityPartnerProvider.java | 251 + ...curityPartnerProviderConnectionStatus.java | 41 + .../SecurityPartnerProviderListResult.java | 81 + .../models/SecurityPartnerProviders.java | 156 + .../models/SecurityProviderName.java | 37 + .../generated/models/SecurityRule.java | 677 ++ .../generated/models/SecurityRuleAccess.java | 34 + .../models/SecurityRuleAssociations.java | 144 + .../models/SecurityRuleDirection.java | 34 + .../models/SecurityRuleListResult.java | 84 + .../models/SecurityRuleProtocol.java | 46 + .../generated/models/SecurityRules.java | 142 + .../models/ServiceAssociationLink.java | 213 + .../models/ServiceAssociationLinks.java | 39 + .../ServiceAssociationLinksListResult.java | 33 + .../models/ServiceEndpointPolicies.java | 158 + .../models/ServiceEndpointPolicy.java | 250 + .../ServiceEndpointPolicyDefinition.java | 69 + ...iceEndpointPolicyDefinitionListResult.java | 84 + .../ServiceEndpointPolicyDefinitions.java | 141 + .../ServiceEndpointPolicyListResult.java | 70 + .../ServiceEndpointPropertiesFormat.java | 92 + .../ServiceProviderProvisioningState.java | 40 + .../models/ServiceTagInformation.java | 72 + ...ServiceTagInformationPropertiesFormat.java | 100 + .../network/generated/models/ServiceTags.java | 38 + .../models/ServiceTagsListResult.java | 67 + .../network/generated/models/SessionIds.java | 51 + .../network/generated/models/Severity.java | 34 + .../network/generated/models/Sku.java | 50 + .../network/generated/models/StaticRoute.java | 103 + .../network/generated/models/Subnet.java | 650 ++ .../generated/models/SubnetAssociation.java | 70 + .../generated/models/SubnetListResult.java | 81 + .../network/generated/models/Subnets.java | 220 + .../models/SyncRemoteAddressSpace.java | 31 + .../network/generated/models/TagsObject.java | 51 + .../network/generated/models/Topology.java | 47 + .../generated/models/TopologyAssociation.java | 102 + .../generated/models/TopologyParameters.java | 103 + .../generated/models/TopologyResource.java | 135 + ...afficAnalyticsConfigurationProperties.java | 157 + .../models/TrafficAnalyticsProperties.java | 56 + .../models/TrafficSelectorPolicy.java | 89 + .../generated/models/TransportProtocol.java | 37 + .../models/TroubleshootingDetails.java | 158 + .../models/TroubleshootingParameters.java | 122 + .../TroubleshootingRecommendedActions.java | 130 + .../models/TroubleshootingResult.java | 47 + .../models/TunnelConnectionHealth.java | 99 + .../UnprepareNetworkPoliciesRequest.java | 50 + .../network/generated/models/Usage.java | 52 + .../network/generated/models/UsageName.java | 76 + .../network/generated/models/UsageUnit.java | 31 + .../network/generated/models/Usages.java | 34 + .../generated/models/UsagesListResult.java | 81 + .../network/generated/models/VM.java | 66 + .../generated/models/VerbosityLevel.java | 37 + .../models/VerificationIpFlowParameters.java | 285 + .../models/VerificationIpFlowResult.java | 32 + .../models/VirtualApplianceNicProperties.java | 69 + .../models/VirtualApplianceSite.java | 212 + .../models/VirtualApplianceSites.java | 143 + .../models/VirtualApplianceSkuProperties.java | 102 + .../models/VirtualApplianceSkus.java | 55 + .../network/generated/models/VirtualHub.java | 533 ++ .../models/VirtualHubBgpConnections.java | 197 + .../models/VirtualHubEffectiveRoute.java | 155 + .../generated/models/VirtualHubId.java | 54 + .../models/VirtualHubIpConfigurations.java | 142 + .../generated/models/VirtualHubRoute.java | 77 + .../models/VirtualHubRouteTable.java | 54 + .../models/VirtualHubRouteTableV2.java | 61 + .../models/VirtualHubRouteTableV2S.java | 135 + .../generated/models/VirtualHubRouteV2.java | 129 + .../network/generated/models/VirtualHubs.java | 197 + .../generated/models/VirtualNetwork.java | 432 ++ .../models/VirtualNetworkBgpCommunities.java | 71 + ...tualNetworkConnectionGatewayReference.java | 56 + .../models/VirtualNetworkGateway.java | 907 +++ .../VirtualNetworkGatewayConnection.java | 697 ++ ...ualNetworkGatewayConnectionListEntity.java | 210 + ...ualNetworkGatewayConnectionListResult.java | 71 + .../VirtualNetworkGatewayConnectionMode.java | 38 + ...rtualNetworkGatewayConnectionProtocol.java | 35 + ...VirtualNetworkGatewayConnectionStatus.java | 41 + .../VirtualNetworkGatewayConnectionType.java | 41 + .../VirtualNetworkGatewayConnections.java | 380 + .../VirtualNetworkGatewayIpConfiguration.java | 189 + ...alNetworkGatewayListConnectionsResult.java | 72 + .../VirtualNetworkGatewayListResult.java | 71 + .../models/VirtualNetworkGatewayNatRule.java | 310 + .../models/VirtualNetworkGatewayNatRules.java | 144 + .../models/VirtualNetworkGatewaySku.java | 91 + .../models/VirtualNetworkGatewaySkuName.java | 79 + .../models/VirtualNetworkGatewaySkuTier.java | 79 + .../models/VirtualNetworkGatewayType.java | 37 + .../models/VirtualNetworkGateways.java | 675 ++ .../models/VirtualNetworkListResult.java | 81 + .../models/VirtualNetworkListUsageResult.java | 70 + .../models/VirtualNetworkPeering.java | 589 ++ .../models/VirtualNetworkPeeringLevel.java | 40 + .../VirtualNetworkPeeringListResult.java | 81 + .../models/VirtualNetworkPeeringState.java | 37 + .../models/VirtualNetworkPeerings.java | 142 + ...NetworkPrivateEndpointNetworkPolicies.java | 35 + ...workPrivateLinkServiceNetworkPolicies.java | 35 + .../generated/models/VirtualNetworkTap.java | 292 + .../models/VirtualNetworkTapListResult.java | 81 + .../generated/models/VirtualNetworkTaps.java | 156 + .../generated/models/VirtualNetworkUsage.java | 52 + .../models/VirtualNetworkUsageName.java | 54 + .../generated/models/VirtualNetworks.java | 212 + .../generated/models/VirtualRouter.java | 333 + .../models/VirtualRouterListResult.java | 81 + .../models/VirtualRouterPeering.java | 211 + .../VirtualRouterPeeringListResult.java | 81 + .../models/VirtualRouterPeerings.java | 152 + .../generated/models/VirtualRouters.java | 170 + .../network/generated/models/VirtualWan.java | 302 + .../models/VirtualWanSecurityProvider.java | 91 + .../VirtualWanSecurityProviderType.java | 34 + .../models/VirtualWanSecurityProviders.java | 25 + .../VirtualWanVpnProfileParameters.java | 80 + .../network/generated/models/VirtualWans.java | 156 + .../network/generated/models/VnetRoute.java | 54 + .../models/VpnAuthenticationType.java | 37 + .../models/VpnClientConfiguration.java | 372 + .../models/VpnClientConnectionHealth.java | 110 + .../VpnClientConnectionHealthDetail.java | 204 + ...lientConnectionHealthDetailListResult.java | 26 + .../models/VpnClientIPsecParameters.java | 75 + .../generated/models/VpnClientParameters.java | 139 + .../generated/models/VpnClientProtocol.java | 37 + .../models/VpnClientRevokedCertificate.java | 119 + .../models/VpnClientRootCertificate.java | 125 + .../generated/models/VpnConnection.java | 175 + ...onnectionPacketCaptureStartParameters.java | 77 + ...ConnectionPacketCaptureStopParameters.java | 77 + .../generated/models/VpnConnectionStatus.java | 40 + .../generated/models/VpnConnections.java | 233 + .../models/VpnDeviceScriptParameters.java | 102 + .../network/generated/models/VpnGateway.java | 413 ++ .../models/VpnGatewayGeneration.java | 37 + .../models/VpnGatewayIpConfiguration.java | 102 + .../generated/models/VpnGatewayNatRule.java | 324 + ...pnGatewayPacketCaptureStartParameters.java | 50 + ...VpnGatewayPacketCaptureStopParameters.java | 50 + .../models/VpnGatewayTunnelingProtocol.java | 34 + .../network/generated/models/VpnGateways.java | 268 + .../generated/models/VpnLinkBgpSettings.java | 76 + .../models/VpnLinkConnectionMode.java | 37 + .../generated/models/VpnLinkConnections.java | 107 + .../models/VpnLinkProviderProperties.java | 76 + .../generated/models/VpnNatRuleMapping.java | 50 + .../generated/models/VpnNatRuleMode.java | 34 + .../generated/models/VpnNatRuleType.java | 34 + .../VpnPacketCaptureStartParameters.java | 50 + .../VpnPacketCaptureStopParameters.java | 50 + .../generated/models/VpnProfileResponse.java | 24 + ...rverConfigRadiusClientRootCertificate.java | 76 + ...rverConfigRadiusServerRootCertificate.java | 76 + ...rverConfigVpnClientRevokedCertificate.java | 76 + ...nServerConfigVpnClientRootCertificate.java | 76 + .../models/VpnServerConfiguration.java | 454 ++ .../models/VpnServerConfigurations.java | 156 + ...nfigurationsAssociatedWithVirtualWans.java | 35 + .../VpnServerConfigurationsResponse.java | 26 + .../network/generated/models/VpnSite.java | 372 + .../network/generated/models/VpnSiteLink.java | 81 + .../models/VpnSiteLinkConnection.java | 167 + .../models/VpnSiteLinkConnections.java | 46 + .../generated/models/VpnSiteLinks.java | 65 + .../network/generated/models/VpnSites.java | 155 + .../models/VpnSitesConfigurations.java | 36 + .../network/generated/models/VpnType.java | 34 + .../models/WebApplicationFirewallAction.java | 37 + .../WebApplicationFirewallCustomRule.java | 196 + .../WebApplicationFirewallEnabledState.java | 34 + .../WebApplicationFirewallMatchVariable.java | 53 + .../models/WebApplicationFirewallMode.java | 34 + .../WebApplicationFirewallOperator.java | 61 + .../WebApplicationFirewallPolicies.java | 156 + .../models/WebApplicationFirewallPolicy.java | 326 + ...ebApplicationFirewallPolicyListResult.java | 63 + ...pplicationFirewallPolicyResourceState.java | 47 + .../WebApplicationFirewallRuleType.java | 34 + .../WebApplicationFirewallTransform.java | 46 + .../generated/models/WebCategories.java | 56 + .../generated/models/package-info.java | 6 + .../network/generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/network/ci.yml | 33 + sdk/network/pom.xml | 53 + 1464 files changed, 340322 insertions(+) create mode 100644 sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md create mode 100644 sdk/network/azure-resourcemanager-network-generated/README.md create mode 100644 sdk/network/azure-resourcemanager-network-generated/pom.xml create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BastionHostsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BgpServiceCommunitiesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectionMonitorsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/CustomIpPrefixesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosCustomPoliciesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosProtectionPlansClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DefaultSecurityRulesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DscpConfigurationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitAuthorizationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitPeeringsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionPeeringsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteGatewaysClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteLinksClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsLocationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteServiceProvidersClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPoliciesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FlowLogsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubRouteTablesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubVirtualNetworkConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundNatRulesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundSecurityRuleOperationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpAllocationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpGroupsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerBackendAddressPoolsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerFrontendIpConfigurationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerLoadBalancingRulesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerNetworkInterfacesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerOutboundRulesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerProbesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancersClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LocalNetworkGatewaysClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatGatewaysClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatRulesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceIpConfigurationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceLoadBalancersClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceTapConfigurationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfacesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagementClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkProfilesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkSecurityGroupsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualAppliancesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkWatchersClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/OperationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/P2SVpnGatewaysClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PacketCapturesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PeerExpressRouteCircuitConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateDnsZoneGroupsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateEndpointsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateLinkServicesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpAddressesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpPrefixesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceNavigationLinksClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceProvidersClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFilterRulesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFiltersClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteTablesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityPartnerProvidersClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityRulesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceAssociationLinksClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPoliciesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPolicyDefinitionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubnetsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/UsagesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSitesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSkusClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubBgpConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubIpConfigurationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubRouteTableV2SClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayNatRulesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewaysClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkPeeringsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkTapsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworksClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRouterPeeringsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRoutersClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualWansClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnGatewaysClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnLinkConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsAssociatedWithVirtualWansClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinkConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinksClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesConfigurationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebApplicationFirewallPoliciesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebCategoriesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthOnDemandInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthServerInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AutoApprovedPrivateLinkServiceInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableDelegationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailablePrivateEndpointTypeInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableProvidersListInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableServiceAliasInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureReachabilityReportInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionActiveSessionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionSessionStateInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionShareableLinkInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpPeerStatusListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorQueryResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityInformationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DnsNameAvailabilityResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveNetworkSecurityGroupListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EndpointServiceResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitAuthorizationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitStatsInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionListInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayListInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInformationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GatewayRouteListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GenerateExpressRoutePortsLoaResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAddressAvailabilityResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfileInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkConfigurationDiagnosticResponseInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfileInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NextHopResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnConnectionHealthInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureQueryStatusResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerRouteListInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceVisibilityInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbeInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinksListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTableInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityGroupViewResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinksListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagsListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TopologyInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/UsageInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VerificationIpFlowResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Inner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkUsageInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanSecurityProvidersInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientConnectionHealthDetailListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientIPsecParametersInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnProfileResponseInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationsResponseInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/package-info.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableSslOptionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthServerImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressPoolImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionActiveSessionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpPeerStatusListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorQueryResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityInformationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlanImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DnsNameAvailabilityResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionListImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayListImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProviderImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogInformationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GatewayRouteListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GenerateExpressRoutePortsLoaResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTableImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancingRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewayImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewayImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfileImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceSkuImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceVisibilityImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTableImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityGroupViewResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProviderImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TopologyImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TroubleshootingResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/Utils.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSiteImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanSecurityProvidersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayNatRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Access.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressSpace.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateway.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAuthenticationCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAutoscaleConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslOptions.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslPredefinedPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddressPool.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealth.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthHttpSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHttpSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientAuthConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayConnectionDraining.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCookieBasedAffinity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomError.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomErrorStatusCode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallDisabledRuleGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallExclusion.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendPort.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHeaderConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOnDemandProbe.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOperationalState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPathRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResource.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResourceListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResources.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbe.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbeHealthResponseMatch.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRuleType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleActionSet.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleCondition.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleSet.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCipherSuite.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPredefinedPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedClientCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedRootCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlPathMap.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWebApplicationFirewallConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateways.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroupListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AssociationType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthenticationMethod.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationUseStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkService.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Availability.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegationsResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableEndpointServices.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypesResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCountry.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableResourceGroupDelegations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAlias.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliasesResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewall.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocolType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTag.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTagListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReport.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressPool.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSession.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionConnectProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHost.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostSkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionDeleteResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunityListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CommissionedState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitor.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorDestination.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpoint.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilter.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItem.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItemType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScope.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScopeItem.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorHttpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorIcmpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorOutput.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorQueryResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResultProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSource.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSourceStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSuccessThreshold.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTcpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfigurationProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorWorkspaceSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitors.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionResetSharedKey.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKey.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStateSnapshot.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityDestination.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityHop.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivitySource.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Container.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterface.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CoverageLevel.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomDnsConfigPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefix.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixes.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyTriggerSensitivityOverride.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlan.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlanListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlans.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionCoverage.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultSecurityRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Delegation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteOptions.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DestinationPortBehavior.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeviceProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhcpOptions.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Dimension.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Direction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupAssociation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoute.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoutesParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServiceResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Error.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluatedNetworkSecurityGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluationState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuit.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitArpTable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorization.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorizations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeering.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringConfig.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringId.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeerings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitReference.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTableSummary.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitServiceProviderProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuFamily.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitStats.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsArpTableListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableSummaryListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionId.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeerings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionRoutesTableSummary.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateway.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateways.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLink.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkAdminState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkConnectorType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecCipher.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecConfig.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecSciState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinks.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePort.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePorts.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsEncapsulation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationBandwidths.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProvider.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderBandwidthsOffered.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviders.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocationTypes.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyInsights.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyThreatIntelWhitelist.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyTransportSecurity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLog.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogInformation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogStatusParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogs.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FrontendIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterface.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterfaceType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRoute.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetVpnSitesConfigurationRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HopLink.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfigurationMethod.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpHeader.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpMethod.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubBgpConnectionStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpAddresses.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubPublicIpAddresses.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoute.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTables.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeEncryption.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeIntegrity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatPool.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRuleListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpFlowProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroupListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpTag.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpVersion.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecEncryption.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecIntegrity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6CircuitConnectionConfig.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6ExpressRouteCircuitPeeringConfig.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IssueType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubRouteTablesResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubVirtualNetworkConnectionsResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListP2SVpnGatewaysResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubBgpConnectionResults.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubIpConfigurationResults.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubRouteTableV2SResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubsResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualNetworkGatewayNatRulesResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualWansResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnConnectionsResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewayNatRulesResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewaysResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationsResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinkConnectionsResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinksResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSitesResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancer.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddress.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPoolListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPools.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRuleListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerNetworkInterfaces.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbeListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbes.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequestFrontendIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancers.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancingRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadDistribution.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateway.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGatewayListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateways.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LogSpecification.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleEnabledState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleGroupOverride.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleOverride.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleSet.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRulesDefinition.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentityUserAssignedIdentities.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchCondition.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchVariable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchedRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MetricSpecification.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateway.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewayListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateways.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticProfile.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterface.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAssociation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceDnsSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancerListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancers.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceMigrationPhase.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceNicType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaces.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkOperationStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfile.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfileListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfiles.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityRulesEvaluationResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliance.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuInstances.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcher.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365BreakOutCategoryPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365PolicyProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Office365PolicyProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OfficeTrafficCategory.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationPropertiesFormatServiceSpecification.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Origin.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntry.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntryMatchVariable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntrySelectorMatchOperator.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SConnectionConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealth.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealthRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateway.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateways.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnProfileParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCapture.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureFilter.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureQueryStatusResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResultProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureStorageLocation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptures.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcError.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRoute.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoints.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkService.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesAutoApproval.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Probe.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProcessorArchitecture.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PropagatedRouteTable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Protocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolCustomSettingsFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProvisioningState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddress.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressMigrationPhase.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddresses.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefix.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixes.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosIpRange.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosPortRange.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryTroubleshootingParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RadiusServer.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RecordSet.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ReferencedPublicIpAddress.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceIdentityType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinks.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinksListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceSet.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RetentionPolicyParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Route.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteNextHopType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTableListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTables.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Routes.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupNetworkInterface.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderConnectionStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviders.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityProviderName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAssociations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleDirection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLink.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinks.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinksListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinition.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitions.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTags.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagsListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Severity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Sku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoute.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnet.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnets.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncRemoteAddressSpace.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TagsObject.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyResource.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsConfigurationProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficSelectorPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TransportProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingDetails.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingRecommendedActions.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UnprepareNetworkPoliciesRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageUnit.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usages.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsagesListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VM.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNicProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSites.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkuProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHub.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubBgpConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubEffectiveRoute.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubId.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubIpConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRoute.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteV2.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubs.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetwork.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkBgpCommunities.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkConnectionGatewayReference.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateway.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListEntity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListConnectionsResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateways.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListUsageResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeering.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeerings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateEndpointNetworkPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateLinkServiceNetworkPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTap.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTaps.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsage.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsageName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworks.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouter.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeering.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeeringListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeerings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWan.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProvider.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviderType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviders.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWans.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetRoute.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnAuthenticationType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealth.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetail.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRevokedCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRootCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStopParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnDeviceScriptParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateway.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayGeneration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayNatRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStartParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStopParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayTunnelingProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateways.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkBgpSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnectionMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkProviderProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMapping.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStartParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStopParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnProfileResponse.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusServerRootCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRevokedCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRootCertificate.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsAssociatedWithVirtualWans.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsResponse.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSite.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLink.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinks.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSites.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSitesConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallAction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallCustomRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallEnabledState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMatchVariable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallOperator.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyResourceState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallRuleType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallTransform.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebCategories.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/package-info.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java create mode 100644 sdk/network/ci.yml create mode 100644 sdk/network/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 71bc8a1bef7ca..c4e0b587c320b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -306,6 +306,7 @@ com.azure.resourcemanager:azure-resourcemanager-postgresqlflexibleserver;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-elastic;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-network-generated;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 0c475ccdb3e4f..aec415fb16b78 100644 --- a/pom.xml +++ b/pom.xml @@ -784,6 +784,7 @@ sdk/monitor sdk/mysql sdk/netapp + sdk/network sdk/notificationhubs sdk/operationsmanagement sdk/peering diff --git a/sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md b/sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md new file mode 100644 index 0000000000000..bbf9d3498a1c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-07-21) + +- Azure Resource Manager Network client library for Java. This package contains Microsoft Azure SDK for Network Management SDK. Network Client. Package tag package-2021-02. 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/network/azure-resourcemanager-network-generated/README.md b/sdk/network/azure-resourcemanager-network-generated/README.md new file mode 100644 index 0000000000000..f5b72dc113d45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager Network client library for Java + +Azure Resource Manager Network client library for Java. + +This package contains Microsoft Azure SDK for Network Management SDK. Network Client. Package tag package-2021-02. 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-network-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-network-generated + 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(); +NetworkManager manager = NetworkManager + .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/main/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/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/network/azure-resourcemanager-network-generated/pom.xml b/sdk/network/azure-resourcemanager-network-generated/pom.xml new file mode 100644 index 0000000000000..4b45554955bbc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-network-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Network Management + This package contains Microsoft Azure SDK for Network Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Network Client. Package tag package-2021-02. + 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.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java new file mode 100644 index 0000000000000..81ac589ce0388 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java @@ -0,0 +1,1549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated; + +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.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.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagementClient; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateLinkResourcesImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationSecurityGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailableDelegationsImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailableEndpointServicesImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailablePrivateEndpointTypesImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailableResourceGroupDelegationsImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailableServiceAliasesImpl; +import com.azure.resourcemanager.network.generated.implementation.AzureFirewallFqdnTagsImpl; +import com.azure.resourcemanager.network.generated.implementation.AzureFirewallsImpl; +import com.azure.resourcemanager.network.generated.implementation.BastionHostsImpl; +import com.azure.resourcemanager.network.generated.implementation.BgpServiceCommunitiesImpl; +import com.azure.resourcemanager.network.generated.implementation.ConnectionMonitorsImpl; +import com.azure.resourcemanager.network.generated.implementation.CustomIpPrefixesImpl; +import com.azure.resourcemanager.network.generated.implementation.DdosCustomPoliciesImpl; +import com.azure.resourcemanager.network.generated.implementation.DdosProtectionPlansImpl; +import com.azure.resourcemanager.network.generated.implementation.DefaultSecurityRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.DscpConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitAuthorizationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitPeeringsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCrossConnectionPeeringsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCrossConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteLinksImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsLocationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteServiceProvidersImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPoliciesImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyRuleCollectionGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.FlowLogsImpl; +import com.azure.resourcemanager.network.generated.implementation.HubRouteTablesImpl; +import com.azure.resourcemanager.network.generated.implementation.HubVirtualNetworkConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.InboundNatRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.InboundSecurityRuleOperationsImpl; +import com.azure.resourcemanager.network.generated.implementation.IpAllocationsImpl; +import com.azure.resourcemanager.network.generated.implementation.IpGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.LoadBalancerBackendAddressPoolsImpl; +import com.azure.resourcemanager.network.generated.implementation.LoadBalancerFrontendIpConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.LoadBalancerLoadBalancingRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.LoadBalancerNetworkInterfacesImpl; +import com.azure.resourcemanager.network.generated.implementation.LoadBalancerOutboundRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.LoadBalancerProbesImpl; +import com.azure.resourcemanager.network.generated.implementation.LoadBalancersImpl; +import com.azure.resourcemanager.network.generated.implementation.LocalNetworkGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.NatGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.NatRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceIpConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceLoadBalancersImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceTapConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkInterfacesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkManagementClientBuilder; +import com.azure.resourcemanager.network.generated.implementation.NetworkProfilesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkSecurityGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkVirtualAppliancesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkWatchersImpl; +import com.azure.resourcemanager.network.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.network.generated.implementation.P2SVpnGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.PacketCapturesImpl; +import com.azure.resourcemanager.network.generated.implementation.PeerExpressRouteCircuitConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.PrivateDnsZoneGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.PrivateEndpointsImpl; +import com.azure.resourcemanager.network.generated.implementation.PrivateLinkServicesImpl; +import com.azure.resourcemanager.network.generated.implementation.PublicIpAddressesImpl; +import com.azure.resourcemanager.network.generated.implementation.PublicIpPrefixesImpl; +import com.azure.resourcemanager.network.generated.implementation.ResourceNavigationLinksImpl; +import com.azure.resourcemanager.network.generated.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.network.generated.implementation.RouteFilterRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.RouteFiltersImpl; +import com.azure.resourcemanager.network.generated.implementation.RouteTablesImpl; +import com.azure.resourcemanager.network.generated.implementation.RoutesImpl; +import com.azure.resourcemanager.network.generated.implementation.SecurityPartnerProvidersImpl; +import com.azure.resourcemanager.network.generated.implementation.SecurityRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.ServiceAssociationLinksImpl; +import com.azure.resourcemanager.network.generated.implementation.ServiceEndpointPoliciesImpl; +import com.azure.resourcemanager.network.generated.implementation.ServiceEndpointPolicyDefinitionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ServiceTagsImpl; +import com.azure.resourcemanager.network.generated.implementation.SubnetsImpl; +import com.azure.resourcemanager.network.generated.implementation.UsagesImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualApplianceSitesImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualApplianceSkusImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualHubBgpConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualHubIpConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualHubRouteTableV2SImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualHubsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewayConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewayNatRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkPeeringsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkTapsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworksImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualRouterPeeringsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualRoutersImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualWansImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnLinkConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnServerConfigurationsAssociatedWithVirtualWansImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnServerConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnSiteLinkConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnSiteLinksImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnSitesConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnSitesImpl; +import com.azure.resourcemanager.network.generated.implementation.WebApplicationFirewallPoliciesImpl; +import com.azure.resourcemanager.network.generated.implementation.WebCategoriesImpl; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnections; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResources; +import com.azure.resourcemanager.network.generated.models.ApplicationGateways; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroups; +import com.azure.resourcemanager.network.generated.models.AvailableDelegations; +import com.azure.resourcemanager.network.generated.models.AvailableEndpointServices; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointTypes; +import com.azure.resourcemanager.network.generated.models.AvailableResourceGroupDelegations; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAliases; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTags; +import com.azure.resourcemanager.network.generated.models.AzureFirewalls; +import com.azure.resourcemanager.network.generated.models.BastionHosts; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunities; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitors; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefixes; +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicies; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlans; +import com.azure.resourcemanager.network.generated.models.DefaultSecurityRules; +import com.azure.resourcemanager.network.generated.models.DscpConfigurations; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorizations; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnections; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeerings; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuits; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnections; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeerings; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnections; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateways; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinks; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePorts; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocations; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviders; +import com.azure.resourcemanager.network.generated.models.FirewallPolicies; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroups; +import com.azure.resourcemanager.network.generated.models.FlowLogs; +import com.azure.resourcemanager.network.generated.models.HubRouteTables; +import com.azure.resourcemanager.network.generated.models.HubVirtualNetworkConnections; +import com.azure.resourcemanager.network.generated.models.InboundNatRules; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleOperations; +import com.azure.resourcemanager.network.generated.models.IpAllocations; +import com.azure.resourcemanager.network.generated.models.IpGroups; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddressPools; +import com.azure.resourcemanager.network.generated.models.LoadBalancerFrontendIpConfigurations; +import com.azure.resourcemanager.network.generated.models.LoadBalancerLoadBalancingRules; +import com.azure.resourcemanager.network.generated.models.LoadBalancerNetworkInterfaces; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRules; +import com.azure.resourcemanager.network.generated.models.LoadBalancerProbes; +import com.azure.resourcemanager.network.generated.models.LoadBalancers; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateways; +import com.azure.resourcemanager.network.generated.models.NatGateways; +import com.azure.resourcemanager.network.generated.models.NatRules; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurations; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceLoadBalancers; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfigurations; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaces; +import com.azure.resourcemanager.network.generated.models.NetworkProfiles; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroups; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliances; +import com.azure.resourcemanager.network.generated.models.NetworkWatchers; +import com.azure.resourcemanager.network.generated.models.Operations; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateways; +import com.azure.resourcemanager.network.generated.models.PacketCaptures; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnections; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroups; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoints; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServices; +import com.azure.resourcemanager.network.generated.models.PublicIpAddresses; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixes; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinks; +import com.azure.resourcemanager.network.generated.models.ResourceProviders; +import com.azure.resourcemanager.network.generated.models.RouteFilterRules; +import com.azure.resourcemanager.network.generated.models.RouteFilters; +import com.azure.resourcemanager.network.generated.models.RouteTables; +import com.azure.resourcemanager.network.generated.models.Routes; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviders; +import com.azure.resourcemanager.network.generated.models.SecurityRules; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLinks; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicies; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinitions; +import com.azure.resourcemanager.network.generated.models.ServiceTags; +import com.azure.resourcemanager.network.generated.models.Subnets; +import com.azure.resourcemanager.network.generated.models.Usages; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSites; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkus; +import com.azure.resourcemanager.network.generated.models.VirtualHubBgpConnections; +import com.azure.resourcemanager.network.generated.models.VirtualHubIpConfigurations; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2S; +import com.azure.resourcemanager.network.generated.models.VirtualHubs; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnections; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRules; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateways; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeerings; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTaps; +import com.azure.resourcemanager.network.generated.models.VirtualNetworks; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeerings; +import com.azure.resourcemanager.network.generated.models.VirtualRouters; +import com.azure.resourcemanager.network.generated.models.VirtualWans; +import com.azure.resourcemanager.network.generated.models.VpnConnections; +import com.azure.resourcemanager.network.generated.models.VpnGateways; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnections; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurations; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsAssociatedWithVirtualWans; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnections; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinks; +import com.azure.resourcemanager.network.generated.models.VpnSites; +import com.azure.resourcemanager.network.generated.models.VpnSitesConfigurations; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicies; +import com.azure.resourcemanager.network.generated.models.WebCategories; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to NetworkManager. Network Client. */ +public final class NetworkManager { + private ApplicationGateways applicationGateways; + + private ApplicationGatewayPrivateLinkResources applicationGatewayPrivateLinkResources; + + private ApplicationGatewayPrivateEndpointConnections applicationGatewayPrivateEndpointConnections; + + private ApplicationSecurityGroups applicationSecurityGroups; + + private AvailableDelegations availableDelegations; + + private AvailableResourceGroupDelegations availableResourceGroupDelegations; + + private AvailableServiceAliases availableServiceAliases; + + private AzureFirewalls azureFirewalls; + + private AzureFirewallFqdnTags azureFirewallFqdnTags; + + private WebCategories webCategories; + + private BastionHosts bastionHosts; + + private ResourceProviders resourceProviders; + + private NetworkInterfaces networkInterfaces; + + private PublicIpAddresses publicIpAddresses; + + private CustomIpPrefixes customIpPrefixes; + + private DdosCustomPolicies ddosCustomPolicies; + + private DdosProtectionPlans ddosProtectionPlans; + + private DscpConfigurations dscpConfigurations; + + private AvailableEndpointServices availableEndpointServices; + + private ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations; + + private ExpressRouteCircuitPeerings expressRouteCircuitPeerings; + + private ExpressRouteCircuitConnections expressRouteCircuitConnections; + + private PeerExpressRouteCircuitConnections peerExpressRouteCircuitConnections; + + private ExpressRouteCircuits expressRouteCircuits; + + private ExpressRouteServiceProviders expressRouteServiceProviders; + + private ExpressRouteCrossConnections expressRouteCrossConnections; + + private ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings; + + private ExpressRoutePortsLocations expressRoutePortsLocations; + + private ExpressRoutePorts expressRoutePorts; + + private ExpressRouteLinks expressRouteLinks; + + private FirewallPolicies firewallPolicies; + + private FirewallPolicyRuleCollectionGroups firewallPolicyRuleCollectionGroups; + + private IpAllocations ipAllocations; + + private IpGroups ipGroups; + + private LoadBalancers loadBalancers; + + private LoadBalancerBackendAddressPools loadBalancerBackendAddressPools; + + private LoadBalancerFrontendIpConfigurations loadBalancerFrontendIpConfigurations; + + private InboundNatRules inboundNatRules; + + private LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules; + + private LoadBalancerOutboundRules loadBalancerOutboundRules; + + private LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces; + + private LoadBalancerProbes loadBalancerProbes; + + private NatGateways natGateways; + + private NetworkInterfaceIpConfigurations networkInterfaceIpConfigurations; + + private NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers; + + private NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations; + + private NetworkProfiles networkProfiles; + + private NetworkSecurityGroups networkSecurityGroups; + + private SecurityRules securityRules; + + private DefaultSecurityRules defaultSecurityRules; + + private NetworkVirtualAppliances networkVirtualAppliances; + + private VirtualApplianceSites virtualApplianceSites; + + private VirtualApplianceSkus virtualApplianceSkus; + + private InboundSecurityRuleOperations inboundSecurityRuleOperations; + + private NetworkWatchers networkWatchers; + + private PacketCaptures packetCaptures; + + private ConnectionMonitors connectionMonitors; + + private FlowLogs flowLogs; + + private Operations operations; + + private PrivateEndpoints privateEndpoints; + + private AvailablePrivateEndpointTypes availablePrivateEndpointTypes; + + private PrivateDnsZoneGroups privateDnsZoneGroups; + + private PrivateLinkServices privateLinkServices; + + private PublicIpPrefixes publicIpPrefixes; + + private RouteFilters routeFilters; + + private RouteFilterRules routeFilterRules; + + private RouteTables routeTables; + + private Routes routes; + + private SecurityPartnerProviders securityPartnerProviders; + + private BgpServiceCommunities bgpServiceCommunities; + + private ServiceEndpointPolicies serviceEndpointPolicies; + + private ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions; + + private ServiceTags serviceTags; + + private Usages usages; + + private VirtualNetworks virtualNetworks; + + private Subnets subnets; + + private ResourceNavigationLinks resourceNavigationLinks; + + private ServiceAssociationLinks serviceAssociationLinks; + + private VirtualNetworkPeerings virtualNetworkPeerings; + + private VirtualNetworkGateways virtualNetworkGateways; + + private VirtualNetworkGatewayConnections virtualNetworkGatewayConnections; + + private LocalNetworkGateways localNetworkGateways; + + private VirtualNetworkGatewayNatRules virtualNetworkGatewayNatRules; + + private VirtualNetworkTaps virtualNetworkTaps; + + private VirtualRouters virtualRouters; + + private VirtualRouterPeerings virtualRouterPeerings; + + private VirtualWans virtualWans; + + private VpnSites vpnSites; + + private VpnSiteLinks vpnSiteLinks; + + private VpnSitesConfigurations vpnSitesConfigurations; + + private VpnServerConfigurations vpnServerConfigurations; + + private VirtualHubs virtualHubs; + + private HubVirtualNetworkConnections hubVirtualNetworkConnections; + + private VpnGateways vpnGateways; + + private VpnLinkConnections vpnLinkConnections; + + private VpnConnections vpnConnections; + + private VpnSiteLinkConnections vpnSiteLinkConnections; + + private NatRules natRules; + + private P2SVpnGateways p2SVpnGateways; + + private VpnServerConfigurationsAssociatedWithVirtualWans vpnServerConfigurationsAssociatedWithVirtualWans; + + private VirtualHubRouteTableV2S virtualHubRouteTableV2S; + + private ExpressRouteGateways expressRouteGateways; + + private ExpressRouteConnections expressRouteConnections; + + private VirtualHubBgpConnections virtualHubBgpConnections; + + private VirtualHubIpConfigurations virtualHubIpConfigurations; + + private HubRouteTables hubRouteTables; + + private WebApplicationFirewallPolicies webApplicationFirewallPolicies; + + private final NetworkManagementClient clientObject; + + private NetworkManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new NetworkManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Network service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Network service API instance. + */ + public static NetworkManager 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 NetworkManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new NetworkManager.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 final List scopes = 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; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the 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 Network service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Network service API instance. + */ + public NetworkManager 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.network.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + 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 ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + 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 NetworkManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of ApplicationGateways. */ + public ApplicationGateways applicationGateways() { + if (this.applicationGateways == null) { + this.applicationGateways = new ApplicationGatewaysImpl(clientObject.getApplicationGateways(), this); + } + return applicationGateways; + } + + /** @return Resource collection API of ApplicationGatewayPrivateLinkResources. */ + public ApplicationGatewayPrivateLinkResources applicationGatewayPrivateLinkResources() { + if (this.applicationGatewayPrivateLinkResources == null) { + this.applicationGatewayPrivateLinkResources = + new ApplicationGatewayPrivateLinkResourcesImpl( + clientObject.getApplicationGatewayPrivateLinkResources(), this); + } + return applicationGatewayPrivateLinkResources; + } + + /** @return Resource collection API of ApplicationGatewayPrivateEndpointConnections. */ + public ApplicationGatewayPrivateEndpointConnections applicationGatewayPrivateEndpointConnections() { + if (this.applicationGatewayPrivateEndpointConnections == null) { + this.applicationGatewayPrivateEndpointConnections = + new ApplicationGatewayPrivateEndpointConnectionsImpl( + clientObject.getApplicationGatewayPrivateEndpointConnections(), this); + } + return applicationGatewayPrivateEndpointConnections; + } + + /** @return Resource collection API of ApplicationSecurityGroups. */ + public ApplicationSecurityGroups applicationSecurityGroups() { + if (this.applicationSecurityGroups == null) { + this.applicationSecurityGroups = + new ApplicationSecurityGroupsImpl(clientObject.getApplicationSecurityGroups(), this); + } + return applicationSecurityGroups; + } + + /** @return Resource collection API of AvailableDelegations. */ + public AvailableDelegations availableDelegations() { + if (this.availableDelegations == null) { + this.availableDelegations = new AvailableDelegationsImpl(clientObject.getAvailableDelegations(), this); + } + return availableDelegations; + } + + /** @return Resource collection API of AvailableResourceGroupDelegations. */ + public AvailableResourceGroupDelegations availableResourceGroupDelegations() { + if (this.availableResourceGroupDelegations == null) { + this.availableResourceGroupDelegations = + new AvailableResourceGroupDelegationsImpl(clientObject.getAvailableResourceGroupDelegations(), this); + } + return availableResourceGroupDelegations; + } + + /** @return Resource collection API of AvailableServiceAliases. */ + public AvailableServiceAliases availableServiceAliases() { + if (this.availableServiceAliases == null) { + this.availableServiceAliases = + new AvailableServiceAliasesImpl(clientObject.getAvailableServiceAliases(), this); + } + return availableServiceAliases; + } + + /** @return Resource collection API of AzureFirewalls. */ + public AzureFirewalls azureFirewalls() { + if (this.azureFirewalls == null) { + this.azureFirewalls = new AzureFirewallsImpl(clientObject.getAzureFirewalls(), this); + } + return azureFirewalls; + } + + /** @return Resource collection API of AzureFirewallFqdnTags. */ + public AzureFirewallFqdnTags azureFirewallFqdnTags() { + if (this.azureFirewallFqdnTags == null) { + this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsImpl(clientObject.getAzureFirewallFqdnTags(), this); + } + return azureFirewallFqdnTags; + } + + /** @return Resource collection API of WebCategories. */ + public WebCategories webCategories() { + if (this.webCategories == null) { + this.webCategories = new WebCategoriesImpl(clientObject.getWebCategories(), this); + } + return webCategories; + } + + /** @return Resource collection API of BastionHosts. */ + public BastionHosts bastionHosts() { + if (this.bastionHosts == null) { + this.bastionHosts = new BastionHostsImpl(clientObject.getBastionHosts(), this); + } + return bastionHosts; + } + + /** @return Resource collection API of ResourceProviders. */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** @return Resource collection API of NetworkInterfaces. */ + public NetworkInterfaces networkInterfaces() { + if (this.networkInterfaces == null) { + this.networkInterfaces = new NetworkInterfacesImpl(clientObject.getNetworkInterfaces(), this); + } + return networkInterfaces; + } + + /** @return Resource collection API of PublicIpAddresses. */ + public PublicIpAddresses publicIpAddresses() { + if (this.publicIpAddresses == null) { + this.publicIpAddresses = new PublicIpAddressesImpl(clientObject.getPublicIpAddresses(), this); + } + return publicIpAddresses; + } + + /** @return Resource collection API of CustomIpPrefixes. */ + public CustomIpPrefixes customIpPrefixes() { + if (this.customIpPrefixes == null) { + this.customIpPrefixes = new CustomIpPrefixesImpl(clientObject.getCustomIpPrefixes(), this); + } + return customIpPrefixes; + } + + /** @return Resource collection API of DdosCustomPolicies. */ + public DdosCustomPolicies ddosCustomPolicies() { + if (this.ddosCustomPolicies == null) { + this.ddosCustomPolicies = new DdosCustomPoliciesImpl(clientObject.getDdosCustomPolicies(), this); + } + return ddosCustomPolicies; + } + + /** @return Resource collection API of DdosProtectionPlans. */ + public DdosProtectionPlans ddosProtectionPlans() { + if (this.ddosProtectionPlans == null) { + this.ddosProtectionPlans = new DdosProtectionPlansImpl(clientObject.getDdosProtectionPlans(), this); + } + return ddosProtectionPlans; + } + + /** @return Resource collection API of DscpConfigurations. */ + public DscpConfigurations dscpConfigurations() { + if (this.dscpConfigurations == null) { + this.dscpConfigurations = new DscpConfigurationsImpl(clientObject.getDscpConfigurations(), this); + } + return dscpConfigurations; + } + + /** @return Resource collection API of AvailableEndpointServices. */ + public AvailableEndpointServices availableEndpointServices() { + if (this.availableEndpointServices == null) { + this.availableEndpointServices = + new AvailableEndpointServicesImpl(clientObject.getAvailableEndpointServices(), this); + } + return availableEndpointServices; + } + + /** @return Resource collection API of ExpressRouteCircuitAuthorizations. */ + public ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations() { + if (this.expressRouteCircuitAuthorizations == null) { + this.expressRouteCircuitAuthorizations = + new ExpressRouteCircuitAuthorizationsImpl(clientObject.getExpressRouteCircuitAuthorizations(), this); + } + return expressRouteCircuitAuthorizations; + } + + /** @return Resource collection API of ExpressRouteCircuitPeerings. */ + public ExpressRouteCircuitPeerings expressRouteCircuitPeerings() { + if (this.expressRouteCircuitPeerings == null) { + this.expressRouteCircuitPeerings = + new ExpressRouteCircuitPeeringsImpl(clientObject.getExpressRouteCircuitPeerings(), this); + } + return expressRouteCircuitPeerings; + } + + /** @return Resource collection API of ExpressRouteCircuitConnections. */ + public ExpressRouteCircuitConnections expressRouteCircuitConnections() { + if (this.expressRouteCircuitConnections == null) { + this.expressRouteCircuitConnections = + new ExpressRouteCircuitConnectionsImpl(clientObject.getExpressRouteCircuitConnections(), this); + } + return expressRouteCircuitConnections; + } + + /** @return Resource collection API of PeerExpressRouteCircuitConnections. */ + public PeerExpressRouteCircuitConnections peerExpressRouteCircuitConnections() { + if (this.peerExpressRouteCircuitConnections == null) { + this.peerExpressRouteCircuitConnections = + new PeerExpressRouteCircuitConnectionsImpl(clientObject.getPeerExpressRouteCircuitConnections(), this); + } + return peerExpressRouteCircuitConnections; + } + + /** @return Resource collection API of ExpressRouteCircuits. */ + public ExpressRouteCircuits expressRouteCircuits() { + if (this.expressRouteCircuits == null) { + this.expressRouteCircuits = new ExpressRouteCircuitsImpl(clientObject.getExpressRouteCircuits(), this); + } + return expressRouteCircuits; + } + + /** @return Resource collection API of ExpressRouteServiceProviders. */ + public ExpressRouteServiceProviders expressRouteServiceProviders() { + if (this.expressRouteServiceProviders == null) { + this.expressRouteServiceProviders = + new ExpressRouteServiceProvidersImpl(clientObject.getExpressRouteServiceProviders(), this); + } + return expressRouteServiceProviders; + } + + /** @return Resource collection API of ExpressRouteCrossConnections. */ + public ExpressRouteCrossConnections expressRouteCrossConnections() { + if (this.expressRouteCrossConnections == null) { + this.expressRouteCrossConnections = + new ExpressRouteCrossConnectionsImpl(clientObject.getExpressRouteCrossConnections(), this); + } + return expressRouteCrossConnections; + } + + /** @return Resource collection API of ExpressRouteCrossConnectionPeerings. */ + public ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings() { + if (this.expressRouteCrossConnectionPeerings == null) { + this.expressRouteCrossConnectionPeerings = + new ExpressRouteCrossConnectionPeeringsImpl( + clientObject.getExpressRouteCrossConnectionPeerings(), this); + } + return expressRouteCrossConnectionPeerings; + } + + /** @return Resource collection API of ExpressRoutePortsLocations. */ + public ExpressRoutePortsLocations expressRoutePortsLocations() { + if (this.expressRoutePortsLocations == null) { + this.expressRoutePortsLocations = + new ExpressRoutePortsLocationsImpl(clientObject.getExpressRoutePortsLocations(), this); + } + return expressRoutePortsLocations; + } + + /** @return Resource collection API of ExpressRoutePorts. */ + public ExpressRoutePorts expressRoutePorts() { + if (this.expressRoutePorts == null) { + this.expressRoutePorts = new ExpressRoutePortsImpl(clientObject.getExpressRoutePorts(), this); + } + return expressRoutePorts; + } + + /** @return Resource collection API of ExpressRouteLinks. */ + public ExpressRouteLinks expressRouteLinks() { + if (this.expressRouteLinks == null) { + this.expressRouteLinks = new ExpressRouteLinksImpl(clientObject.getExpressRouteLinks(), this); + } + return expressRouteLinks; + } + + /** @return Resource collection API of FirewallPolicies. */ + public FirewallPolicies firewallPolicies() { + if (this.firewallPolicies == null) { + this.firewallPolicies = new FirewallPoliciesImpl(clientObject.getFirewallPolicies(), this); + } + return firewallPolicies; + } + + /** @return Resource collection API of FirewallPolicyRuleCollectionGroups. */ + public FirewallPolicyRuleCollectionGroups firewallPolicyRuleCollectionGroups() { + if (this.firewallPolicyRuleCollectionGroups == null) { + this.firewallPolicyRuleCollectionGroups = + new FirewallPolicyRuleCollectionGroupsImpl(clientObject.getFirewallPolicyRuleCollectionGroups(), this); + } + return firewallPolicyRuleCollectionGroups; + } + + /** @return Resource collection API of IpAllocations. */ + public IpAllocations ipAllocations() { + if (this.ipAllocations == null) { + this.ipAllocations = new IpAllocationsImpl(clientObject.getIpAllocations(), this); + } + return ipAllocations; + } + + /** @return Resource collection API of IpGroups. */ + public IpGroups ipGroups() { + if (this.ipGroups == null) { + this.ipGroups = new IpGroupsImpl(clientObject.getIpGroups(), this); + } + return ipGroups; + } + + /** @return Resource collection API of LoadBalancers. */ + public LoadBalancers loadBalancers() { + if (this.loadBalancers == null) { + this.loadBalancers = new LoadBalancersImpl(clientObject.getLoadBalancers(), this); + } + return loadBalancers; + } + + /** @return Resource collection API of LoadBalancerBackendAddressPools. */ + public LoadBalancerBackendAddressPools loadBalancerBackendAddressPools() { + if (this.loadBalancerBackendAddressPools == null) { + this.loadBalancerBackendAddressPools = + new LoadBalancerBackendAddressPoolsImpl(clientObject.getLoadBalancerBackendAddressPools(), this); + } + return loadBalancerBackendAddressPools; + } + + /** @return Resource collection API of LoadBalancerFrontendIpConfigurations. */ + public LoadBalancerFrontendIpConfigurations loadBalancerFrontendIpConfigurations() { + if (this.loadBalancerFrontendIpConfigurations == null) { + this.loadBalancerFrontendIpConfigurations = + new LoadBalancerFrontendIpConfigurationsImpl( + clientObject.getLoadBalancerFrontendIpConfigurations(), this); + } + return loadBalancerFrontendIpConfigurations; + } + + /** @return Resource collection API of InboundNatRules. */ + public InboundNatRules inboundNatRules() { + if (this.inboundNatRules == null) { + this.inboundNatRules = new InboundNatRulesImpl(clientObject.getInboundNatRules(), this); + } + return inboundNatRules; + } + + /** @return Resource collection API of LoadBalancerLoadBalancingRules. */ + public LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules() { + if (this.loadBalancerLoadBalancingRules == null) { + this.loadBalancerLoadBalancingRules = + new LoadBalancerLoadBalancingRulesImpl(clientObject.getLoadBalancerLoadBalancingRules(), this); + } + return loadBalancerLoadBalancingRules; + } + + /** @return Resource collection API of LoadBalancerOutboundRules. */ + public LoadBalancerOutboundRules loadBalancerOutboundRules() { + if (this.loadBalancerOutboundRules == null) { + this.loadBalancerOutboundRules = + new LoadBalancerOutboundRulesImpl(clientObject.getLoadBalancerOutboundRules(), this); + } + return loadBalancerOutboundRules; + } + + /** @return Resource collection API of LoadBalancerNetworkInterfaces. */ + public LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces() { + if (this.loadBalancerNetworkInterfaces == null) { + this.loadBalancerNetworkInterfaces = + new LoadBalancerNetworkInterfacesImpl(clientObject.getLoadBalancerNetworkInterfaces(), this); + } + return loadBalancerNetworkInterfaces; + } + + /** @return Resource collection API of LoadBalancerProbes. */ + public LoadBalancerProbes loadBalancerProbes() { + if (this.loadBalancerProbes == null) { + this.loadBalancerProbes = new LoadBalancerProbesImpl(clientObject.getLoadBalancerProbes(), this); + } + return loadBalancerProbes; + } + + /** @return Resource collection API of NatGateways. */ + public NatGateways natGateways() { + if (this.natGateways == null) { + this.natGateways = new NatGatewaysImpl(clientObject.getNatGateways(), this); + } + return natGateways; + } + + /** @return Resource collection API of NetworkInterfaceIpConfigurations. */ + public NetworkInterfaceIpConfigurations networkInterfaceIpConfigurations() { + if (this.networkInterfaceIpConfigurations == null) { + this.networkInterfaceIpConfigurations = + new NetworkInterfaceIpConfigurationsImpl(clientObject.getNetworkInterfaceIpConfigurations(), this); + } + return networkInterfaceIpConfigurations; + } + + /** @return Resource collection API of NetworkInterfaceLoadBalancers. */ + public NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers() { + if (this.networkInterfaceLoadBalancers == null) { + this.networkInterfaceLoadBalancers = + new NetworkInterfaceLoadBalancersImpl(clientObject.getNetworkInterfaceLoadBalancers(), this); + } + return networkInterfaceLoadBalancers; + } + + /** @return Resource collection API of NetworkInterfaceTapConfigurations. */ + public NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations() { + if (this.networkInterfaceTapConfigurations == null) { + this.networkInterfaceTapConfigurations = + new NetworkInterfaceTapConfigurationsImpl(clientObject.getNetworkInterfaceTapConfigurations(), this); + } + return networkInterfaceTapConfigurations; + } + + /** @return Resource collection API of NetworkProfiles. */ + public NetworkProfiles networkProfiles() { + if (this.networkProfiles == null) { + this.networkProfiles = new NetworkProfilesImpl(clientObject.getNetworkProfiles(), this); + } + return networkProfiles; + } + + /** @return Resource collection API of NetworkSecurityGroups. */ + public NetworkSecurityGroups networkSecurityGroups() { + if (this.networkSecurityGroups == null) { + this.networkSecurityGroups = new NetworkSecurityGroupsImpl(clientObject.getNetworkSecurityGroups(), this); + } + return networkSecurityGroups; + } + + /** @return Resource collection API of SecurityRules. */ + public SecurityRules securityRules() { + if (this.securityRules == null) { + this.securityRules = new SecurityRulesImpl(clientObject.getSecurityRules(), this); + } + return securityRules; + } + + /** @return Resource collection API of DefaultSecurityRules. */ + public DefaultSecurityRules defaultSecurityRules() { + if (this.defaultSecurityRules == null) { + this.defaultSecurityRules = new DefaultSecurityRulesImpl(clientObject.getDefaultSecurityRules(), this); + } + return defaultSecurityRules; + } + + /** @return Resource collection API of NetworkVirtualAppliances. */ + public NetworkVirtualAppliances networkVirtualAppliances() { + if (this.networkVirtualAppliances == null) { + this.networkVirtualAppliances = + new NetworkVirtualAppliancesImpl(clientObject.getNetworkVirtualAppliances(), this); + } + return networkVirtualAppliances; + } + + /** @return Resource collection API of VirtualApplianceSites. */ + public VirtualApplianceSites virtualApplianceSites() { + if (this.virtualApplianceSites == null) { + this.virtualApplianceSites = new VirtualApplianceSitesImpl(clientObject.getVirtualApplianceSites(), this); + } + return virtualApplianceSites; + } + + /** @return Resource collection API of VirtualApplianceSkus. */ + public VirtualApplianceSkus virtualApplianceSkus() { + if (this.virtualApplianceSkus == null) { + this.virtualApplianceSkus = new VirtualApplianceSkusImpl(clientObject.getVirtualApplianceSkus(), this); + } + return virtualApplianceSkus; + } + + /** @return Resource collection API of InboundSecurityRuleOperations. */ + public InboundSecurityRuleOperations inboundSecurityRuleOperations() { + if (this.inboundSecurityRuleOperations == null) { + this.inboundSecurityRuleOperations = + new InboundSecurityRuleOperationsImpl(clientObject.getInboundSecurityRuleOperations(), this); + } + return inboundSecurityRuleOperations; + } + + /** @return Resource collection API of NetworkWatchers. */ + public NetworkWatchers networkWatchers() { + if (this.networkWatchers == null) { + this.networkWatchers = new NetworkWatchersImpl(clientObject.getNetworkWatchers(), this); + } + return networkWatchers; + } + + /** @return Resource collection API of PacketCaptures. */ + public PacketCaptures packetCaptures() { + if (this.packetCaptures == null) { + this.packetCaptures = new PacketCapturesImpl(clientObject.getPacketCaptures(), this); + } + return packetCaptures; + } + + /** @return Resource collection API of ConnectionMonitors. */ + public ConnectionMonitors connectionMonitors() { + if (this.connectionMonitors == null) { + this.connectionMonitors = new ConnectionMonitorsImpl(clientObject.getConnectionMonitors(), this); + } + return connectionMonitors; + } + + /** @return Resource collection API of FlowLogs. */ + public FlowLogs flowLogs() { + if (this.flowLogs == null) { + this.flowLogs = new FlowLogsImpl(clientObject.getFlowLogs(), this); + } + return flowLogs; + } + + /** @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 PrivateEndpoints. */ + public PrivateEndpoints privateEndpoints() { + if (this.privateEndpoints == null) { + this.privateEndpoints = new PrivateEndpointsImpl(clientObject.getPrivateEndpoints(), this); + } + return privateEndpoints; + } + + /** @return Resource collection API of AvailablePrivateEndpointTypes. */ + public AvailablePrivateEndpointTypes availablePrivateEndpointTypes() { + if (this.availablePrivateEndpointTypes == null) { + this.availablePrivateEndpointTypes = + new AvailablePrivateEndpointTypesImpl(clientObject.getAvailablePrivateEndpointTypes(), this); + } + return availablePrivateEndpointTypes; + } + + /** @return Resource collection API of PrivateDnsZoneGroups. */ + public PrivateDnsZoneGroups privateDnsZoneGroups() { + if (this.privateDnsZoneGroups == null) { + this.privateDnsZoneGroups = new PrivateDnsZoneGroupsImpl(clientObject.getPrivateDnsZoneGroups(), this); + } + return privateDnsZoneGroups; + } + + /** @return Resource collection API of PrivateLinkServices. */ + public PrivateLinkServices privateLinkServices() { + if (this.privateLinkServices == null) { + this.privateLinkServices = new PrivateLinkServicesImpl(clientObject.getPrivateLinkServices(), this); + } + return privateLinkServices; + } + + /** @return Resource collection API of PublicIpPrefixes. */ + public PublicIpPrefixes publicIpPrefixes() { + if (this.publicIpPrefixes == null) { + this.publicIpPrefixes = new PublicIpPrefixesImpl(clientObject.getPublicIpPrefixes(), this); + } + return publicIpPrefixes; + } + + /** @return Resource collection API of RouteFilters. */ + public RouteFilters routeFilters() { + if (this.routeFilters == null) { + this.routeFilters = new RouteFiltersImpl(clientObject.getRouteFilters(), this); + } + return routeFilters; + } + + /** @return Resource collection API of RouteFilterRules. */ + public RouteFilterRules routeFilterRules() { + if (this.routeFilterRules == null) { + this.routeFilterRules = new RouteFilterRulesImpl(clientObject.getRouteFilterRules(), this); + } + return routeFilterRules; + } + + /** @return Resource collection API of RouteTables. */ + public RouteTables routeTables() { + if (this.routeTables == null) { + this.routeTables = new RouteTablesImpl(clientObject.getRouteTables(), this); + } + return routeTables; + } + + /** @return Resource collection API of Routes. */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(clientObject.getRoutes(), this); + } + return routes; + } + + /** @return Resource collection API of SecurityPartnerProviders. */ + public SecurityPartnerProviders securityPartnerProviders() { + if (this.securityPartnerProviders == null) { + this.securityPartnerProviders = + new SecurityPartnerProvidersImpl(clientObject.getSecurityPartnerProviders(), this); + } + return securityPartnerProviders; + } + + /** @return Resource collection API of BgpServiceCommunities. */ + public BgpServiceCommunities bgpServiceCommunities() { + if (this.bgpServiceCommunities == null) { + this.bgpServiceCommunities = new BgpServiceCommunitiesImpl(clientObject.getBgpServiceCommunities(), this); + } + return bgpServiceCommunities; + } + + /** @return Resource collection API of ServiceEndpointPolicies. */ + public ServiceEndpointPolicies serviceEndpointPolicies() { + if (this.serviceEndpointPolicies == null) { + this.serviceEndpointPolicies = + new ServiceEndpointPoliciesImpl(clientObject.getServiceEndpointPolicies(), this); + } + return serviceEndpointPolicies; + } + + /** @return Resource collection API of ServiceEndpointPolicyDefinitions. */ + public ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions() { + if (this.serviceEndpointPolicyDefinitions == null) { + this.serviceEndpointPolicyDefinitions = + new ServiceEndpointPolicyDefinitionsImpl(clientObject.getServiceEndpointPolicyDefinitions(), this); + } + return serviceEndpointPolicyDefinitions; + } + + /** @return Resource collection API of ServiceTags. */ + public ServiceTags serviceTags() { + if (this.serviceTags == null) { + this.serviceTags = new ServiceTagsImpl(clientObject.getServiceTags(), this); + } + return serviceTags; + } + + /** @return Resource collection API of Usages. */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** @return Resource collection API of VirtualNetworks. */ + public VirtualNetworks virtualNetworks() { + if (this.virtualNetworks == null) { + this.virtualNetworks = new VirtualNetworksImpl(clientObject.getVirtualNetworks(), this); + } + return virtualNetworks; + } + + /** @return Resource collection API of Subnets. */ + public Subnets subnets() { + if (this.subnets == null) { + this.subnets = new SubnetsImpl(clientObject.getSubnets(), this); + } + return subnets; + } + + /** @return Resource collection API of ResourceNavigationLinks. */ + public ResourceNavigationLinks resourceNavigationLinks() { + if (this.resourceNavigationLinks == null) { + this.resourceNavigationLinks = + new ResourceNavigationLinksImpl(clientObject.getResourceNavigationLinks(), this); + } + return resourceNavigationLinks; + } + + /** @return Resource collection API of ServiceAssociationLinks. */ + public ServiceAssociationLinks serviceAssociationLinks() { + if (this.serviceAssociationLinks == null) { + this.serviceAssociationLinks = + new ServiceAssociationLinksImpl(clientObject.getServiceAssociationLinks(), this); + } + return serviceAssociationLinks; + } + + /** @return Resource collection API of VirtualNetworkPeerings. */ + public VirtualNetworkPeerings virtualNetworkPeerings() { + if (this.virtualNetworkPeerings == null) { + this.virtualNetworkPeerings = + new VirtualNetworkPeeringsImpl(clientObject.getVirtualNetworkPeerings(), this); + } + return virtualNetworkPeerings; + } + + /** @return Resource collection API of VirtualNetworkGateways. */ + public VirtualNetworkGateways virtualNetworkGateways() { + if (this.virtualNetworkGateways == null) { + this.virtualNetworkGateways = + new VirtualNetworkGatewaysImpl(clientObject.getVirtualNetworkGateways(), this); + } + return virtualNetworkGateways; + } + + /** @return Resource collection API of VirtualNetworkGatewayConnections. */ + public VirtualNetworkGatewayConnections virtualNetworkGatewayConnections() { + if (this.virtualNetworkGatewayConnections == null) { + this.virtualNetworkGatewayConnections = + new VirtualNetworkGatewayConnectionsImpl(clientObject.getVirtualNetworkGatewayConnections(), this); + } + return virtualNetworkGatewayConnections; + } + + /** @return Resource collection API of LocalNetworkGateways. */ + public LocalNetworkGateways localNetworkGateways() { + if (this.localNetworkGateways == null) { + this.localNetworkGateways = new LocalNetworkGatewaysImpl(clientObject.getLocalNetworkGateways(), this); + } + return localNetworkGateways; + } + + /** @return Resource collection API of VirtualNetworkGatewayNatRules. */ + public VirtualNetworkGatewayNatRules virtualNetworkGatewayNatRules() { + if (this.virtualNetworkGatewayNatRules == null) { + this.virtualNetworkGatewayNatRules = + new VirtualNetworkGatewayNatRulesImpl(clientObject.getVirtualNetworkGatewayNatRules(), this); + } + return virtualNetworkGatewayNatRules; + } + + /** @return Resource collection API of VirtualNetworkTaps. */ + public VirtualNetworkTaps virtualNetworkTaps() { + if (this.virtualNetworkTaps == null) { + this.virtualNetworkTaps = new VirtualNetworkTapsImpl(clientObject.getVirtualNetworkTaps(), this); + } + return virtualNetworkTaps; + } + + /** @return Resource collection API of VirtualRouters. */ + public VirtualRouters virtualRouters() { + if (this.virtualRouters == null) { + this.virtualRouters = new VirtualRoutersImpl(clientObject.getVirtualRouters(), this); + } + return virtualRouters; + } + + /** @return Resource collection API of VirtualRouterPeerings. */ + public VirtualRouterPeerings virtualRouterPeerings() { + if (this.virtualRouterPeerings == null) { + this.virtualRouterPeerings = new VirtualRouterPeeringsImpl(clientObject.getVirtualRouterPeerings(), this); + } + return virtualRouterPeerings; + } + + /** @return Resource collection API of VirtualWans. */ + public VirtualWans virtualWans() { + if (this.virtualWans == null) { + this.virtualWans = new VirtualWansImpl(clientObject.getVirtualWans(), this); + } + return virtualWans; + } + + /** @return Resource collection API of VpnSites. */ + public VpnSites vpnSites() { + if (this.vpnSites == null) { + this.vpnSites = new VpnSitesImpl(clientObject.getVpnSites(), this); + } + return vpnSites; + } + + /** @return Resource collection API of VpnSiteLinks. */ + public VpnSiteLinks vpnSiteLinks() { + if (this.vpnSiteLinks == null) { + this.vpnSiteLinks = new VpnSiteLinksImpl(clientObject.getVpnSiteLinks(), this); + } + return vpnSiteLinks; + } + + /** @return Resource collection API of VpnSitesConfigurations. */ + public VpnSitesConfigurations vpnSitesConfigurations() { + if (this.vpnSitesConfigurations == null) { + this.vpnSitesConfigurations = + new VpnSitesConfigurationsImpl(clientObject.getVpnSitesConfigurations(), this); + } + return vpnSitesConfigurations; + } + + /** @return Resource collection API of VpnServerConfigurations. */ + public VpnServerConfigurations vpnServerConfigurations() { + if (this.vpnServerConfigurations == null) { + this.vpnServerConfigurations = + new VpnServerConfigurationsImpl(clientObject.getVpnServerConfigurations(), this); + } + return vpnServerConfigurations; + } + + /** @return Resource collection API of VirtualHubs. */ + public VirtualHubs virtualHubs() { + if (this.virtualHubs == null) { + this.virtualHubs = new VirtualHubsImpl(clientObject.getVirtualHubs(), this); + } + return virtualHubs; + } + + /** @return Resource collection API of HubVirtualNetworkConnections. */ + public HubVirtualNetworkConnections hubVirtualNetworkConnections() { + if (this.hubVirtualNetworkConnections == null) { + this.hubVirtualNetworkConnections = + new HubVirtualNetworkConnectionsImpl(clientObject.getHubVirtualNetworkConnections(), this); + } + return hubVirtualNetworkConnections; + } + + /** @return Resource collection API of VpnGateways. */ + public VpnGateways vpnGateways() { + if (this.vpnGateways == null) { + this.vpnGateways = new VpnGatewaysImpl(clientObject.getVpnGateways(), this); + } + return vpnGateways; + } + + /** @return Resource collection API of VpnLinkConnections. */ + public VpnLinkConnections vpnLinkConnections() { + if (this.vpnLinkConnections == null) { + this.vpnLinkConnections = new VpnLinkConnectionsImpl(clientObject.getVpnLinkConnections(), this); + } + return vpnLinkConnections; + } + + /** @return Resource collection API of VpnConnections. */ + public VpnConnections vpnConnections() { + if (this.vpnConnections == null) { + this.vpnConnections = new VpnConnectionsImpl(clientObject.getVpnConnections(), this); + } + return vpnConnections; + } + + /** @return Resource collection API of VpnSiteLinkConnections. */ + public VpnSiteLinkConnections vpnSiteLinkConnections() { + if (this.vpnSiteLinkConnections == null) { + this.vpnSiteLinkConnections = + new VpnSiteLinkConnectionsImpl(clientObject.getVpnSiteLinkConnections(), this); + } + return vpnSiteLinkConnections; + } + + /** @return Resource collection API of NatRules. */ + public NatRules natRules() { + if (this.natRules == null) { + this.natRules = new NatRulesImpl(clientObject.getNatRules(), this); + } + return natRules; + } + + /** @return Resource collection API of P2SVpnGateways. */ + public P2SVpnGateways p2SVpnGateways() { + if (this.p2SVpnGateways == null) { + this.p2SVpnGateways = new P2SVpnGatewaysImpl(clientObject.getP2SVpnGateways(), this); + } + return p2SVpnGateways; + } + + /** @return Resource collection API of VpnServerConfigurationsAssociatedWithVirtualWans. */ + public VpnServerConfigurationsAssociatedWithVirtualWans vpnServerConfigurationsAssociatedWithVirtualWans() { + if (this.vpnServerConfigurationsAssociatedWithVirtualWans == null) { + this.vpnServerConfigurationsAssociatedWithVirtualWans = + new VpnServerConfigurationsAssociatedWithVirtualWansImpl( + clientObject.getVpnServerConfigurationsAssociatedWithVirtualWans(), this); + } + return vpnServerConfigurationsAssociatedWithVirtualWans; + } + + /** @return Resource collection API of VirtualHubRouteTableV2S. */ + public VirtualHubRouteTableV2S virtualHubRouteTableV2S() { + if (this.virtualHubRouteTableV2S == null) { + this.virtualHubRouteTableV2S = + new VirtualHubRouteTableV2SImpl(clientObject.getVirtualHubRouteTableV2S(), this); + } + return virtualHubRouteTableV2S; + } + + /** @return Resource collection API of ExpressRouteGateways. */ + public ExpressRouteGateways expressRouteGateways() { + if (this.expressRouteGateways == null) { + this.expressRouteGateways = new ExpressRouteGatewaysImpl(clientObject.getExpressRouteGateways(), this); + } + return expressRouteGateways; + } + + /** @return Resource collection API of ExpressRouteConnections. */ + public ExpressRouteConnections expressRouteConnections() { + if (this.expressRouteConnections == null) { + this.expressRouteConnections = + new ExpressRouteConnectionsImpl(clientObject.getExpressRouteConnections(), this); + } + return expressRouteConnections; + } + + /** @return Resource collection API of VirtualHubBgpConnections. */ + public VirtualHubBgpConnections virtualHubBgpConnections() { + if (this.virtualHubBgpConnections == null) { + this.virtualHubBgpConnections = + new VirtualHubBgpConnectionsImpl(clientObject.getVirtualHubBgpConnections(), this); + } + return virtualHubBgpConnections; + } + + /** @return Resource collection API of VirtualHubIpConfigurations. */ + public VirtualHubIpConfigurations virtualHubIpConfigurations() { + if (this.virtualHubIpConfigurations == null) { + this.virtualHubIpConfigurations = + new VirtualHubIpConfigurationsImpl(clientObject.getVirtualHubIpConfigurations(), this); + } + return virtualHubIpConfigurations; + } + + /** @return Resource collection API of HubRouteTables. */ + public HubRouteTables hubRouteTables() { + if (this.hubRouteTables == null) { + this.hubRouteTables = new HubRouteTablesImpl(clientObject.getHubRouteTables(), this); + } + return hubRouteTables; + } + + /** @return Resource collection API of WebApplicationFirewallPolicies. */ + public WebApplicationFirewallPolicies webApplicationFirewallPolicies() { + if (this.webApplicationFirewallPolicies == null) { + this.webApplicationFirewallPolicies = + new WebApplicationFirewallPoliciesImpl(clientObject.getWebApplicationFirewallPolicies(), this); + } + return webApplicationFirewallPolicies; + } + + /** + * @return Wrapped service client NetworkManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public NetworkManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..a9db5c2cebeb9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.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.network.generated.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.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayPrivateEndpointConnectionsClient. + */ +public interface ApplicationGatewayPrivateEndpointConnectionsClient { + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 applicationGatewayName, String connectionName); + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 applicationGatewayName, String connectionName, Context context); + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 applicationGatewayName, String connectionName); + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 applicationGatewayName, String connectionName, Context context); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayPrivateEndpointConnectionInner update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayPrivateEndpointConnectionInner update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context); + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayPrivateEndpointConnectionInner get( + String resourceGroupName, String applicationGatewayName, String connectionName); + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context); + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationGatewayName); + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..925f2af5cf5c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.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.network.generated.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.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayPrivateLinkResourcesClient. + */ +public interface ApplicationGatewayPrivateLinkResourcesClient { + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationGatewayName); + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java new file mode 100644 index 0000000000000..bb5c63e9ae1e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java @@ -0,0 +1,697 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in ApplicationGatewaysClient. */ +public interface ApplicationGatewaysClient { + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 applicationGatewayName); + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 applicationGatewayName, Context context); + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 applicationGatewayName); + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 applicationGatewayName, Context context); + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters); + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context); + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayInner createOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters); + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayInner createOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context); + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName, TagsObject parameters); + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context); + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the application gateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the application gateways 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 all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStart(String resourceGroupName, String applicationGatewayName); + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStart( + String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String applicationGatewayName); + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStop(String resourceGroupName, String applicationGatewayName); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStop( + String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String applicationGatewayName); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand, Context context); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthInner backendHealth( + String resourceGroupName, String applicationGatewayName, String expand); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthInner backendHealth( + String resourceGroupName, String applicationGatewayName, String expand, Context context); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context); + + /** + * Lists all available server variables. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listAvailableServerVariables(); + + /** + * Lists all available server variables. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listAvailableServerVariablesWithResponse(Context context); + + /** + * Lists all available request headers. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listAvailableRequestHeaders(); + + /** + * Lists all available request headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listAvailableRequestHeadersWithResponse(Context context); + + /** + * Lists all available response headers. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listAvailableResponseHeaders(); + + /** + * Lists all available response headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listAvailableResponseHeadersWithResponse(Context context); + + /** + * Lists all available web application firewall rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets(); + + /** + * Lists all available web application firewall rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableWafRuleSetsWithResponse(Context context); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions(); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableSslOptionsWithResponse(Context context); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSslPredefinedPolicies(); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSslPredefinedPolicies(Context context); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSslPredefinedPolicyWithResponse( + String predefinedPolicyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java new file mode 100644 index 0000000000000..0363c3fa93f93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ApplicationSecurityGroupsClient. */ +public interface ApplicationSecurityGroupsClient { + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String applicationSecurityGroupName); + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String applicationSecurityGroupName, Context context); + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String applicationSecurityGroupName); + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String applicationSecurityGroupName, Context context); + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 information about the specified application security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName); + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 information about the specified application security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationSecurityGroupName, Context context); + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters); + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String applicationSecurityGroupName, + ApplicationSecurityGroupInner parameters, + Context context); + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationSecurityGroupInner createOrUpdate( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters); + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationSecurityGroupInner createOrUpdate( + String resourceGroupName, + String applicationSecurityGroupName, + ApplicationSecurityGroupInner parameters, + Context context); + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationSecurityGroupInner updateTags( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters); + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context); + + /** + * Gets all application security groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all application security groups 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 all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java new file mode 100644 index 0000000000000..565708b31364b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.AvailableDelegationInner; + +/** An instance of this class provides access to all the operations defined in AvailableDelegationsClient. */ +public interface AvailableDelegationsClient { + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java new file mode 100644 index 0000000000000..56d342f174f23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.EndpointServiceResultInner; + +/** An instance of this class provides access to all the operations defined in AvailableEndpointServicesClient. */ +public interface AvailableEndpointServicesClient { + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java new file mode 100644 index 0000000000000..7beb6351d958b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; + +/** An instance of this class provides access to all the operations defined in AvailablePrivateEndpointTypesClient. */ +public interface AvailablePrivateEndpointTypesClient { + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String location, String resourceGroupName); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.java new file mode 100644 index 0000000000000..e640f0c35fe35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.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.network.generated.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.network.generated.fluent.models.AvailableDelegationInner; + +/** + * An instance of this class provides access to all the operations defined in AvailableResourceGroupDelegationsClient. + */ +public interface AvailableResourceGroupDelegationsClient { + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String resourceGroupName); + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java new file mode 100644 index 0000000000000..ad66184f17029 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.AvailableServiceAliasInner; + +/** An instance of this class provides access to all the operations defined in AvailableServiceAliasesClient. */ +public interface AvailableServiceAliasesClient { + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String location); + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java new file mode 100644 index 0000000000000..bbae7e0405b3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.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.network.generated.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.network.generated.fluent.models.AzureFirewallFqdnTagInner; + +/** An instance of this class provides access to all the operations defined in AzureFirewallFqdnTagsClient. */ +public interface AzureFirewallFqdnTagsClient { + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Azure Firewall FQDN Tags 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 all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java new file mode 100644 index 0000000000000..002a62674ed5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in AzureFirewallsClient. */ +public interface AzureFirewallsClient { + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 azureFirewallName); + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 azureFirewallName, Context context); + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 azureFirewallName); + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 azureFirewallName, Context context); + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName); + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String azureFirewallName, Context context); + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AzureFirewallInner> beginCreateOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters); + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AzureFirewallInner> beginCreateOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context); + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureFirewallInner createOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters); + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureFirewallInner createOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context); + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AzureFirewallInner> beginUpdateTags( + String resourceGroupName, String azureFirewallName, TagsObject parameters); + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AzureFirewallInner> beginUpdateTags( + String resourceGroupName, String azureFirewallName, TagsObject parameters, Context context); + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureFirewallInner updateTags(String resourceGroupName, String azureFirewallName, TagsObject parameters); + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureFirewallInner updateTags( + String resourceGroupName, String azureFirewallName, TagsObject parameters, Context context); + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Azure Firewalls 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 all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BastionHostsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BastionHostsClient.java new file mode 100644 index 0000000000000..1dbc410169fa1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BastionHostsClient.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.BastionHostInner; + +/** An instance of this class provides access to all the operations defined in BastionHostsClient. */ +public interface BastionHostsClient { + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 bastionHostname); + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 bastionHostname, Context context); + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 bastionHostname); + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 bastionHostname, Context context); + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner getByResourceGroup(String resourceGroupName, String bastionHostname); + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String bastionHostname, Context context); + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, String bastionHostname, BastionHostInner parameters); + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, String bastionHostname, BastionHostInner parameters, Context context); + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner createOrUpdate(String resourceGroupName, String bastionHostname, BastionHostInner parameters); + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner createOrUpdate( + String resourceGroupName, String bastionHostname, BastionHostInner parameters, Context context); + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BgpServiceCommunitiesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BgpServiceCommunitiesClient.java new file mode 100644 index 0000000000000..e657a0cb7cc25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BgpServiceCommunitiesClient.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.network.generated.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.network.generated.fluent.models.BgpServiceCommunityInner; + +/** An instance of this class provides access to all the operations defined in BgpServiceCommunitiesClient. */ +public interface BgpServiceCommunitiesClient { + /** + * Gets all the available bgp service communities. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the available bgp service communities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectionMonitorsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectionMonitorsClient.java new file mode 100644 index 0000000000000..3332111eab233 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectionMonitorsClient.java @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ConnectionMonitorQueryResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitor; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ConnectionMonitorsClient. */ +public interface ConnectionMonitorsClient { + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate); + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context); + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate); + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters); + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context); + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner get(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner updateTags( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, TagsObject parameters); + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + TagsObject parameters, + Context context); + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop( + String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart( + String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( + String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorQueryResultInner query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorQueryResultInner query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/CustomIpPrefixesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/CustomIpPrefixesClient.java new file mode 100644 index 0000000000000..5e6707fc65de1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/CustomIpPrefixesClient.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.CustomIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in CustomIpPrefixesClient. */ +public interface CustomIpPrefixesClient { + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 customIpPrefixName); + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 customIpPrefixName, Context context); + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 customIpPrefixName); + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 customIpPrefixName, Context context); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomIpPrefixInner getByResourceGroup(String resourceGroupName, String customIpPrefixName); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String customIpPrefixName, String expand, Context context); + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CustomIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters); + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CustomIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters, Context context); + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomIpPrefixInner createOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters); + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomIpPrefixInner createOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters, Context context); + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomIpPrefixInner updateTags(String resourceGroupName, String customIpPrefixName, TagsObject parameters); + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String customIpPrefixName, TagsObject parameters, Context context); + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the custom IP prefixes 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 all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosCustomPoliciesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosCustomPoliciesClient.java new file mode 100644 index 0000000000000..88fecb0612fc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosCustomPoliciesClient.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.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in DdosCustomPoliciesClient. */ +public interface DdosCustomPoliciesClient { + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ddosCustomPolicyName); + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ddosCustomPolicyName, Context context); + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ddosCustomPolicyName); + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ddosCustomPolicyName, Context context); + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosCustomPolicyInner getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName); + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosCustomPolicyName, Context context); + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters); + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context); + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosCustomPolicyInner createOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters); + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosCustomPolicyInner createOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context); + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosCustomPolicyInner updateTags(String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters); + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosProtectionPlansClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosProtectionPlansClient.java new file mode 100644 index 0000000000000..e3518530ac0c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosProtectionPlansClient.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.DdosProtectionPlanInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in DdosProtectionPlansClient. */ +public interface DdosProtectionPlansClient { + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ddosProtectionPlanName); + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ddosProtectionPlanName, Context context); + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ddosProtectionPlanName); + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ddosProtectionPlanName, Context context); + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName); + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosProtectionPlanName, Context context); + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters); + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context); + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosProtectionPlanInner createOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters); + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosProtectionPlanInner createOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context); + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosProtectionPlanInner updateTags(String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters); + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context); + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all DDoS protection plans 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 all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DefaultSecurityRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DefaultSecurityRulesClient.java new file mode 100644 index 0000000000000..9cbf236516b72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DefaultSecurityRulesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.SecurityRuleInner; + +/** An instance of this class provides access to all the operations defined in DefaultSecurityRulesClient. */ +public interface DefaultSecurityRulesClient { + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DscpConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DscpConfigurationsClient.java new file mode 100644 index 0000000000000..862f8a2aad08a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DscpConfigurationsClient.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.DscpConfigurationInner; + +/** An instance of this class provides access to all the operations defined in DscpConfigurationsClient. */ +public interface DscpConfigurationsClient { + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DscpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters); + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DscpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters, Context context); + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DscpConfigurationInner createOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters); + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DscpConfigurationInner createOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters, Context context); + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String dscpConfigurationName); + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String dscpConfigurationName, Context context); + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dscpConfigurationName); + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dscpConfigurationName, Context context); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DscpConfigurationInner getByResourceGroup(String resourceGroupName, String dscpConfigurationName); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String dscpConfigurationName, Context context); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all dscp configurations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all dscp configurations 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 all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitAuthorizationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitAuthorizationsClient.java new file mode 100644 index 0000000000000..826d3f7dc6086 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitAuthorizationsClient.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; + +/** + * An instance of this class provides access to all the operations defined in ExpressRouteCircuitAuthorizationsClient. + */ +public interface ExpressRouteCircuitAuthorizationsClient { + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String authorizationName); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String authorizationName, Context context); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String circuitName, String authorizationName, Context context); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the specified authorization from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitAuthorizationInner get(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the specified authorization from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String circuitName, String authorizationName, Context context); + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters); + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters, + Context context); + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitAuthorizationInner createOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters); + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitAuthorizationInner createOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters, + Context context); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String circuitName); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitConnectionsClient.java new file mode 100644 index 0000000000000..9eda45ab44368 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitConnectionsClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitConnectionsClient. */ +public interface ExpressRouteCircuitConnectionsClient { + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 circuitName, String peeringName, String connectionName); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 circuitName, String peeringName, String connectionName, Context context); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, String peeringName, String connectionName); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, String peeringName, String connectionName, Context context); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitConnectionInner get( + String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters); + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + Context context); + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitConnectionInner createOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters); + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitConnectionInner createOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + Context context); + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitPeeringsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitPeeringsClient.java new file mode 100644 index 0000000000000..0ba28cb7cdf48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitPeeringsClient.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.network.generated.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.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitPeeringsClient. */ +public interface ExpressRouteCircuitPeeringsClient { + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 circuitName, String peeringName); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 circuitName, String peeringName, Context context); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, String peeringName); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, String peeringName, Context context); + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters); + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters, + Context context); + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitPeeringInner createOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters); + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitPeeringInner createOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters, + Context context); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String circuitName); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String circuitName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitsClient.java new file mode 100644 index 0000000000000..7cb37ba0c7fd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitsClient.java @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitsClient. */ +public interface ExpressRouteCircuitsClient { + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 circuitName); + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 circuitName, Context context); + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName); + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, Context context); + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName); + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String circuitName, Context context); + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters); + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context); + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitInner createOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters); + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitInner createOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context); + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, TagsObject parameters); + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String circuitName, TagsObject parameters, Context context); + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsArpTableListResultInner listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsArpTableListResultInner listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getStatsWithResponse( + String resourceGroupName, String circuitName, Context context); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPeeringStatsWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the express route circuits in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the express route circuits 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 all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteConnectionsClient.java new file mode 100644 index 0000000000000..af145a1a6412f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteConnectionsClient.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.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteConnectionsClient. */ +public interface ExpressRouteConnectionsClient { + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters); + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context); + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteConnectionInner createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters); + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteConnectionInner createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context); + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteConnectionInner get(String resourceGroupName, String expressRouteGatewayName, String connectionName); + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 expressRouteGatewayName, String connectionName); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 expressRouteGatewayName, String connectionName, Context context); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 expressRouteGatewayName, String connectionName); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 expressRouteGatewayName, String connectionName, Context context); + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteConnectionListInner list(String resourceGroupName, String expressRouteGatewayName); + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionPeeringsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionPeeringsClient.java new file mode 100644 index 0000000000000..b49e6a98bf983 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionPeeringsClient.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; + +/** + * An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionPeeringsClient. + */ +public interface ExpressRouteCrossConnectionPeeringsClient { + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String crossConnectionName); + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String crossConnectionName, Context context); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 crossConnectionName, String peeringName); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 crossConnectionName, String peeringName, Context context); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 crossConnectionName, String peeringName); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 crossConnectionName, String peeringName, Context context); + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionPeeringInner get( + String resourceGroupName, String crossConnectionName, String peeringName); + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String crossConnectionName, String peeringName, Context context); + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters); + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context); + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionPeeringInner createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters); + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionPeeringInner createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionsClient.java new file mode 100644 index 0000000000000..bd1c8f7904440 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionsClient.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionsClient. */ +public interface ExpressRouteCrossConnectionsClient { + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String crossConnectionName, Context context); + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCrossConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters); + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCrossConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String crossConnectionName, + ExpressRouteCrossConnectionInner parameters, + Context context); + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionInner createOrUpdate( + String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters); + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionInner createOrUpdate( + String resourceGroupName, + String crossConnectionName, + ExpressRouteCrossConnectionInner parameters, + Context context); + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionInner updateTags( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters); + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context); + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context); + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsArpTableListResultInner listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsArpTableListResultInner listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteGatewaysClient.java new file mode 100644 index 0000000000000..f15cc769b9e6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteGatewaysClient.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.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ExpressRouteGatewaysClient. */ +public interface ExpressRouteGatewaysClient { + /** + * Lists ExpressRoute gateways under a given 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayListInner listBySubscription(); + + /** + * Lists ExpressRoute gateways under a given 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listBySubscriptionWithResponse(Context context); + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayListInner listByResourceGroup(String resourceGroupName); + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters); + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters, + Context context); + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayInner createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters); + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayInner createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters, + Context context); + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteGatewayInner> beginUpdateTags( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters); + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteGatewayInner> beginUpdateTags( + String resourceGroupName, + String expressRouteGatewayName, + TagsObject expressRouteGatewayParameters, + Context context); + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayInner updateTags( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters); + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayInner updateTags( + String resourceGroupName, + String expressRouteGatewayName, + TagsObject expressRouteGatewayParameters, + Context context); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 expressRouteGatewayName); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 expressRouteGatewayName, Context context); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 expressRouteGatewayName); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 expressRouteGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteLinksClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteLinksClient.java new file mode 100644 index 0000000000000..46086293b5e86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteLinksClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ExpressRouteLinkInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteLinksClient. */ +public interface ExpressRouteLinksClient { + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink child resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName); + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink child resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String expressRoutePortName, String linkName, Context context); + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String expressRoutePortName); + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String expressRoutePortName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsClient.java new file mode 100644 index 0000000000000..4e6a5a021f468 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsClient.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ExpressRoutePortInner; +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaRequest; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ExpressRoutePortsClient. */ +public interface ExpressRoutePortsClient { + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName); + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String expressRoutePortName, Context context); + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String expressRoutePortName); + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String expressRoutePortName, Context context); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRoutePortName, Context context); + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters); + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context); + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortInner createOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters); + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortInner createOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context); + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to update ExpressRoutePort resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName, TagsObject parameters); + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to update ExpressRoutePort resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String expressRoutePortName, TagsObject parameters, Context context); + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of 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 response for GenerateExpressRoutePortsLOA API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenerateExpressRoutePortsLoaResultInner generateLoa( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request); + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of 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 response for GenerateExpressRoutePortsLOA API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateLoaWithResponse( + String resourceGroupName, + String expressRoutePortName, + GenerateExpressRoutePortsLoaRequest request, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsLocationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsLocationsClient.java new file mode 100644 index 0000000000000..ee269cba7c950 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsLocationsClient.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ExpressRoutePortsLocationInner; + +/** An instance of this class provides access to all the operations defined in ExpressRoutePortsLocationsClient. */ +public interface ExpressRoutePortsLocationsClient { + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the ExpressRoutePorts peering location resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortsLocationInner get(String locationName); + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the ExpressRoutePorts peering location resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String locationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteServiceProvidersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteServiceProvidersClient.java new file mode 100644 index 0000000000000..5d11a40070010 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteServiceProvidersClient.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.network.generated.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.network.generated.fluent.models.ExpressRouteServiceProviderInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteServiceProvidersClient. */ +public interface ExpressRouteServiceProvidersClient { + /** + * Gets all the available express route service providers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the available express route service providers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPoliciesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPoliciesClient.java new file mode 100644 index 0000000000000..0b1e4ba42f47a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPoliciesClient.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.FirewallPolicyInner; + +/** An instance of this class provides access to all the operations defined in FirewallPoliciesClient. */ +public interface FirewallPoliciesClient { + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 firewallPolicyName); + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 firewallPolicyName, Context context); + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 firewallPolicyName); + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 firewallPolicyName, Context context); + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyInner getByResourceGroup(String resourceGroupName, String firewallPolicyName); + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String firewallPolicyName, String expand, Context context); + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FirewallPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters); + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FirewallPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters, Context context); + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyInner createOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters); + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyInner createOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters, Context context); + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Firewall Policies 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 all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupsClient.java new file mode 100644 index 0000000000000..45f34138c58a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupsClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; + +/** + * An instance of this class provides access to all the operations defined in FirewallPolicyRuleCollectionGroupsClient. + */ +public interface FirewallPolicyRuleCollectionGroupsClient { + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 firewallPolicyName, String ruleCollectionGroupName); + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 firewallPolicyName, String ruleCollectionGroupName); + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyRuleCollectionGroupInner get( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters); + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters, + Context context); + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyRuleCollectionGroupInner createOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters); + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyRuleCollectionGroupInner createOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters, + Context context); + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String firewallPolicyName); + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String firewallPolicyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FlowLogsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FlowLogsClient.java new file mode 100644 index 0000000000000..d858d9894d094 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FlowLogsClient.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in FlowLogsClient. */ +public interface FlowLogsClient { + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FlowLogInner> beginCreateOrUpdate( + String resourceGroupName, String networkWatcherName, String flowLogName, FlowLogInner parameters); + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FlowLogInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + FlowLogInner parameters, + Context context); + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInner createOrUpdate( + String resourceGroupName, String networkWatcherName, String flowLogName, FlowLogInner parameters); + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + FlowLogInner parameters, + Context context); + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInner updateTags( + String resourceGroupName, String networkWatcherName, String flowLogName, TagsObject parameters); + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + TagsObject parameters, + Context context); + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInner get(String resourceGroupName, String networkWatcherName, String flowLogName); + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context); + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String flowLogName); + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context); + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkWatcherName, String flowLogName); + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkWatcherName, String flowLogName, Context context); + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubRouteTablesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubRouteTablesClient.java new file mode 100644 index 0000000000000..749d73542a72a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubRouteTablesClient.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.network.generated.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.network.generated.fluent.models.HubRouteTableInner; + +/** An instance of this class provides access to all the operations defined in HubRouteTablesClient. */ +public interface HubRouteTablesClient { + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, HubRouteTableInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters); + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, HubRouteTableInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters, + Context context); + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubRouteTableInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters); + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubRouteTableInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters, + Context context); + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubRouteTableInner get(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName, String routeTableName); + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName, String routeTableName, Context context); + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String routeTableName); + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String routeTableName, Context context); + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubVirtualNetworkConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubVirtualNetworkConnectionsClient.java new file mode 100644 index 0000000000000..717721e8d5712 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubVirtualNetworkConnectionsClient.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.network.generated.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.network.generated.fluent.models.HubVirtualNetworkConnectionInner; + +/** An instance of this class provides access to all the operations defined in HubVirtualNetworkConnectionsClient. */ +public interface HubVirtualNetworkConnectionsClient { + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, HubVirtualNetworkConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters); + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, HubVirtualNetworkConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context); + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubVirtualNetworkConnectionInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters); + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubVirtualNetworkConnectionInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context); + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName, String connectionName); + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName, String connectionName, Context context); + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String connectionName); + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubVirtualNetworkConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundNatRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundNatRulesClient.java new file mode 100644 index 0000000000000..8bc32497e158f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundNatRulesClient.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.network.generated.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.network.generated.fluent.models.InboundNatRuleInner; + +/** An instance of this class provides access to all the operations defined in InboundNatRulesClient. */ +public interface InboundNatRulesClient { + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 loadBalancerName, String inboundNatRuleName); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 loadBalancerName, String inboundNatRuleName, Context context); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, String inboundNatRuleName); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, String inboundNatRuleName, Context context); + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context); + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters); + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters, + Context context); + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InboundNatRuleInner createOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters); + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InboundNatRuleInner createOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundSecurityRuleOperationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundSecurityRuleOperationsClient.java new file mode 100644 index 0000000000000..73e89130b5537 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundSecurityRuleOperationsClient.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; + +/** An instance of this class provides access to all the operations defined in InboundSecurityRuleOperationsClient. */ +public interface InboundSecurityRuleOperationsClient { + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, InboundSecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters); + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, InboundSecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters, + Context context); + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InboundSecurityRuleInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters); + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InboundSecurityRuleInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpAllocationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpAllocationsClient.java new file mode 100644 index 0000000000000..002b97f6d0096 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpAllocationsClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.IpAllocationInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in IpAllocationsClient. */ +public interface IpAllocationsClient { + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ipAllocationName); + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ipAllocationName, Context context); + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipAllocationName); + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipAllocationName, Context context); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpAllocationInner getByResourceGroup(String resourceGroupName, String ipAllocationName); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipAllocationName, String expand, Context context); + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IpAllocationInner> beginCreateOrUpdate( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters); + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IpAllocationInner> beginCreateOrUpdate( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters, Context context); + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpAllocationInner createOrUpdate(String resourceGroupName, String ipAllocationName, IpAllocationInner parameters); + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpAllocationInner createOrUpdate( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters, Context context); + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpAllocationInner updateTags(String resourceGroupName, String ipAllocationName, TagsObject parameters); + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String ipAllocationName, TagsObject parameters, Context context); + + /** + * Gets all IpAllocations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all IpAllocations 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 all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpGroupsClient.java new file mode 100644 index 0000000000000..58febcdeeca69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpGroupsClient.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.IpGroupInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in IpGroupsClient. */ +public interface IpGroupsClient { + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpGroupInner getByResourceGroup(String resourceGroupName, String ipGroupsName); + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipGroupsName, String expand, Context context); + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IpGroupInner> beginCreateOrUpdate( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters); + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IpGroupInner> beginCreateOrUpdate( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters, Context context); + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpGroupInner createOrUpdate(String resourceGroupName, String ipGroupsName, IpGroupInner parameters); + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpGroupInner createOrUpdate( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters, Context context); + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpGroupInner updateGroups(String resourceGroupName, String ipGroupsName, TagsObject parameters); + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateGroupsWithResponse( + String resourceGroupName, String ipGroupsName, TagsObject parameters, Context context); + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 ipGroupsName); + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 ipGroupsName, Context context); + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 ipGroupsName); + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 ipGroupsName, Context context); + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all IpGroups in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all IpGroups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerBackendAddressPoolsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerBackendAddressPoolsClient.java new file mode 100644 index 0000000000000..5f4982a023ff5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerBackendAddressPoolsClient.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.network.generated.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.network.generated.fluent.models.BackendAddressPoolInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerBackendAddressPoolsClient. */ +public interface LoadBalancerBackendAddressPoolsClient { + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackendAddressPoolInner get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context); + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BackendAddressPoolInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters); + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BackendAddressPoolInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters, + Context context); + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackendAddressPoolInner createOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters); + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackendAddressPoolInner createOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters, + Context context); + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 loadBalancerName, String backendAddressPoolName); + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 loadBalancerName, String backendAddressPoolName, Context context); + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, String backendAddressPoolName); + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, String backendAddressPoolName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerFrontendIpConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerFrontendIpConfigurationsClient.java new file mode 100644 index 0000000000000..739c77ed672d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerFrontendIpConfigurationsClient.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.network.generated.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.network.generated.fluent.models.FrontendIpConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in + * LoadBalancerFrontendIpConfigurationsClient. + */ +public interface LoadBalancerFrontendIpConfigurationsClient { + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FrontendIpConfigurationInner get( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName); + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerLoadBalancingRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerLoadBalancingRulesClient.java new file mode 100644 index 0000000000000..471a6df6bed12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerLoadBalancingRulesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.LoadBalancingRuleInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerLoadBalancingRulesClient. */ +public interface LoadBalancerLoadBalancingRulesClient { + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerNetworkInterfacesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerNetworkInterfacesClient.java new file mode 100644 index 0000000000000..1b4f255d39601 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerNetworkInterfacesClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.NetworkInterfaceInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerNetworkInterfacesClient. */ +public interface LoadBalancerNetworkInterfacesClient { + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerOutboundRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerOutboundRulesClient.java new file mode 100644 index 0000000000000..46a1bab79dc86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerOutboundRulesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.OutboundRuleInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerOutboundRulesClient. */ +public interface LoadBalancerOutboundRulesClient { + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleInner get(String resourceGroupName, String loadBalancerName, String outboundRuleName); + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerProbesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerProbesClient.java new file mode 100644 index 0000000000000..8555d414a52b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerProbesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ProbeInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerProbesClient. */ +public interface LoadBalancerProbesClient { + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName); + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String probeName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancersClient.java new file mode 100644 index 0000000000000..b2e0469c90fd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancersClient.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequest; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in LoadBalancersClient. */ +public interface LoadBalancersClient { + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 loadBalancerName); + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 loadBalancerName, Context context); + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName); + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, Context context); + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName); + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String loadBalancerName, String expand, Context context); + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LoadBalancerInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters); + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LoadBalancerInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context); + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoadBalancerInner createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters); + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoadBalancerInner createOrUpdate( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context); + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, TagsObject parameters); + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context); + + /** + * Gets all the load balancers in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the load balancers 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 all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginSwapPublicIpAddresses( + String location, LoadBalancerVipSwapRequest parameters); + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginSwapPublicIpAddresses( + String location, LoadBalancerVipSwapRequest parameters, Context context); + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters); + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LocalNetworkGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LocalNetworkGatewaysClient.java new file mode 100644 index 0000000000000..21a0b41a4ddf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LocalNetworkGatewaysClient.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.network.generated.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.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in LocalNetworkGatewaysClient. */ +public interface LocalNetworkGatewaysClient { + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters); + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, Context context); + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalNetworkGatewayInner createOrUpdate( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters); + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalNetworkGatewayInner createOrUpdate( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, Context context); + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName); + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String localNetworkGatewayName, Context context); + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 localNetworkGatewayName); + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 localNetworkGatewayName, Context context); + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 localNetworkGatewayName); + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 localNetworkGatewayName, Context context); + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalNetworkGatewayInner updateTags( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters); + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context); + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatGatewaysClient.java new file mode 100644 index 0000000000000..4a281f423ca43 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatGatewaysClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NatGatewaysClient. */ +public interface NatGatewaysClient { + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 natGatewayName); + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 natGatewayName, Context context); + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 natGatewayName); + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 natGatewayName, Context context); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NatGatewayInner getByResourceGroup(String resourceGroupName, String natGatewayName); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String natGatewayName, String expand, Context context); + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NatGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters); + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NatGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context); + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NatGatewayInner createOrUpdate(String resourceGroupName, String natGatewayName, NatGatewayInner parameters); + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NatGatewayInner createOrUpdate( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context); + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NatGatewayInner updateTags(String resourceGroupName, String natGatewayName, TagsObject parameters); + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String natGatewayName, TagsObject parameters, Context context); + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Nat Gateways 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 all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatRulesClient.java new file mode 100644 index 0000000000000..f265381288922 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatRulesClient.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VpnGatewayNatRuleInner; + +/** An instance of this class provides access to all the operations defined in NatRulesClient. */ +public interface NatRulesClient { + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayNatRuleInner get(String resourceGroupName, String gatewayName, String natRuleName); + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String gatewayName, String natRuleName, Context context); + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters); + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String gatewayName, + String natRuleName, + VpnGatewayNatRuleInner natRuleParameters, + Context context); + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayNatRuleInner createOrUpdate( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters); + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayNatRuleInner createOrUpdate( + String resourceGroupName, + String gatewayName, + String natRuleName, + VpnGatewayNatRuleInner natRuleParameters, + Context context); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 gatewayName, String natRuleName); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 gatewayName, String natRuleName, Context context); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, String natRuleName); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, String natRuleName, Context context); + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName); + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceIpConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceIpConfigurationsClient.java new file mode 100644 index 0000000000000..052f42d364184 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceIpConfigurationsClient.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.network.generated.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.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in NetworkInterfaceIpConfigurationsClient. + */ +public interface NetworkInterfaceIpConfigurationsClient { + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceIpConfigurationInner get( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName); + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceLoadBalancersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceLoadBalancersClient.java new file mode 100644 index 0000000000000..b7363b507f0db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceLoadBalancersClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.LoadBalancerInner; + +/** An instance of this class provides access to all the operations defined in NetworkInterfaceLoadBalancersClient. */ +public interface NetworkInterfaceLoadBalancersClient { + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkInterfaceName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceTapConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceTapConfigurationsClient.java new file mode 100644 index 0000000000000..1d20731332c72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceTapConfigurationsClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in NetworkInterfaceTapConfigurationsClient. + */ +public interface NetworkInterfaceTapConfigurationsClient { + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceTapConfigurationInner get( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters); + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + Context context); + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceTapConfigurationInner createOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters); + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceTapConfigurationInner createOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + Context context); + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfacesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfacesClient.java new file mode 100644 index 0000000000000..0e68f0fe88acb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfacesClient.java @@ -0,0 +1,646 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkInterfacesClient. */ +public interface NetworkInterfacesClient { + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName); + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context); + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName); + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner getCloudServiceNetworkInterface( + String resourceGroupName, String cloudServiceName, String roleInstanceName, String networkInterfaceName); + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCloudServiceNetworkInterfaceWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand, + Context context); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkInterfaceName); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkInterfaceName, Context context); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkInterfaceName); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkInterfaceName, Context context); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, String expand, Context context); + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters); + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context); + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner createOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters); + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner createOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context); + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName, TagsObject parameters); + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context); + + /** + * Gets all network interfaces in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all network interfaces 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 all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EffectiveRouteListResultInner> beginGetEffectiveRouteTable( + String resourceGroupName, String networkInterfaceName); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EffectiveRouteListResultInner> beginGetEffectiveRouteTable( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EffectiveRouteListResultInner getEffectiveRouteTable( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, Context context); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualMachineScaleSetNetworkInterfaceWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceIpConfigurationInner getVirtualMachineScaleSetIpConfiguration( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualMachineScaleSetIpConfigurationWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagementClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagementClient.java new file mode 100644 index 0000000000000..4849974ae0aaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagementClient.java @@ -0,0 +1,789 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for NetworkManagementClient class. */ +public interface NetworkManagementClient { + /** + * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * 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 ApplicationGatewaysClient object to access its operations. + * + * @return the ApplicationGatewaysClient object. + */ + ApplicationGatewaysClient getApplicationGateways(); + + /** + * Gets the ApplicationGatewayPrivateLinkResourcesClient object to access its operations. + * + * @return the ApplicationGatewayPrivateLinkResourcesClient object. + */ + ApplicationGatewayPrivateLinkResourcesClient getApplicationGatewayPrivateLinkResources(); + + /** + * Gets the ApplicationGatewayPrivateEndpointConnectionsClient object to access its operations. + * + * @return the ApplicationGatewayPrivateEndpointConnectionsClient object. + */ + ApplicationGatewayPrivateEndpointConnectionsClient getApplicationGatewayPrivateEndpointConnections(); + + /** + * Gets the ApplicationSecurityGroupsClient object to access its operations. + * + * @return the ApplicationSecurityGroupsClient object. + */ + ApplicationSecurityGroupsClient getApplicationSecurityGroups(); + + /** + * Gets the AvailableDelegationsClient object to access its operations. + * + * @return the AvailableDelegationsClient object. + */ + AvailableDelegationsClient getAvailableDelegations(); + + /** + * Gets the AvailableResourceGroupDelegationsClient object to access its operations. + * + * @return the AvailableResourceGroupDelegationsClient object. + */ + AvailableResourceGroupDelegationsClient getAvailableResourceGroupDelegations(); + + /** + * Gets the AvailableServiceAliasesClient object to access its operations. + * + * @return the AvailableServiceAliasesClient object. + */ + AvailableServiceAliasesClient getAvailableServiceAliases(); + + /** + * Gets the AzureFirewallsClient object to access its operations. + * + * @return the AzureFirewallsClient object. + */ + AzureFirewallsClient getAzureFirewalls(); + + /** + * Gets the AzureFirewallFqdnTagsClient object to access its operations. + * + * @return the AzureFirewallFqdnTagsClient object. + */ + AzureFirewallFqdnTagsClient getAzureFirewallFqdnTags(); + + /** + * Gets the WebCategoriesClient object to access its operations. + * + * @return the WebCategoriesClient object. + */ + WebCategoriesClient getWebCategories(); + + /** + * Gets the BastionHostsClient object to access its operations. + * + * @return the BastionHostsClient object. + */ + BastionHostsClient getBastionHosts(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the NetworkInterfacesClient object to access its operations. + * + * @return the NetworkInterfacesClient object. + */ + NetworkInterfacesClient getNetworkInterfaces(); + + /** + * Gets the PublicIpAddressesClient object to access its operations. + * + * @return the PublicIpAddressesClient object. + */ + PublicIpAddressesClient getPublicIpAddresses(); + + /** + * Gets the CustomIpPrefixesClient object to access its operations. + * + * @return the CustomIpPrefixesClient object. + */ + CustomIpPrefixesClient getCustomIpPrefixes(); + + /** + * Gets the DdosCustomPoliciesClient object to access its operations. + * + * @return the DdosCustomPoliciesClient object. + */ + DdosCustomPoliciesClient getDdosCustomPolicies(); + + /** + * Gets the DdosProtectionPlansClient object to access its operations. + * + * @return the DdosProtectionPlansClient object. + */ + DdosProtectionPlansClient getDdosProtectionPlans(); + + /** + * Gets the DscpConfigurationsClient object to access its operations. + * + * @return the DscpConfigurationsClient object. + */ + DscpConfigurationsClient getDscpConfigurations(); + + /** + * Gets the AvailableEndpointServicesClient object to access its operations. + * + * @return the AvailableEndpointServicesClient object. + */ + AvailableEndpointServicesClient getAvailableEndpointServices(); + + /** + * Gets the ExpressRouteCircuitAuthorizationsClient object to access its operations. + * + * @return the ExpressRouteCircuitAuthorizationsClient object. + */ + ExpressRouteCircuitAuthorizationsClient getExpressRouteCircuitAuthorizations(); + + /** + * Gets the ExpressRouteCircuitPeeringsClient object to access its operations. + * + * @return the ExpressRouteCircuitPeeringsClient object. + */ + ExpressRouteCircuitPeeringsClient getExpressRouteCircuitPeerings(); + + /** + * Gets the ExpressRouteCircuitConnectionsClient object to access its operations. + * + * @return the ExpressRouteCircuitConnectionsClient object. + */ + ExpressRouteCircuitConnectionsClient getExpressRouteCircuitConnections(); + + /** + * Gets the PeerExpressRouteCircuitConnectionsClient object to access its operations. + * + * @return the PeerExpressRouteCircuitConnectionsClient object. + */ + PeerExpressRouteCircuitConnectionsClient getPeerExpressRouteCircuitConnections(); + + /** + * Gets the ExpressRouteCircuitsClient object to access its operations. + * + * @return the ExpressRouteCircuitsClient object. + */ + ExpressRouteCircuitsClient getExpressRouteCircuits(); + + /** + * Gets the ExpressRouteServiceProvidersClient object to access its operations. + * + * @return the ExpressRouteServiceProvidersClient object. + */ + ExpressRouteServiceProvidersClient getExpressRouteServiceProviders(); + + /** + * Gets the ExpressRouteCrossConnectionsClient object to access its operations. + * + * @return the ExpressRouteCrossConnectionsClient object. + */ + ExpressRouteCrossConnectionsClient getExpressRouteCrossConnections(); + + /** + * Gets the ExpressRouteCrossConnectionPeeringsClient object to access its operations. + * + * @return the ExpressRouteCrossConnectionPeeringsClient object. + */ + ExpressRouteCrossConnectionPeeringsClient getExpressRouteCrossConnectionPeerings(); + + /** + * Gets the ExpressRoutePortsLocationsClient object to access its operations. + * + * @return the ExpressRoutePortsLocationsClient object. + */ + ExpressRoutePortsLocationsClient getExpressRoutePortsLocations(); + + /** + * Gets the ExpressRoutePortsClient object to access its operations. + * + * @return the ExpressRoutePortsClient object. + */ + ExpressRoutePortsClient getExpressRoutePorts(); + + /** + * Gets the ExpressRouteLinksClient object to access its operations. + * + * @return the ExpressRouteLinksClient object. + */ + ExpressRouteLinksClient getExpressRouteLinks(); + + /** + * Gets the FirewallPoliciesClient object to access its operations. + * + * @return the FirewallPoliciesClient object. + */ + FirewallPoliciesClient getFirewallPolicies(); + + /** + * Gets the FirewallPolicyRuleCollectionGroupsClient object to access its operations. + * + * @return the FirewallPolicyRuleCollectionGroupsClient object. + */ + FirewallPolicyRuleCollectionGroupsClient getFirewallPolicyRuleCollectionGroups(); + + /** + * Gets the IpAllocationsClient object to access its operations. + * + * @return the IpAllocationsClient object. + */ + IpAllocationsClient getIpAllocations(); + + /** + * Gets the IpGroupsClient object to access its operations. + * + * @return the IpGroupsClient object. + */ + IpGroupsClient getIpGroups(); + + /** + * Gets the LoadBalancersClient object to access its operations. + * + * @return the LoadBalancersClient object. + */ + LoadBalancersClient getLoadBalancers(); + + /** + * Gets the LoadBalancerBackendAddressPoolsClient object to access its operations. + * + * @return the LoadBalancerBackendAddressPoolsClient object. + */ + LoadBalancerBackendAddressPoolsClient getLoadBalancerBackendAddressPools(); + + /** + * Gets the LoadBalancerFrontendIpConfigurationsClient object to access its operations. + * + * @return the LoadBalancerFrontendIpConfigurationsClient object. + */ + LoadBalancerFrontendIpConfigurationsClient getLoadBalancerFrontendIpConfigurations(); + + /** + * Gets the InboundNatRulesClient object to access its operations. + * + * @return the InboundNatRulesClient object. + */ + InboundNatRulesClient getInboundNatRules(); + + /** + * Gets the LoadBalancerLoadBalancingRulesClient object to access its operations. + * + * @return the LoadBalancerLoadBalancingRulesClient object. + */ + LoadBalancerLoadBalancingRulesClient getLoadBalancerLoadBalancingRules(); + + /** + * Gets the LoadBalancerOutboundRulesClient object to access its operations. + * + * @return the LoadBalancerOutboundRulesClient object. + */ + LoadBalancerOutboundRulesClient getLoadBalancerOutboundRules(); + + /** + * Gets the LoadBalancerNetworkInterfacesClient object to access its operations. + * + * @return the LoadBalancerNetworkInterfacesClient object. + */ + LoadBalancerNetworkInterfacesClient getLoadBalancerNetworkInterfaces(); + + /** + * Gets the LoadBalancerProbesClient object to access its operations. + * + * @return the LoadBalancerProbesClient object. + */ + LoadBalancerProbesClient getLoadBalancerProbes(); + + /** + * Gets the NatGatewaysClient object to access its operations. + * + * @return the NatGatewaysClient object. + */ + NatGatewaysClient getNatGateways(); + + /** + * Gets the NetworkInterfaceIpConfigurationsClient object to access its operations. + * + * @return the NetworkInterfaceIpConfigurationsClient object. + */ + NetworkInterfaceIpConfigurationsClient getNetworkInterfaceIpConfigurations(); + + /** + * Gets the NetworkInterfaceLoadBalancersClient object to access its operations. + * + * @return the NetworkInterfaceLoadBalancersClient object. + */ + NetworkInterfaceLoadBalancersClient getNetworkInterfaceLoadBalancers(); + + /** + * Gets the NetworkInterfaceTapConfigurationsClient object to access its operations. + * + * @return the NetworkInterfaceTapConfigurationsClient object. + */ + NetworkInterfaceTapConfigurationsClient getNetworkInterfaceTapConfigurations(); + + /** + * Gets the NetworkProfilesClient object to access its operations. + * + * @return the NetworkProfilesClient object. + */ + NetworkProfilesClient getNetworkProfiles(); + + /** + * Gets the NetworkSecurityGroupsClient object to access its operations. + * + * @return the NetworkSecurityGroupsClient object. + */ + NetworkSecurityGroupsClient getNetworkSecurityGroups(); + + /** + * Gets the SecurityRulesClient object to access its operations. + * + * @return the SecurityRulesClient object. + */ + SecurityRulesClient getSecurityRules(); + + /** + * Gets the DefaultSecurityRulesClient object to access its operations. + * + * @return the DefaultSecurityRulesClient object. + */ + DefaultSecurityRulesClient getDefaultSecurityRules(); + + /** + * Gets the NetworkVirtualAppliancesClient object to access its operations. + * + * @return the NetworkVirtualAppliancesClient object. + */ + NetworkVirtualAppliancesClient getNetworkVirtualAppliances(); + + /** + * Gets the VirtualApplianceSitesClient object to access its operations. + * + * @return the VirtualApplianceSitesClient object. + */ + VirtualApplianceSitesClient getVirtualApplianceSites(); + + /** + * Gets the VirtualApplianceSkusClient object to access its operations. + * + * @return the VirtualApplianceSkusClient object. + */ + VirtualApplianceSkusClient getVirtualApplianceSkus(); + + /** + * Gets the InboundSecurityRuleOperationsClient object to access its operations. + * + * @return the InboundSecurityRuleOperationsClient object. + */ + InboundSecurityRuleOperationsClient getInboundSecurityRuleOperations(); + + /** + * Gets the NetworkWatchersClient object to access its operations. + * + * @return the NetworkWatchersClient object. + */ + NetworkWatchersClient getNetworkWatchers(); + + /** + * Gets the PacketCapturesClient object to access its operations. + * + * @return the PacketCapturesClient object. + */ + PacketCapturesClient getPacketCaptures(); + + /** + * Gets the ConnectionMonitorsClient object to access its operations. + * + * @return the ConnectionMonitorsClient object. + */ + ConnectionMonitorsClient getConnectionMonitors(); + + /** + * Gets the FlowLogsClient object to access its operations. + * + * @return the FlowLogsClient object. + */ + FlowLogsClient getFlowLogs(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the PrivateEndpointsClient object to access its operations. + * + * @return the PrivateEndpointsClient object. + */ + PrivateEndpointsClient getPrivateEndpoints(); + + /** + * Gets the AvailablePrivateEndpointTypesClient object to access its operations. + * + * @return the AvailablePrivateEndpointTypesClient object. + */ + AvailablePrivateEndpointTypesClient getAvailablePrivateEndpointTypes(); + + /** + * Gets the PrivateDnsZoneGroupsClient object to access its operations. + * + * @return the PrivateDnsZoneGroupsClient object. + */ + PrivateDnsZoneGroupsClient getPrivateDnsZoneGroups(); + + /** + * Gets the PrivateLinkServicesClient object to access its operations. + * + * @return the PrivateLinkServicesClient object. + */ + PrivateLinkServicesClient getPrivateLinkServices(); + + /** + * Gets the PublicIpPrefixesClient object to access its operations. + * + * @return the PublicIpPrefixesClient object. + */ + PublicIpPrefixesClient getPublicIpPrefixes(); + + /** + * Gets the RouteFiltersClient object to access its operations. + * + * @return the RouteFiltersClient object. + */ + RouteFiltersClient getRouteFilters(); + + /** + * Gets the RouteFilterRulesClient object to access its operations. + * + * @return the RouteFilterRulesClient object. + */ + RouteFilterRulesClient getRouteFilterRules(); + + /** + * Gets the RouteTablesClient object to access its operations. + * + * @return the RouteTablesClient object. + */ + RouteTablesClient getRouteTables(); + + /** + * Gets the RoutesClient object to access its operations. + * + * @return the RoutesClient object. + */ + RoutesClient getRoutes(); + + /** + * Gets the SecurityPartnerProvidersClient object to access its operations. + * + * @return the SecurityPartnerProvidersClient object. + */ + SecurityPartnerProvidersClient getSecurityPartnerProviders(); + + /** + * Gets the BgpServiceCommunitiesClient object to access its operations. + * + * @return the BgpServiceCommunitiesClient object. + */ + BgpServiceCommunitiesClient getBgpServiceCommunities(); + + /** + * Gets the ServiceEndpointPoliciesClient object to access its operations. + * + * @return the ServiceEndpointPoliciesClient object. + */ + ServiceEndpointPoliciesClient getServiceEndpointPolicies(); + + /** + * Gets the ServiceEndpointPolicyDefinitionsClient object to access its operations. + * + * @return the ServiceEndpointPolicyDefinitionsClient object. + */ + ServiceEndpointPolicyDefinitionsClient getServiceEndpointPolicyDefinitions(); + + /** + * Gets the ServiceTagsClient object to access its operations. + * + * @return the ServiceTagsClient object. + */ + ServiceTagsClient getServiceTags(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the VirtualNetworksClient object to access its operations. + * + * @return the VirtualNetworksClient object. + */ + VirtualNetworksClient getVirtualNetworks(); + + /** + * Gets the SubnetsClient object to access its operations. + * + * @return the SubnetsClient object. + */ + SubnetsClient getSubnets(); + + /** + * Gets the ResourceNavigationLinksClient object to access its operations. + * + * @return the ResourceNavigationLinksClient object. + */ + ResourceNavigationLinksClient getResourceNavigationLinks(); + + /** + * Gets the ServiceAssociationLinksClient object to access its operations. + * + * @return the ServiceAssociationLinksClient object. + */ + ServiceAssociationLinksClient getServiceAssociationLinks(); + + /** + * Gets the VirtualNetworkPeeringsClient object to access its operations. + * + * @return the VirtualNetworkPeeringsClient object. + */ + VirtualNetworkPeeringsClient getVirtualNetworkPeerings(); + + /** + * Gets the VirtualNetworkGatewaysClient object to access its operations. + * + * @return the VirtualNetworkGatewaysClient object. + */ + VirtualNetworkGatewaysClient getVirtualNetworkGateways(); + + /** + * Gets the VirtualNetworkGatewayConnectionsClient object to access its operations. + * + * @return the VirtualNetworkGatewayConnectionsClient object. + */ + VirtualNetworkGatewayConnectionsClient getVirtualNetworkGatewayConnections(); + + /** + * Gets the LocalNetworkGatewaysClient object to access its operations. + * + * @return the LocalNetworkGatewaysClient object. + */ + LocalNetworkGatewaysClient getLocalNetworkGateways(); + + /** + * Gets the VirtualNetworkGatewayNatRulesClient object to access its operations. + * + * @return the VirtualNetworkGatewayNatRulesClient object. + */ + VirtualNetworkGatewayNatRulesClient getVirtualNetworkGatewayNatRules(); + + /** + * Gets the VirtualNetworkTapsClient object to access its operations. + * + * @return the VirtualNetworkTapsClient object. + */ + VirtualNetworkTapsClient getVirtualNetworkTaps(); + + /** + * Gets the VirtualRoutersClient object to access its operations. + * + * @return the VirtualRoutersClient object. + */ + VirtualRoutersClient getVirtualRouters(); + + /** + * Gets the VirtualRouterPeeringsClient object to access its operations. + * + * @return the VirtualRouterPeeringsClient object. + */ + VirtualRouterPeeringsClient getVirtualRouterPeerings(); + + /** + * Gets the VirtualWansClient object to access its operations. + * + * @return the VirtualWansClient object. + */ + VirtualWansClient getVirtualWans(); + + /** + * Gets the VpnSitesClient object to access its operations. + * + * @return the VpnSitesClient object. + */ + VpnSitesClient getVpnSites(); + + /** + * Gets the VpnSiteLinksClient object to access its operations. + * + * @return the VpnSiteLinksClient object. + */ + VpnSiteLinksClient getVpnSiteLinks(); + + /** + * Gets the VpnSitesConfigurationsClient object to access its operations. + * + * @return the VpnSitesConfigurationsClient object. + */ + VpnSitesConfigurationsClient getVpnSitesConfigurations(); + + /** + * Gets the VpnServerConfigurationsClient object to access its operations. + * + * @return the VpnServerConfigurationsClient object. + */ + VpnServerConfigurationsClient getVpnServerConfigurations(); + + /** + * Gets the VirtualHubsClient object to access its operations. + * + * @return the VirtualHubsClient object. + */ + VirtualHubsClient getVirtualHubs(); + + /** + * Gets the HubVirtualNetworkConnectionsClient object to access its operations. + * + * @return the HubVirtualNetworkConnectionsClient object. + */ + HubVirtualNetworkConnectionsClient getHubVirtualNetworkConnections(); + + /** + * Gets the VpnGatewaysClient object to access its operations. + * + * @return the VpnGatewaysClient object. + */ + VpnGatewaysClient getVpnGateways(); + + /** + * Gets the VpnLinkConnectionsClient object to access its operations. + * + * @return the VpnLinkConnectionsClient object. + */ + VpnLinkConnectionsClient getVpnLinkConnections(); + + /** + * Gets the VpnConnectionsClient object to access its operations. + * + * @return the VpnConnectionsClient object. + */ + VpnConnectionsClient getVpnConnections(); + + /** + * Gets the VpnSiteLinkConnectionsClient object to access its operations. + * + * @return the VpnSiteLinkConnectionsClient object. + */ + VpnSiteLinkConnectionsClient getVpnSiteLinkConnections(); + + /** + * Gets the NatRulesClient object to access its operations. + * + * @return the NatRulesClient object. + */ + NatRulesClient getNatRules(); + + /** + * Gets the P2SVpnGatewaysClient object to access its operations. + * + * @return the P2SVpnGatewaysClient object. + */ + P2SVpnGatewaysClient getP2SVpnGateways(); + + /** + * Gets the VpnServerConfigurationsAssociatedWithVirtualWansClient object to access its operations. + * + * @return the VpnServerConfigurationsAssociatedWithVirtualWansClient object. + */ + VpnServerConfigurationsAssociatedWithVirtualWansClient getVpnServerConfigurationsAssociatedWithVirtualWans(); + + /** + * Gets the VirtualHubRouteTableV2SClient object to access its operations. + * + * @return the VirtualHubRouteTableV2SClient object. + */ + VirtualHubRouteTableV2SClient getVirtualHubRouteTableV2S(); + + /** + * Gets the ExpressRouteGatewaysClient object to access its operations. + * + * @return the ExpressRouteGatewaysClient object. + */ + ExpressRouteGatewaysClient getExpressRouteGateways(); + + /** + * Gets the ExpressRouteConnectionsClient object to access its operations. + * + * @return the ExpressRouteConnectionsClient object. + */ + ExpressRouteConnectionsClient getExpressRouteConnections(); + + /** + * Gets the VirtualHubBgpConnectionsClient object to access its operations. + * + * @return the VirtualHubBgpConnectionsClient object. + */ + VirtualHubBgpConnectionsClient getVirtualHubBgpConnections(); + + /** + * Gets the VirtualHubIpConfigurationsClient object to access its operations. + * + * @return the VirtualHubIpConfigurationsClient object. + */ + VirtualHubIpConfigurationsClient getVirtualHubIpConfigurations(); + + /** + * Gets the HubRouteTablesClient object to access its operations. + * + * @return the HubRouteTablesClient object. + */ + HubRouteTablesClient getHubRouteTables(); + + /** + * Gets the WebApplicationFirewallPoliciesClient object to access its operations. + * + * @return the WebApplicationFirewallPoliciesClient object. + */ + WebApplicationFirewallPoliciesClient getWebApplicationFirewallPolicies(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkProfilesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkProfilesClient.java new file mode 100644 index 0000000000000..2b638603e5861 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkProfilesClient.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkProfilesClient. */ +public interface NetworkProfilesClient { + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkProfileName); + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkProfileName, Context context); + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkProfileName); + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkProfileName, Context context); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkProfileName, String expand, Context context); + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkProfileInner createOrUpdate( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters); + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters, Context context); + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName, TagsObject parameters); + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkProfileName, TagsObject parameters, Context context); + + /** + * Gets all the network profiles in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the network profiles 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 all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkSecurityGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkSecurityGroupsClient.java new file mode 100644 index 0000000000000..5835ab9d6a51a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkSecurityGroupsClient.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkSecurityGroupsClient. */ +public interface NetworkSecurityGroupsClient { + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkSecurityGroupName); + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkSecurityGroupName); + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkSecurityGroupName, String expand, Context context); + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters); + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + NetworkSecurityGroupInner parameters, + Context context); + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityGroupInner createOrUpdate( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters); + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityGroupInner createOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + NetworkSecurityGroupInner parameters, + Context context); + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityGroupInner updateTags( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters); + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context); + + /** + * Gets all network security groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all network security groups 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 all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualAppliancesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualAppliancesClient.java new file mode 100644 index 0000000000000..2b291c3ccfb98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualAppliancesClient.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkVirtualAppliancesClient. */ +public interface NetworkVirtualAppliancesClient { + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkVirtualApplianceName); + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkVirtualApplianceName, Context context); + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkVirtualApplianceName); + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkVirtualApplianceName, Context context); + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceInner getByResourceGroup(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String expand, Context context); + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceInner updateTags( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters); + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters, Context context); + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkVirtualApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters); + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkVirtualApplianceInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInner parameters, + Context context); + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceInner createOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters); + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInner parameters, + Context context); + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all Network Virtual Appliances 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 all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkWatchersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkWatchersClient.java new file mode 100644 index 0000000000000..d943ff4e37b04 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkWatchersClient.java @@ -0,0 +1,989 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.AvailableProvidersListInner; +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters; +import com.azure.resourcemanager.network.generated.models.ConnectivityParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters; +import com.azure.resourcemanager.network.generated.models.NextHopParameters; +import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.TopologyParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters; + +/** An instance of this class provides access to all the operations defined in NetworkWatchersClient. */ +public interface NetworkWatchersClient { + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkWatcherInner createOrUpdate( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters); + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, Context context); + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName); + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkWatcherName, Context context); + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkWatcherName); + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkWatcherName, Context context); + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkWatcherName); + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkWatcherName, Context context); + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, TagsObject parameters); + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkWatcherName, TagsObject parameters, Context context); + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all network watchers by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all network watchers by 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 all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TopologyInner getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters); + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getTopologyWithResponse( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VerificationIpFlowResultInner verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VerificationIpFlowResultInner verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NextHopResultInner> beginGetNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NextHopResultInner> beginGetNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NextHopResultInner getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NextHopResultInner getNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityGroupViewResultInner getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityGroupViewResultInner getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TroubleshootingResultInner getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TroubleshootingResultInner getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TroubleshootingResultInner getTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TroubleshootingResultInner getTroubleshootingResult( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInformationInner setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInformationInner setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInformationInner getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInformationInner getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectivityInformationInner checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectivityInformationInner checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AzureReachabilityReportInner> beginGetAzureReachabilityReport( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AzureReachabilityReportInner> beginGetAzureReachabilityReport( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureReachabilityReportInner getAzureReachabilityReport( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureReachabilityReportInner getAzureReachabilityReport( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailableProvidersListInner listAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailableProvidersListInner listAvailableProviders( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnostic( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnostic( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/OperationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..093573e276aa7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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.network.generated.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.network.generated.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 Network Rest API 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 result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Network Rest API 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 result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/P2SVpnGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/P2SVpnGatewaysClient.java new file mode 100644 index 0000000000000..a9f06afb58726 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/P2SVpnGatewaysClient.java @@ -0,0 +1,579 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.P2SVpnConnectionHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in P2SVpnGatewaysClient. */ +public interface P2SVpnGatewaysClient { + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context); + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters); + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context); + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner createOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters); + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner createOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context); + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters); + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context); + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner updateTags(String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters); + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner updateTags( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 gatewayName); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 gatewayName, Context context); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, Context context); + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName, Context context); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner reset(String resourceGroupName, String gatewayName); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner reset(String resourceGroupName, String gatewayName, Context context); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnProfileResponseInner generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnProfileResponseInner generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnGatewayInner> beginGetP2SVpnConnectionHealth( + String resourceGroupName, String gatewayName); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnGatewayInner> beginGetP2SVpnConnectionHealth( + String resourceGroupName, String gatewayName, Context context); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName, Context context); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnConnectionHealthInner getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnConnectionHealthInner getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context); + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDisconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request); + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDisconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context); + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request); + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PacketCapturesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PacketCapturesClient.java new file mode 100644 index 0000000000000..f6c1d6c8f8dc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PacketCapturesClient.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCapture; + +/** An instance of this class provides access to all the operations defined in PacketCapturesClient. */ +public interface PacketCapturesClient { + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PacketCaptureResultInner> beginCreate( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters); + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PacketCaptureResultInner> beginCreate( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context); + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCaptureResultInner create( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters); + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCaptureResultInner create( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkWatcherName, String packetCaptureName); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkWatcherName, String packetCaptureName, Context context); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkWatcherName, String packetCaptureName); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkWatcherName, String packetCaptureName, Context context); + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStop( + String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStop( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PacketCaptureQueryStatusResultInner> beginGetStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PacketCaptureQueryStatusResultInner> beginGetStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCaptureQueryStatusResultInner getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCaptureQueryStatusResultInner getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PeerExpressRouteCircuitConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PeerExpressRouteCircuitConnectionsClient.java new file mode 100644 index 0000000000000..11be9562455c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PeerExpressRouteCircuitConnectionsClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in PeerExpressRouteCircuitConnectionsClient. + */ +public interface PeerExpressRouteCircuitConnectionsClient { + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerExpressRouteCircuitConnectionInner get( + String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateDnsZoneGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateDnsZoneGroupsClient.java new file mode 100644 index 0000000000000..6856c31a01b8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateDnsZoneGroupsClient.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.PrivateDnsZoneGroupInner; + +/** An instance of this class provides access to all the operations defined in PrivateDnsZoneGroupsClient. */ +public interface PrivateDnsZoneGroupsClient { + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName); + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context); + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName); + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context); + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the private dns zone group resource by specified private dns zone group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateDnsZoneGroupInner get(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName); + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the private dns zone group resource by specified private dns zone group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context); + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateDnsZoneGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters); + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateDnsZoneGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context); + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateDnsZoneGroupInner createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters); + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateDnsZoneGroupInner createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context); + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String privateEndpointName, String resourceGroupName); + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String privateEndpointName, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateEndpointsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateEndpointsClient.java new file mode 100644 index 0000000000000..8d46df0cf4bfc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateEndpointsClient.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.PrivateEndpointInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointsClient. */ +public interface PrivateEndpointsClient { + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 privateEndpointName); + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 privateEndpointName, Context context); + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 privateEndpointName); + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 privateEndpointName, Context context); + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointInner getByResourceGroup(String resourceGroupName, String privateEndpointName); + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateEndpointName, String expand, Context context); + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters); + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters, Context context); + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointInner createOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters); + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointInner createOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters, Context context); + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all private endpoints in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all private endpoints in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateLinkServicesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateLinkServicesClient.java new file mode 100644 index 0000000000000..c5d70c65b7047 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateLinkServicesClient.java @@ -0,0 +1,583 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; +import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest; + +/** An instance of this class provides access to all the operations defined in PrivateLinkServicesClient. */ +public interface PrivateLinkServicesClient { + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 serviceName); + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 serviceName, Context context); + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 serviceName); + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 serviceName, Context context); + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkServiceInner getByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, String expand, Context context); + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateLinkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters); + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateLinkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, Context context); + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkServiceInner createOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters); + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkServiceInner createOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, Context context); + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all private link service in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all private link service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner getPrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName); + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPrivateEndpointConnectionWithResponse( + String resourceGroupName, String serviceName, String peConnectionName, String expand, Context context); + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner updatePrivateEndpointConnection( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updatePrivateEndpointConnectionWithResponse( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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> beginDeletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName); + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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> beginDeletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName, Context context); + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 deletePrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName); + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 deletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName, Context context); + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName); + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName, Context context); + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibility(String location, CheckPrivateLinkServiceVisibilityRequest parameters); + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context); + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters); + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context); + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters); + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context); + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters); + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAutoApprovedPrivateLinkServices(String location); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAutoApprovedPrivateLinkServices( + String location, Context context); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpAddressesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpAddressesClient.java new file mode 100644 index 0000000000000..c44f65046b784 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpAddressesClient.java @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in PublicIpAddressesClient. */ +public interface PublicIpAddressesClient { + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName); + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context); + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner getCloudServicePublicIpAddress( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName); + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCloudServicePublicIpAddressWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context); + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 publicIpAddressName); + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 publicIpAddressName, Context context); + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publicIpAddressName); + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publicIpAddressName, Context context); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpAddressName, String expand, Context context); + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters); + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context); + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner createOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters); + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner createOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context); + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner updateTags(String resourceGroupName, String publicIpAddressName, TagsObject parameters); + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context); + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the public IP addresses 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 all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName, Context context); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner getVirtualMachineScaleSetPublicIpAddress( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualMachineScaleSetPublicIpAddressWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpPrefixesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpPrefixesClient.java new file mode 100644 index 0000000000000..70ae68cb92e8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpPrefixesClient.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.PublicIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in PublicIpPrefixesClient. */ +public interface PublicIpPrefixesClient { + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 publicIpPrefixName); + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 publicIpPrefixName, Context context); + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publicIpPrefixName); + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publicIpPrefixName, Context context); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpPrefixName, String expand, Context context); + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters); + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context); + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpPrefixInner createOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters); + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpPrefixInner createOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context); + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, TagsObject parameters); + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context); + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the public IP prefixes 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 all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceNavigationLinksClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceNavigationLinksClient.java new file mode 100644 index 0000000000000..70fcd7e6d9d90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceNavigationLinksClient.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.network.generated.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.network.generated.fluent.models.ResourceNavigationLinksListResultInner; + +/** An instance of this class provides access to all the operations defined in ResourceNavigationLinksClient. */ +public interface ResourceNavigationLinksClient { + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resource navigation links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceNavigationLinksListResultInner list(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resource navigation links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceProvidersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..8f7708ad5fa06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceProvidersClient.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.BastionActiveSessionInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.SessionIds; +import com.azure.resourcemanager.network.generated.models.VirtualWanVpnProfileParameters; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDeleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDeleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getActiveSessions(String resourceGroupName, String bastionHostname); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname, Context context); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context); + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel); + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkDnsNameAvailabilityWithResponse( + String location, String domainNameLabel, Context context); + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualWanSecurityProvidersInner supportedSecurityProviders(String resourceGroupName, String virtualWanName); + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response supportedSecurityProvidersWithResponse( + String resourceGroupName, String virtualWanName, Context context); + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams); + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context); + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnProfileResponseInner generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams); + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnProfileResponseInner generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFilterRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFilterRulesClient.java new file mode 100644 index 0000000000000..a933095278f4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFilterRulesClient.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.network.generated.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.network.generated.fluent.models.RouteFilterRuleInner; + +/** An instance of this class provides access to all the operations defined in RouteFilterRulesClient. */ +public interface RouteFilterRulesClient { + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 routeFilterName, String ruleName); + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 routeFilterName, String ruleName, Context context); + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeFilterName, String ruleName); + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeFilterName, String ruleName, Context context); + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String routeFilterName, String ruleName, Context context); + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters); + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context); + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterRuleInner createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters); + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterRuleInner createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRouteFilter( + String resourceGroupName, String routeFilterName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFiltersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFiltersClient.java new file mode 100644 index 0000000000000..a909362bc6061 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFiltersClient.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in RouteFiltersClient. */ +public interface RouteFiltersClient { + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 routeFilterName); + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 routeFilterName, Context context); + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeFilterName); + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeFilterName, Context context); + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName); + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String routeFilterName, String expand, Context context); + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RouteFilterInner> beginCreateOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters); + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RouteFilterInner> beginCreateOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context); + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterInner createOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters); + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterInner createOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context); + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterInner updateTags(String resourceGroupName, String routeFilterName, TagsObject parameters); + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String routeFilterName, TagsObject parameters, Context context); + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route filters in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all route filters 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 all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteTablesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteTablesClient.java new file mode 100644 index 0000000000000..85b40f743e620 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteTablesClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in RouteTablesClient. */ +public interface RouteTablesClient { + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 routeTableName); + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 routeTableName, Context context); + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeTableName); + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeTableName, Context context); + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName); + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String routeTableName, String expand, Context context); + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RouteTableInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, RouteTableInner parameters); + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RouteTableInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context); + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteTableInner createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters); + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteTableInner createOrUpdate( + String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context); + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteTableInner updateTags(String resourceGroupName, String routeTableName, TagsObject parameters); + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String routeTableName, TagsObject parameters, Context context); + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route tables in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all route tables 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 all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutesClient.java new file mode 100644 index 0000000000000..23f9542960ccb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutesClient.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.RouteInner; + +/** An instance of this class provides access to all the operations defined in RoutesClient. */ +public interface RoutesClient { + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 routeTableName, String routeName); + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 routeTableName, String routeName, Context context); + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeTableName, String routeName); + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeTableName, String routeName, Context context); + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner get(String resourceGroupName, String routeTableName, String routeName); + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String routeTableName, String routeName, Context context); + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RouteInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters); + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RouteInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, Context context); + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner createOrUpdate( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters); + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner createOrUpdate( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, Context context); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String routeTableName); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String routeTableName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityPartnerProvidersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityPartnerProvidersClient.java new file mode 100644 index 0000000000000..125af2ed73ac2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityPartnerProvidersClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in SecurityPartnerProvidersClient. */ +public interface SecurityPartnerProvidersClient { + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 securityPartnerProviderName); + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String securityPartnerProviderName, Context context); + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 securityPartnerProviderName); + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String securityPartnerProviderName, Context context); + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPartnerProviderInner getByResourceGroup(String resourceGroupName, String securityPartnerProviderName); + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String securityPartnerProviderName, Context context); + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SecurityPartnerProviderInner> beginCreateOrUpdate( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters); + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SecurityPartnerProviderInner> beginCreateOrUpdate( + String resourceGroupName, + String securityPartnerProviderName, + SecurityPartnerProviderInner parameters, + Context context); + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPartnerProviderInner createOrUpdate( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters); + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPartnerProviderInner createOrUpdate( + String resourceGroupName, + String securityPartnerProviderName, + SecurityPartnerProviderInner parameters, + Context context); + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPartnerProviderInner updateTags( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters); + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters, Context context); + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Security Partner Providers 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 all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityRulesClient.java new file mode 100644 index 0000000000000..b3c937bcfcfee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityRulesClient.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.network.generated.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.network.generated.fluent.models.SecurityRuleInner; + +/** An instance of this class provides access to all the operations defined in SecurityRulesClient. */ +public interface SecurityRulesClient { + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkSecurityGroupName, String securityRuleName); + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkSecurityGroupName, String securityRuleName, Context context); + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkSecurityGroupName, String securityRuleName); + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkSecurityGroupName, String securityRuleName, Context context); + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context); + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters); + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters, + Context context); + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityRuleInner createOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters); + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityRuleInner createOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters, + Context context); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceAssociationLinksClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceAssociationLinksClient.java new file mode 100644 index 0000000000000..e2fb7045fdb2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceAssociationLinksClient.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.network.generated.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.network.generated.fluent.models.ServiceAssociationLinksListResultInner; + +/** An instance of this class provides access to all the operations defined in ServiceAssociationLinksClient. */ +public interface ServiceAssociationLinksClient { + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 service association links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceAssociationLinksListResultInner list(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 service association links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPoliciesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPoliciesClient.java new file mode 100644 index 0000000000000..215810323d7c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPoliciesClient.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ServiceEndpointPoliciesClient. */ +public interface ServiceEndpointPoliciesClient { + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceEndpointPolicyName); + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceEndpointPolicyName, Context context); + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceEndpointPolicyName); + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceEndpointPolicyName, Context context); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context); + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters); + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + ServiceEndpointPolicyInner parameters, + Context context); + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyInner createOrUpdate( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters); + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyInner createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + ServiceEndpointPolicyInner parameters, + Context context); + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyInner updateTags( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters); + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context); + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the service endpoint policies 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 all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPolicyDefinitionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPolicyDefinitionsClient.java new file mode 100644 index 0000000000000..e2309858e2398 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPolicyDefinitionsClient.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; + +/** + * An instance of this class provides access to all the operations defined in ServiceEndpointPolicyDefinitionsClient. + */ +public interface ServiceEndpointPolicyDefinitionsClient { + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context); + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context); + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition 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 specified service endpoint policy definitions from service endpoint policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyDefinitionInner get( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition 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 specified service endpoint policy definitions from service endpoint policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context); + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions); + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context); + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyDefinitionInner createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions); + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyDefinitionInner createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagsClient.java new file mode 100644 index 0000000000000..34f2317749720 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagsClient.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.network.generated.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.network.generated.fluent.models.ServiceTagsListResultInner; + +/** An instance of this class provides access to all the operations defined in ServiceTagsClient. */ +public interface ServiceTagsClient { + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 service tag information resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceTagsListResultInner list(String location); + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubnetsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubnetsClient.java new file mode 100644 index 0000000000000..f2d3470c11413 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubnetsClient.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; + +/** An instance of this class provides access to all the operations defined in SubnetsClient. */ +public interface SubnetsClient { + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkName, String subnetName); + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkName, String subnetName, Context context); + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String subnetName); + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String subnetName, Context context); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context); + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SubnetInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters); + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SubnetInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + SubnetInner subnetParameters, + Context context); + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubnetInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters); + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubnetInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + SubnetInner subnetParameters, + Context context); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginPrepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginPrepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUnprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUnprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualNetworkName); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/UsagesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/UsagesClient.java new file mode 100644 index 0000000000000..43455958e8a5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/UsagesClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.UsageInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSitesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSitesClient.java new file mode 100644 index 0000000000000..62edcec940d87 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSitesClient.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.network.generated.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.network.generated.fluent.models.VirtualApplianceSiteInner; + +/** An instance of this class provides access to all the operations defined in VirtualApplianceSitesClient. */ +public interface VirtualApplianceSitesClient { + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkVirtualApplianceName, String siteName); + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context); + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName); + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context); + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the specified Virtual Appliance Site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualApplianceSiteInner get(String resourceGroupName, String networkVirtualApplianceName, String siteName); + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the specified Virtual Appliance Site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context); + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualApplianceSiteInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters); + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualApplianceSiteInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters, + Context context); + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualApplianceSiteInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters); + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualApplianceSiteInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters, + Context context); + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String networkVirtualApplianceName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSkusClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSkusClient.java new file mode 100644 index 0000000000000..4ef8ba3fdac23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSkusClient.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; + +/** An instance of this class provides access to all the operations defined in VirtualApplianceSkusClient. */ +public interface VirtualApplianceSkusClient { + /** + * List all SKUs available for a virtual appliance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all SKUs available for a virtual appliance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the NetworkVirtualApplianceSkus resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceSkuInner get(String skuName); + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the NetworkVirtualApplianceSkus resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String skuName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubBgpConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubBgpConnectionsClient.java new file mode 100644 index 0000000000000..6177e31072747 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubBgpConnectionsClient.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; + +/** An instance of this class provides access to all the operations defined in VirtualHubBgpConnectionsClient. */ +public interface VirtualHubBgpConnectionsClient { + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BgpConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String connectionName, BgpConnectionInner parameters); + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BgpConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + BgpConnectionInner parameters, + Context context); + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpConnectionInner createOrUpdate( + String resourceGroupName, String virtualHubName, String connectionName, BgpConnectionInner parameters); + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpConnectionInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + BgpConnectionInner parameters, + Context context); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName, String connectionName); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName, String connectionName, Context context); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String connectionName); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PeerRouteListInner> beginListLearnedRoutes( + String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PeerRouteListInner> beginListLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerRouteListInner listLearnedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerRouteListInner listLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PeerRouteListInner> beginListAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PeerRouteListInner> beginListAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerRouteListInner listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerRouteListInner listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubIpConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubIpConfigurationsClient.java new file mode 100644 index 0000000000000..21efd18ad65c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubIpConfigurationsClient.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.network.generated.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.network.generated.fluent.models.HubIpConfigurationInner; + +/** An instance of this class provides access to all the operations defined in VirtualHubIpConfigurationsClient. */ +public interface VirtualHubIpConfigurationsClient { + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubIpConfigurationInner get(String resourceGroupName, String virtualHubName, String ipConfigName); + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String ipConfigName, Context context); + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, HubIpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters); + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, HubIpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String ipConfigName, + HubIpConfigurationInner parameters, + Context context); + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubIpConfigurationInner createOrUpdate( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters); + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubIpConfigurationInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String ipConfigName, + HubIpConfigurationInner parameters, + Context context); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName, String ipConfigName); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName, String ipConfigName, Context context); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String ipConfigName); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String ipConfigName, Context context); + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubRouteTableV2SClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubRouteTableV2SClient.java new file mode 100644 index 0000000000000..342fdf6cbd8f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubRouteTableV2SClient.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VirtualHubRouteTableV2Inner; + +/** An instance of this class provides access to all the operations defined in VirtualHubRouteTableV2SClient. */ +public interface VirtualHubRouteTableV2SClient { + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubRouteTableV2Inner get(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualHubRouteTableV2Inner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters); + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualHubRouteTableV2Inner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context); + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubRouteTableV2Inner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters); + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubRouteTableV2Inner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context); + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualHubName, String routeTableName); + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualHubName, String routeTableName, Context context); + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualHubName, String routeTableName); + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualHubName, String routeTableName, Context context); + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubsClient.java new file mode 100644 index 0000000000000..56405fc7c30c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubsClient.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in VirtualHubsClient. */ +public interface VirtualHubsClient { + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHubName, Context context); + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualHubInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters); + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualHubInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context); + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubInner createOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters); + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubInner createOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context); + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubInner updateTags(String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters); + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context); + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName); + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualHubName, Context context); + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName); + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, Context context); + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginGetEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginGetEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void getEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayConnectionsClient.java new file mode 100644 index 0000000000000..609f20bbdd1b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayConnectionsClient.java @@ -0,0 +1,740 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; + +/** + * An instance of this class provides access to all the operations defined in VirtualNetworkGatewayConnectionsClient. + */ +public interface VirtualNetworkGatewayConnectionsClient { + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters); + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters, + Context context); + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayConnectionInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters); + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayConnectionInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters, + Context context); + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayConnectionInner getByResourceGroup( + String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkGatewayConnectionName); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkGatewayConnectionName, Context context); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayConnectionName); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayConnectionName, Context context); + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayConnectionInner> beginUpdateTags( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters); + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayConnectionInner> beginUpdateTags( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context); + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayConnectionInner updateTags( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters); + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayConnectionInner updateTags( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context); + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context); + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionSharedKeyInner setSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionSharedKeyInner setSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key 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 response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key 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 response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSharedKeyWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionResetSharedKeyInner resetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionResetSharedKeyInner resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginGetIkeSas( + String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginGetIkeSas( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginResetConnection( + String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginResetConnection( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayNatRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayNatRulesClient.java new file mode 100644 index 0000000000000..4aed5116c9455 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayNatRulesClient.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkGatewayNatRulesClient. */ +public interface VirtualNetworkGatewayNatRulesClient { + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayNatRuleInner get( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName); + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context); + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters); + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters, + Context context); + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayNatRuleInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters); + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayNatRuleInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters, + Context context); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkGatewayName, String natRuleName); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkGatewayName, String natRuleName, Context context); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayName, String natRuleName); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayName, String natRuleName, Context context); + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewaysClient.java new file mode 100644 index 0000000000000..56ca088ce6e38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewaysClient.java @@ -0,0 +1,1303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.BgpPeerStatusListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; +import com.azure.resourcemanager.network.generated.models.VpnDeviceScriptParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkGatewaysClient. */ +public interface VirtualNetworkGatewaysClient { + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters); + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + VirtualNetworkGatewayInner parameters, + Context context); + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner createOrUpdate( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters); + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + VirtualNetworkGatewayInner parameters, + Context context); + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkGatewayName); + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkGatewayName, Context context); + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayName); + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayName, Context context); + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters); + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context); + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner updateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters); + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner updateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context); + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayInner> beginReset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkGatewayInner> beginReset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginResetVpnClientSharedKey( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginResetVpnClientSharedKey( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginGeneratevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginGeneratevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginGenerateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginGenerateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, String> beginGetVpnProfilePackageUrl( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, String> beginGetVpnProfilePackageUrl( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpPeerStatusListResultInner getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpPeerStatusListResultInner getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response supportedVpnDevicesWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayRouteListResultInner getLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayRouteListResultInner getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayRouteListResultInner getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnClientIPsecParametersInner setVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnClientIPsecParametersInner setVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway 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 an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway 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 an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnClientIPsecParametersInner getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnClientIPsecParametersInner getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String vpnDeviceConfigurationScript( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response vpnDeviceConfigurationScriptWithResponse( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters, + Context context); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String startPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String stopPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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) + String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnClientConnectionHealthDetailListResultInner getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnClientConnectionHealthDetailListResultInner getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDisconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDisconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkPeeringsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkPeeringsClient.java new file mode 100644 index 0000000000000..3ce7fdc4df2f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkPeeringsClient.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.azure.resourcemanager.network.generated.models.SyncRemoteAddressSpace; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkPeeringsClient. */ +public interface VirtualNetworkPeeringsClient { + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName, Context context); + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String virtualNetworkPeeringName, Context context); + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkPeeringInner get( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context); + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace); + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context); + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace); + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters); + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualNetworkName); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String virtualNetworkName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkTapsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkTapsClient.java new file mode 100644 index 0000000000000..2f3f14544a125 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkTapsClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkTapsClient. */ +public interface VirtualNetworkTapsClient { + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 tapName); + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 tapName, Context context); + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 tapName); + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 tapName, Context context); + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName); + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String tapName, Context context); + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters); + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context); + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkTapInner createOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters); + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkTapInner createOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context); + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName, TagsObject tapParameters); + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String tapName, TagsObject tapParameters, Context context); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the VirtualNetworkTaps 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 all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworksClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworksClient.java new file mode 100644 index 0000000000000..ce7943d6e0453 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworksClient.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in VirtualNetworksClient. */ +public interface VirtualNetworksClient { + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkName); + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualNetworkName, Context context); + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName); + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, Context context); + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName); + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, String expand, Context context); + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters); + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context); + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters); + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context); + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, TagsObject parameters); + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context); + + /** + * Gets all virtual networks in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all virtual networks 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 all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpAddressAvailabilityResultInner checkIpAddressAvailability( + String resourceGroupName, String virtualNetworkName, String ipAddress); + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkIpAddressAvailabilityWithResponse( + String resourceGroupName, String virtualNetworkName, String ipAddress, Context context); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUsage(String resourceGroupName, String virtualNetworkName); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUsage( + String resourceGroupName, String virtualNetworkName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRouterPeeringsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRouterPeeringsClient.java new file mode 100644 index 0000000000000..54563a7ec01e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRouterPeeringsClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VirtualRouterPeeringInner; + +/** An instance of this class provides access to all the operations defined in VirtualRouterPeeringsClient. */ +public interface VirtualRouterPeeringsClient { + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName, String peeringName); + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName, String peeringName, Context context); + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName, String peeringName); + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName, String peeringName, Context context); + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualRouterPeeringInner get(String resourceGroupName, String virtualRouterName, String peeringName); + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualRouterName, String peeringName, Context context); + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualRouterPeeringInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters); + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualRouterPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualRouterName, + String peeringName, + VirtualRouterPeeringInner parameters, + Context context); + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualRouterPeeringInner createOrUpdate( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters); + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualRouterPeeringInner createOrUpdate( + String resourceGroupName, + String virtualRouterName, + String peeringName, + VirtualRouterPeeringInner parameters, + Context context); + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualRouterName); + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualRouterName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRoutersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRoutersClient.java new file mode 100644 index 0000000000000..4d27a47e684a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRoutersClient.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VirtualRouterInner; + +/** An instance of this class provides access to all the operations defined in VirtualRoutersClient. */ +public interface VirtualRoutersClient { + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName); + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName, Context context); + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName); + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName, Context context); + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualRouterInner getByResourceGroup(String resourceGroupName, String virtualRouterName); + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualRouterName, String expand, Context context); + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualRouterInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters); + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualRouterInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters, Context context); + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualRouterInner createOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters); + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualRouterInner createOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters, Context context); + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Virtual Routers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualWansClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualWansClient.java new file mode 100644 index 0000000000000..71d58d8034bc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualWansClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VirtualWanInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in VirtualWansClient. */ +public interface VirtualWansClient { + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualWanInner getByResourceGroup(String resourceGroupName, String virtualWanName); + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualWanName, Context context); + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualWanInner> beginCreateOrUpdate( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters); + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualWanInner> beginCreateOrUpdate( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context); + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualWanInner createOrUpdate(String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters); + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualWanInner createOrUpdate( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context); + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualWanInner updateTags(String resourceGroupName, String virtualWanName, TagsObject wanParameters); + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context); + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualWanName); + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtualWanName, Context context); + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualWanName); + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualWanName, Context context); + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnConnectionsClient.java new file mode 100644 index 0000000000000..0e3bb4ab8399c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnConnectionsClient.java @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStopParameters; + +/** An instance of this class provides access to all the operations defined in VpnConnectionsClient. */ +public interface VpnConnectionsClient { + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String gatewayName, String connectionName, Context context); + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters); + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context); + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnConnectionInner createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters); + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnConnectionInner createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 gatewayName, String connectionName); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 gatewayName, String connectionName, Context context); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, String connectionName); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, String connectionName, Context context); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String startPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String stopPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnGatewaysClient.java new file mode 100644 index 0000000000000..917e08fcd93ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnGatewaysClient.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.network.generated.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.network.generated.fluent.models.VpnGatewayInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStopParameters; + +/** An instance of this class provides access to all the operations defined in VpnGatewaysClient. */ +public interface VpnGatewaysClient { + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context); + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters); + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context); + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters); + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner createOrUpdate( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context); + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters); + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context); + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner updateTags(String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters); + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner updateTags( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context); + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 gatewayName); + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 gatewayName, Context context); + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName); + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, Context context); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnGatewayInner> beginReset(String resourceGroupName, String gatewayName); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName, Context context); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner reset(String resourceGroupName, String gatewayName); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner reset(String resourceGroupName, String gatewayName, Context context); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String startPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String startPacketCapture(String resourceGroupName, String gatewayName); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String startPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String stopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String stopPacketCapture(String resourceGroupName, String gatewayName); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context); + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnLinkConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnLinkConnectionsClient.java new file mode 100644 index 0000000000000..71988f93f07de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnLinkConnectionsClient.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; + +/** An instance of this class provides access to all the operations defined in VpnLinkConnectionsClient. */ +public interface VpnLinkConnectionsClient { + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginResetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginResetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginGetIkeSas( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, String> beginGetIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String getIkeSas(String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + String getIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsAssociatedWithVirtualWansClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsAssociatedWithVirtualWansClient.java new file mode 100644 index 0000000000000..a3fa65a637ff7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsAssociatedWithVirtualWansClient.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.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; + +/** + * An instance of this class provides access to all the operations defined in + * VpnServerConfigurationsAssociatedWithVirtualWansClient. + */ +public interface VpnServerConfigurationsAssociatedWithVirtualWansClient { + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnServerConfigurationsResponseInner> beginList( + String resourceGroupName, String virtualWanName); + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnServerConfigurationsResponseInner> beginList( + String resourceGroupName, String virtualWanName, Context context); + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationsResponseInner list(String resourceGroupName, String virtualWanName); + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationsResponseInner list(String resourceGroupName, String virtualWanName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsClient.java new file mode 100644 index 0000000000000..39c268d59c386 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsClient.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VpnServerConfigurationInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in VpnServerConfigurationsClient. */ +public interface VpnServerConfigurationsClient { + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationInner getByResourceGroup(String resourceGroupName, String vpnServerConfigurationName); + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnServerConfigurationName, Context context); + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnServerConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters); + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnServerConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters, + Context context); + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationInner createOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters); + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationInner createOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters, + Context context); + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationInner updateTags( + String resourceGroupName, String vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters); + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String vpnServerConfigurationName, + TagsObject vpnServerConfigurationParameters, + Context context); + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 vpnServerConfigurationName); + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 vpnServerConfigurationName, Context context); + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vpnServerConfigurationName); + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vpnServerConfigurationName, Context context); + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinkConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinkConnectionsClient.java new file mode 100644 index 0000000000000..c154fdfa1584d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinkConnectionsClient.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VpnSiteLinkConnectionInner; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinkConnectionsClient. */ +public interface VpnSiteLinkConnectionsClient { + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteLinkConnectionInner get( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinksClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinksClient.java new file mode 100644 index 0000000000000..37939339fe198 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinksClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VpnSiteLinkInner; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinksClient. */ +public interface VpnSiteLinksClient { + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteLinkInner get(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName); + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, Context context); + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName); + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesClient.java new file mode 100644 index 0000000000000..3d2de8fb22353 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in VpnSitesClient. */ +public interface VpnSitesClient { + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName); + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnSiteName, Context context); + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnSiteInner> beginCreateOrUpdate( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters); + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VpnSiteInner> beginCreateOrUpdate( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context); + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters); + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteInner createOrUpdate( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context); + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters); + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context); + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 vpnSiteName); + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 vpnSiteName, Context context); + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vpnSiteName); + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vpnSiteName, Context context); + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesConfigurationsClient.java new file mode 100644 index 0000000000000..41175a8c8ff8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesConfigurationsClient.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.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.models.GetVpnSitesConfigurationRequest; + +/** An instance of this class provides access to all the operations defined in VpnSitesConfigurationsClient. */ +public interface VpnSitesConfigurationsClient { + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDownload( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request); + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDownload( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context); + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void download(String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request); + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void download( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebApplicationFirewallPoliciesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebApplicationFirewallPoliciesClient.java new file mode 100644 index 0000000000000..aa0f326b9ae3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebApplicationFirewallPoliciesClient.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.WebApplicationFirewallPolicyInner; + +/** An instance of this class provides access to all the operations defined in WebApplicationFirewallPoliciesClient. */ +public interface WebApplicationFirewallPoliciesClient { + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the WAF policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the WAF policies 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 all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context); + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters); + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 policyName); + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 policyName, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 policyName); + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 policyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebCategoriesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebCategoriesClient.java new file mode 100644 index 0000000000000..00283aef26a54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebCategoriesClient.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.models.AzureWebCategoryInner; + +/** An instance of this class provides access to all the operations defined in WebCategoriesClient. */ +public interface WebCategoriesClient { + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureWebCategoryInner get(String name); + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String name, String expand, Context context); + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Azure Web Categories 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 all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsInner.java new file mode 100644 index 0000000000000..c55c193326c37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsInner.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyName; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Response for ApplicationGatewayAvailableSslOptions API service call. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayAvailableSslOptionsInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableSslOptionsInner.class); + + /* + * List of available Ssl predefined policy. + */ + @JsonProperty(value = "properties.predefinedPolicies") + private List predefinedPolicies; + + /* + * Name of the Ssl predefined policy applied by default to application + * gateway. + */ + @JsonProperty(value = "properties.defaultPolicy") + private ApplicationGatewaySslPolicyName defaultPolicy; + + /* + * List of available Ssl cipher suites. + */ + @JsonProperty(value = "properties.availableCipherSuites") + private List availableCipherSuites; + + /* + * List of available Ssl protocols. + */ + @JsonProperty(value = "properties.availableProtocols") + private List availableProtocols; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the predefinedPolicies property: List of available Ssl predefined policy. + * + * @return the predefinedPolicies value. + */ + public List predefinedPolicies() { + return this.predefinedPolicies; + } + + /** + * Set the predefinedPolicies property: List of available Ssl predefined policy. + * + * @param predefinedPolicies the predefinedPolicies value to set. + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withPredefinedPolicies(List predefinedPolicies) { + this.predefinedPolicies = predefinedPolicies; + return this; + } + + /** + * Get the defaultPolicy property: Name of the Ssl predefined policy applied by default to application gateway. + * + * @return the defaultPolicy value. + */ + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.defaultPolicy; + } + + /** + * Set the defaultPolicy property: Name of the Ssl predefined policy applied by default to application gateway. + * + * @param defaultPolicy the defaultPolicy value to set. + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withDefaultPolicy(ApplicationGatewaySslPolicyName defaultPolicy) { + this.defaultPolicy = defaultPolicy; + return this; + } + + /** + * Get the availableCipherSuites property: List of available Ssl cipher suites. + * + * @return the availableCipherSuites value. + */ + public List availableCipherSuites() { + return this.availableCipherSuites; + } + + /** + * Set the availableCipherSuites property: List of available Ssl cipher suites. + * + * @param availableCipherSuites the availableCipherSuites value to set. + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableCipherSuites( + List availableCipherSuites) { + this.availableCipherSuites = availableCipherSuites; + return this; + } + + /** + * Get the availableProtocols property: List of available Ssl protocols. + * + * @return the availableProtocols value. + */ + public List availableProtocols() { + return this.availableProtocols; + } + + /** + * Set the availableProtocols property: List of available Ssl protocols. + * + * @param availableProtocols the availableProtocols value to set. + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableProtocols( + List availableProtocols) { + this.availableProtocols = availableProtocols; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayAvailableSslOptionsInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayAvailableSslOptionsInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.java new file mode 100644 index 0000000000000..910b3a8e7bcd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRuleSet; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayAvailableWafRuleSets API service call. */ +@Fluent +public final class ApplicationGatewayAvailableWafRuleSetsResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableWafRuleSetsResultInner.class); + + /* + * The list of application gateway rule sets. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of application gateway rule sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of application gateway rule sets. + * + * @param value the value value to set. + * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object itself. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthInner.java new file mode 100644 index 0000000000000..deca8c9a4d5c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthPool; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayBackendHealth API service call. */ +@Fluent +public final class ApplicationGatewayBackendHealthInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthInner.class); + + /* + * A list of ApplicationGatewayBackendHealthPool resources. + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /** + * Get the backendAddressPools property: A list of ApplicationGatewayBackendHealthPool resources. + * + * @return the backendAddressPools value. + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools property: A list of ApplicationGatewayBackendHealthPool resources. + * + * @param backendAddressPools the backendAddressPools value to set. + * @return the ApplicationGatewayBackendHealthInner object itself. + */ + public ApplicationGatewayBackendHealthInner withBackendAddressPools( + List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendAddressPools() != null) { + backendAddressPools().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthOnDemandInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthOnDemandInner.java new file mode 100644 index 0000000000000..f8f48868f8df9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthOnDemandInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthHttpSettings; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Result of on demand test probe. */ +@Fluent +public final class ApplicationGatewayBackendHealthOnDemandInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthOnDemandInner.class); + + /* + * Reference to an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /* + * Application gateway BackendHealthHttp settings. + */ + @JsonProperty(value = "backendHealthHttpSettings") + private ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings; + + /** + * Get the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value. + */ + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayBackendHealthOnDemandInner object itself. + */ + public ApplicationGatewayBackendHealthOnDemandInner withBackendAddressPool( + ApplicationGatewayBackendAddressPool backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendHealthHttpSettings property: Application gateway BackendHealthHttp settings. + * + * @return the backendHealthHttpSettings value. + */ + public ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings() { + return this.backendHealthHttpSettings; + } + + /** + * Set the backendHealthHttpSettings property: Application gateway BackendHealthHttp settings. + * + * @param backendHealthHttpSettings the backendHealthHttpSettings value to set. + * @return the ApplicationGatewayBackendHealthOnDemandInner object itself. + */ + public ApplicationGatewayBackendHealthOnDemandInner withBackendHealthHttpSettings( + ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings) { + this.backendHealthHttpSettings = backendHealthHttpSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendAddressPool() != null) { + backendAddressPool().validate(); + } + if (backendHealthHttpSettings() != null) { + backendHealthHttpSettings().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthServerInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthServerInner.java new file mode 100644 index 0000000000000..7638cc9419068 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthServerInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthServerHealth; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application gateway backendhealth http settings. */ +@Fluent +public final class ApplicationGatewayBackendHealthServerInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthServerInner.class); + + /* + * IP address or FQDN of backend server. + */ + @JsonProperty(value = "address") + private String address; + + /* + * Reference to IP configuration of backend server. + */ + @JsonProperty(value = "ipConfiguration") + private NetworkInterfaceIpConfigurationInner ipConfiguration; + + /* + * Health of backend server. + */ + @JsonProperty(value = "health") + private ApplicationGatewayBackendHealthServerHealth health; + + /* + * Health Probe Log. + */ + @JsonProperty(value = "healthProbeLog") + private String healthProbeLog; + + /** + * Get the address property: IP address or FQDN of backend server. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: IP address or FQDN of backend server. + * + * @param address the address value to set. + * @return the ApplicationGatewayBackendHealthServerInner object itself. + */ + public ApplicationGatewayBackendHealthServerInner withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the ipConfiguration property: Reference to IP configuration of backend server. + * + * @return the ipConfiguration value. + */ + public NetworkInterfaceIpConfigurationInner ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Set the ipConfiguration property: Reference to IP configuration of backend server. + * + * @param ipConfiguration the ipConfiguration value to set. + * @return the ApplicationGatewayBackendHealthServerInner object itself. + */ + public ApplicationGatewayBackendHealthServerInner withIpConfiguration( + NetworkInterfaceIpConfigurationInner ipConfiguration) { + this.ipConfiguration = ipConfiguration; + return this; + } + + /** + * Get the health property: Health of backend server. + * + * @return the health value. + */ + public ApplicationGatewayBackendHealthServerHealth health() { + return this.health; + } + + /** + * Set the health property: Health of backend server. + * + * @param health the health value to set. + * @return the ApplicationGatewayBackendHealthServerInner object itself. + */ + public ApplicationGatewayBackendHealthServerInner withHealth(ApplicationGatewayBackendHealthServerHealth health) { + this.health = health; + return this; + } + + /** + * Get the healthProbeLog property: Health Probe Log. + * + * @return the healthProbeLog value. + */ + public String healthProbeLog() { + return this.healthProbeLog; + } + + /** + * Set the healthProbeLog property: Health Probe Log. + * + * @param healthProbeLog the healthProbeLog value to set. + * @return the ApplicationGatewayBackendHealthServerInner object itself. + */ + public ApplicationGatewayBackendHealthServerInner withHealthProbeLog(String healthProbeLog) { + this.healthProbeLog = healthProbeLog; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfiguration() != null) { + ipConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayInner.java new file mode 100644 index 0000000000000..35d04a71d50be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayInner.java @@ -0,0 +1,1065 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAuthenticationCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAutoscaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHttpSettings; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCustomError; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendPort; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOperationalState; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProbe; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRedirectConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRule; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleSet; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySku; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProfile; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedClientCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedRootCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayUrlPathMap; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Application gateway resource. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of availability zones denoting where the resource needs to come + * from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The identity of the application gateway, if configured. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * SKU of the application gateway resource. + */ + @JsonProperty(value = "properties.sku") + private ApplicationGatewaySku sku; + + /* + * SSL policy of the application gateway resource. + */ + @JsonProperty(value = "properties.sslPolicy") + private ApplicationGatewaySslPolicy sslPolicy; + + /* + * Operational state of the application gateway resource. + */ + @JsonProperty(value = "properties.operationalState", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationGatewayOperationalState operationalState; + + /* + * Subnets of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.gatewayIPConfigurations") + private List gatewayIpConfigurations; + + /* + * Authentication certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /* + * Trusted Root certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.trustedRootCertificates") + private List trustedRootCertificates; + + /* + * Trusted client certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.trustedClientCertificates") + private List trustedClientCertificates; + + /* + * SSL certificates of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.sslCertificates") + private List sslCertificates; + + /* + * Frontend IP addresses of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIpConfigurations; + + /* + * Frontend ports of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.frontendPorts") + private List frontendPorts; + + /* + * Probes of the application gateway resource. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /* + * Backend address pool of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /* + * Backend http settings of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /* + * Http listeners of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.httpListeners") + private List httpListeners; + + /* + * SSL profiles of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.sslProfiles") + private List sslProfiles; + + /* + * URL path map of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /* + * Request routing rules of the application gateway resource. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /* + * Rewrite rules for the application gateway resource. + */ + @JsonProperty(value = "properties.rewriteRuleSets") + private List rewriteRuleSets; + + /* + * Redirect configurations of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.redirectConfigurations") + private List redirectConfigurations; + + /* + * Web application firewall configuration. + */ + @JsonProperty(value = "properties.webApplicationFirewallConfiguration") + private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration; + + /* + * Reference to the FirewallPolicy resource. + */ + @JsonProperty(value = "properties.firewallPolicy") + private SubResource firewallPolicy; + + /* + * Whether HTTP2 is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableHttp2") + private Boolean enableHttp2; + + /* + * Whether FIPS is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableFips") + private Boolean enableFips; + + /* + * Autoscale Configuration. + */ + @JsonProperty(value = "properties.autoscaleConfiguration") + private ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration; + + /* + * PrivateLink configurations on application gateway. + */ + @JsonProperty(value = "properties.privateLinkConfigurations") + private List privateLinkConfigurations; + + /* + * Private Endpoint connections on application gateway. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * The resource GUID property of the application gateway resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the application gateway resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Custom error configurations of the application gateway resource. + */ + @JsonProperty(value = "properties.customErrorConfigurations") + private List customErrorConfigurations; + + /* + * If true, associates a firewall policy with an application gateway + * regardless whether the policy differs from the WAF Config. + */ + @JsonProperty(value = "properties.forceFirewallPolicyAssociation") + private Boolean forceFirewallPolicyAssociation; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @param zones the zones value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the identity property: The identity of the application gateway, if configured. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the application gateway, if configured. + * + * @param identity the identity value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: SKU of the application gateway resource. + * + * @return the sku value. + */ + public ApplicationGatewaySku sku() { + return this.sku; + } + + /** + * Set the sku property: SKU of the application gateway resource. + * + * @param sku the sku value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSku(ApplicationGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get the sslPolicy property: SSL policy of the application gateway resource. + * + * @return the sslPolicy value. + */ + public ApplicationGatewaySslPolicy sslPolicy() { + return this.sslPolicy; + } + + /** + * Set the sslPolicy property: SSL policy of the application gateway resource. + * + * @param sslPolicy the sslPolicy value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + /** + * Get the operationalState property: Operational state of the application gateway resource. + * + * @return the operationalState value. + */ + public ApplicationGatewayOperationalState operationalState() { + return this.operationalState; + } + + /** + * Get the gatewayIpConfigurations property: Subnets of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the gatewayIpConfigurations value. + */ + public List gatewayIpConfigurations() { + return this.gatewayIpConfigurations; + } + + /** + * Set the gatewayIpConfigurations property: Subnets of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param gatewayIpConfigurations the gatewayIpConfigurations value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withGatewayIpConfigurations( + List gatewayIpConfigurations) { + this.gatewayIpConfigurations = gatewayIpConfigurations; + return this; + } + + /** + * Get the authenticationCertificates property: Authentication certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the authenticationCertificates value. + */ + public List authenticationCertificates() { + return this.authenticationCertificates; + } + + /** + * Set the authenticationCertificates property: Authentication certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param authenticationCertificates the authenticationCertificates value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAuthenticationCertificates( + List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get the trustedRootCertificates property: Trusted Root certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the trustedRootCertificates value. + */ + public List trustedRootCertificates() { + return this.trustedRootCertificates; + } + + /** + * Set the trustedRootCertificates property: Trusted Root certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param trustedRootCertificates the trustedRootCertificates value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withTrustedRootCertificates( + List trustedRootCertificates) { + this.trustedRootCertificates = trustedRootCertificates; + return this; + } + + /** + * Get the trustedClientCertificates property: Trusted client certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the trustedClientCertificates value. + */ + public List trustedClientCertificates() { + return this.trustedClientCertificates; + } + + /** + * Set the trustedClientCertificates property: Trusted client certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param trustedClientCertificates the trustedClientCertificates value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withTrustedClientCertificates( + List trustedClientCertificates) { + this.trustedClientCertificates = trustedClientCertificates; + return this; + } + + /** + * Get the sslCertificates property: SSL certificates of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the sslCertificates value. + */ + public List sslCertificates() { + return this.sslCertificates; + } + + /** + * Set the sslCertificates property: SSL certificates of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param sslCertificates the sslCertificates value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslCertificates(List sslCertificates) { + this.sslCertificates = sslCertificates; + return this; + } + + /** + * Get the frontendIpConfigurations property: Frontend IP addresses of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the frontendIpConfigurations value. + */ + public List frontendIpConfigurations() { + return this.frontendIpConfigurations; + } + + /** + * Set the frontendIpConfigurations property: Frontend IP addresses of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param frontendIpConfigurations the frontendIpConfigurations value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendIpConfigurations( + List frontendIpConfigurations) { + this.frontendIpConfigurations = frontendIpConfigurations; + return this; + } + + /** + * Get the frontendPorts property: Frontend ports of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the frontendPorts value. + */ + public List frontendPorts() { + return this.frontendPorts; + } + + /** + * Set the frontendPorts property: Frontend ports of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param frontendPorts the frontendPorts value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendPorts(List frontendPorts) { + this.frontendPorts = frontendPorts; + return this; + } + + /** + * Get the probes property: Probes of the application gateway resource. + * + * @return the probes value. + */ + public List probes() { + return this.probes; + } + + /** + * Set the probes property: Probes of the application gateway resource. + * + * @param probes the probes value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get the backendAddressPools property: Backend address pool of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the backendAddressPools value. + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools property: Backend address pool of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param backendAddressPools the backendAddressPools value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendAddressPools( + List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get the backendHttpSettingsCollection property: Backend http settings of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the backendHttpSettingsCollection value. + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set the backendHttpSettingsCollection property: Backend http settings of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendHttpSettingsCollection( + List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + + /** + * Get the httpListeners property: Http listeners of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the httpListeners value. + */ + public List httpListeners() { + return this.httpListeners; + } + + /** + * Set the httpListeners property: Http listeners of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param httpListeners the httpListeners value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withHttpListeners(List httpListeners) { + this.httpListeners = httpListeners; + return this; + } + + /** + * Get the sslProfiles property: SSL profiles of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the sslProfiles value. + */ + public List sslProfiles() { + return this.sslProfiles; + } + + /** + * Set the sslProfiles property: SSL profiles of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param sslProfiles the sslProfiles value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslProfiles(List sslProfiles) { + this.sslProfiles = sslProfiles; + return this; + } + + /** + * Get the urlPathMaps property: URL path map of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the urlPathMaps value. + */ + public List urlPathMaps() { + return this.urlPathMaps; + } + + /** + * Set the urlPathMaps property: URL path map of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param urlPathMaps the urlPathMaps value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get the requestRoutingRules property: Request routing rules of the application gateway resource. + * + * @return the requestRoutingRules value. + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set the requestRoutingRules property: Request routing rules of the application gateway resource. + * + * @param requestRoutingRules the requestRoutingRules value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRequestRoutingRules( + List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get the rewriteRuleSets property: Rewrite rules for the application gateway resource. + * + * @return the rewriteRuleSets value. + */ + public List rewriteRuleSets() { + return this.rewriteRuleSets; + } + + /** + * Set the rewriteRuleSets property: Rewrite rules for the application gateway resource. + * + * @param rewriteRuleSets the rewriteRuleSets value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRewriteRuleSets(List rewriteRuleSets) { + this.rewriteRuleSets = rewriteRuleSets; + return this; + } + + /** + * Get the redirectConfigurations property: Redirect configurations of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the redirectConfigurations value. + */ + public List redirectConfigurations() { + return this.redirectConfigurations; + } + + /** + * Set the redirectConfigurations property: Redirect configurations of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param redirectConfigurations the redirectConfigurations value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRedirectConfigurations( + List redirectConfigurations) { + this.redirectConfigurations = redirectConfigurations; + return this; + } + + /** + * Get the webApplicationFirewallConfiguration property: Web application firewall configuration. + * + * @return the webApplicationFirewallConfiguration value. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.webApplicationFirewallConfiguration; + } + + /** + * Set the webApplicationFirewallConfiguration property: Web application firewall configuration. + * + * @param webApplicationFirewallConfiguration the webApplicationFirewallConfiguration value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withWebApplicationFirewallConfiguration( + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.webApplicationFirewallConfiguration = webApplicationFirewallConfiguration; + return this; + } + + /** + * Get the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @return the firewallPolicy value. + */ + public SubResource firewallPolicy() { + return this.firewallPolicy; + } + + /** + * Set the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @param firewallPolicy the firewallPolicy value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFirewallPolicy(SubResource firewallPolicy) { + this.firewallPolicy = firewallPolicy; + return this; + } + + /** + * Get the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource. + * + * @return the enableHttp2 value. + */ + public Boolean enableHttp2() { + return this.enableHttp2; + } + + /** + * Set the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource. + * + * @param enableHttp2 the enableHttp2 value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableHttp2(Boolean enableHttp2) { + this.enableHttp2 = enableHttp2; + return this; + } + + /** + * Get the enableFips property: Whether FIPS is enabled on the application gateway resource. + * + * @return the enableFips value. + */ + public Boolean enableFips() { + return this.enableFips; + } + + /** + * Set the enableFips property: Whether FIPS is enabled on the application gateway resource. + * + * @param enableFips the enableFips value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableFips(Boolean enableFips) { + this.enableFips = enableFips; + return this; + } + + /** + * Get the autoscaleConfiguration property: Autoscale Configuration. + * + * @return the autoscaleConfiguration value. + */ + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.autoscaleConfiguration; + } + + /** + * Set the autoscaleConfiguration property: Autoscale Configuration. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAutoscaleConfiguration( + ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.autoscaleConfiguration = autoscaleConfiguration; + return this; + } + + /** + * Get the privateLinkConfigurations property: PrivateLink configurations on application gateway. + * + * @return the privateLinkConfigurations value. + */ + public List privateLinkConfigurations() { + return this.privateLinkConfigurations; + } + + /** + * Set the privateLinkConfigurations property: PrivateLink configurations on application gateway. + * + * @param privateLinkConfigurations the privateLinkConfigurations value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withPrivateLinkConfigurations( + List privateLinkConfigurations) { + this.privateLinkConfigurations = privateLinkConfigurations; + return this; + } + + /** + * Get the privateEndpointConnections property: Private Endpoint connections on application gateway. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the resourceGuid property: The resource GUID property of the application gateway resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the application gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the customErrorConfigurations property: Custom error configurations of the application gateway resource. + * + * @return the customErrorConfigurations value. + */ + public List customErrorConfigurations() { + return this.customErrorConfigurations; + } + + /** + * Set the customErrorConfigurations property: Custom error configurations of the application gateway resource. + * + * @param customErrorConfigurations the customErrorConfigurations value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withCustomErrorConfigurations( + List customErrorConfigurations) { + this.customErrorConfigurations = customErrorConfigurations; + return this; + } + + /** + * Get the forceFirewallPolicyAssociation property: If true, associates a firewall policy with an application + * gateway regardless whether the policy differs from the WAF Config. + * + * @return the forceFirewallPolicyAssociation value. + */ + public Boolean forceFirewallPolicyAssociation() { + return this.forceFirewallPolicyAssociation; + } + + /** + * Set the forceFirewallPolicyAssociation property: If true, associates a firewall policy with an application + * gateway regardless whether the policy differs from the WAF Config. + * + * @param forceFirewallPolicyAssociation the forceFirewallPolicyAssociation value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withForceFirewallPolicyAssociation(Boolean forceFirewallPolicyAssociation) { + this.forceFirewallPolicyAssociation = forceFirewallPolicyAssociation; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (sslPolicy() != null) { + sslPolicy().validate(); + } + if (gatewayIpConfigurations() != null) { + gatewayIpConfigurations().forEach(e -> e.validate()); + } + if (authenticationCertificates() != null) { + authenticationCertificates().forEach(e -> e.validate()); + } + if (trustedRootCertificates() != null) { + trustedRootCertificates().forEach(e -> e.validate()); + } + if (trustedClientCertificates() != null) { + trustedClientCertificates().forEach(e -> e.validate()); + } + if (sslCertificates() != null) { + sslCertificates().forEach(e -> e.validate()); + } + if (frontendIpConfigurations() != null) { + frontendIpConfigurations().forEach(e -> e.validate()); + } + if (frontendPorts() != null) { + frontendPorts().forEach(e -> e.validate()); + } + if (probes() != null) { + probes().forEach(e -> e.validate()); + } + if (backendAddressPools() != null) { + backendAddressPools().forEach(e -> e.validate()); + } + if (backendHttpSettingsCollection() != null) { + backendHttpSettingsCollection().forEach(e -> e.validate()); + } + if (httpListeners() != null) { + httpListeners().forEach(e -> e.validate()); + } + if (sslProfiles() != null) { + sslProfiles().forEach(e -> e.validate()); + } + if (urlPathMaps() != null) { + urlPathMaps().forEach(e -> e.validate()); + } + if (requestRoutingRules() != null) { + requestRoutingRules().forEach(e -> e.validate()); + } + if (rewriteRuleSets() != null) { + rewriteRuleSets().forEach(e -> e.validate()); + } + if (redirectConfigurations() != null) { + redirectConfigurations().forEach(e -> e.validate()); + } + if (webApplicationFirewallConfiguration() != null) { + webApplicationFirewallConfiguration().validate(); + } + if (autoscaleConfiguration() != null) { + autoscaleConfiguration().validate(); + } + if (privateLinkConfigurations() != null) { + privateLinkConfigurations().forEach(e -> e.validate()); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (customErrorConfigurations() != null) { + customErrorConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..16e6557dd5fb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionInner.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private Endpoint connection on an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayPrivateEndpointConnectionInner extends SubResource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateEndpointConnectionInner.class); + + /* + * Name of the private endpoint connection on an application gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The resource of private end point. + */ + @JsonProperty(value = "properties.privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointInner privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the application gateway private endpoint + * connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The consumer link id. + */ + @JsonProperty(value = "properties.linkIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String linkIdentifier; + + /** + * Get the name property: Name of the private endpoint connection on an application gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the private endpoint connection on an application gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayPrivateEndpointConnectionInner object itself. + */ + public ApplicationGatewayPrivateEndpointConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointInner privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the ApplicationGatewayPrivateEndpointConnectionInner object itself. + */ + public ApplicationGatewayPrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the application gateway private endpoint connection + * resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the linkIdentifier property: The consumer link id. + * + * @return the linkIdentifier value. + */ + public String linkIdentifier() { + return this.linkIdentifier; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayPrivateEndpointConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceInner.java new file mode 100644 index 0000000000000..12293ddc47738 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceInner.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateLink Resource of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayPrivateLinkResourceInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkResourceInner.class); + + /* + * Name of the private link resource that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Group identifier of private link resource. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * Required member names of private link resource. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * Required DNS zone names of the the private link resource. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the name property: Name of the private link resource that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the private link resource that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayPrivateLinkResourceInner object itself. + */ + public ApplicationGatewayPrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the groupId property: Group identifier of private link resource. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: Required member names of private link resource. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the ApplicationGatewayPrivateLinkResourceInner object itself. + */ + public ApplicationGatewayPrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayPrivateLinkResourceInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyInner.java new file mode 100644 index 0000000000000..bca35450238fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyInner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An Ssl predefined policy. */ +@JsonFlatten +@Fluent +public class ApplicationGatewaySslPredefinedPolicyInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslPredefinedPolicyInner.class); + + /* + * Name of the Ssl predefined policy. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Ssl cipher suites to be enabled in the specified order for application + * gateway. + */ + @JsonProperty(value = "properties.cipherSuites") + private List cipherSuites; + + /* + * Minimum version of Ssl protocol to be supported on application gateway. + */ + @JsonProperty(value = "properties.minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get the name property: Name of the Ssl predefined policy. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Ssl predefined policy. + * + * @param name the name value to set. + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the cipherSuites property: Ssl cipher suites to be enabled in the specified order for application gateway. + * + * @return the cipherSuites value. + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set the cipherSuites property: Ssl cipher suites to be enabled in the specified order for application gateway. + * + * @param cipherSuites the cipherSuites value to set. + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withCipherSuites( + List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. + * + * @return the minProtocolVersion value. + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. + * + * @param minProtocolVersion the minProtocolVersion value to set. + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withMinProtocolVersion( + ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewaySslPredefinedPolicyInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupInner.java new file mode 100644 index 0000000000000..039dc363e5cae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupInner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An application security group in a resource group. */ +@JsonFlatten +@Fluent +public class ApplicationSecurityGroupInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The resource GUID property of the application security group resource. + * It uniquely identifies a resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the application security group resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the resourceGuid property: The resource GUID property of the application security group resource. It uniquely + * identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource + * groups. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the application security group resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ApplicationSecurityGroupInner object itself. + */ + public ApplicationSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationSecurityGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationSecurityGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AutoApprovedPrivateLinkServiceInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AutoApprovedPrivateLinkServiceInner.java new file mode 100644 index 0000000000000..3f47bd25d1e95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AutoApprovedPrivateLinkServiceInner.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.network.generated.fluent.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 information of an AutoApprovedPrivateLinkService. */ +@Fluent +public final class AutoApprovedPrivateLinkServiceInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoApprovedPrivateLinkServiceInner.class); + + /* + * The id of the private link service resource. + */ + @JsonProperty(value = "privateLinkService") + private String privateLinkService; + + /** + * Get the privateLinkService property: The id of the private link service resource. + * + * @return the privateLinkService value. + */ + public String privateLinkService() { + return this.privateLinkService; + } + + /** + * Set the privateLinkService property: The id of the private link service resource. + * + * @param privateLinkService the privateLinkService value to set. + * @return the AutoApprovedPrivateLinkServiceInner object itself. + */ + public AutoApprovedPrivateLinkServiceInner withPrivateLinkService(String privateLinkService) { + this.privateLinkService = privateLinkService; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableDelegationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableDelegationInner.java new file mode 100644 index 0000000000000..33a8e5f3ae2e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableDelegationInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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 serviceName of an AvailableDelegation indicates a possible delegation for a subnet. */ +@Fluent +public final class AvailableDelegationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableDelegationInner.class); + + /* + * The name of the AvailableDelegation resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique identifier of the AvailableDelegation resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The name of the service and resource. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /* + * The actions permitted to the service upon delegation. + */ + @JsonProperty(value = "actions") + private List actions; + + /** + * Get the name property: The name of the AvailableDelegation resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the AvailableDelegation resource. + * + * @param name the name value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: A unique identifier of the AvailableDelegation resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: A unique identifier of the AvailableDelegation resource. + * + * @param id the id value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. + * + * @param type the type value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the serviceName property: The name of the service and resource. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the service and resource. + * + * @param serviceName the serviceName value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the actions property: The actions permitted to the service upon delegation. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The actions permitted to the service upon delegation. + * + * @param actions the actions value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailablePrivateEndpointTypeInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailablePrivateEndpointTypeInner.java new file mode 100644 index 0000000000000..82e529a2cb5d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailablePrivateEndpointTypeInner.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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 information of an AvailablePrivateEndpointType. */ +@Fluent +public final class AvailablePrivateEndpointTypeInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailablePrivateEndpointTypeInner.class); + + /* + * The name of the service and resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique identifier of the AvailablePrivateEndpoint Type resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The name of the service and resource. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * Display name of the resource. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name property: The name of the service and resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the service and resource. + * + * @param name the name value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: A unique identifier of the AvailablePrivateEndpoint Type resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: A unique identifier of the AvailablePrivateEndpoint Type resource. + * + * @param id the id value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. + * + * @param type the type value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the resourceName property: The name of the service and resource. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The name of the service and resource. + * + * @param resourceName the resourceName value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the displayName property: Display name of the resource. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the resource. + * + * @param displayName the displayName value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableProvidersListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableProvidersListInner.java new file mode 100644 index 0000000000000..7bd38c8e686fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableProvidersListInner.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListCountry; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of available countries with details. */ +@Fluent +public final class AvailableProvidersListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListInner.class); + + /* + * List of available countries. + */ + @JsonProperty(value = "countries", required = true) + private List countries; + + /** + * Get the countries property: List of available countries. + * + * @return the countries value. + */ + public List countries() { + return this.countries; + } + + /** + * Set the countries property: List of available countries. + * + * @param countries the countries value to set. + * @return the AvailableProvidersListInner object itself. + */ + public AvailableProvidersListInner withCountries(List countries) { + this.countries = countries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (countries() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property countries in model AvailableProvidersListInner")); + } else { + countries().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableServiceAliasInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableServiceAliasInner.java new file mode 100644 index 0000000000000..df22447ee1e3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableServiceAliasInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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 available service alias. */ +@Fluent +public final class AvailableServiceAliasInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceAliasInner.class); + + /* + * The name of the service alias. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the service alias. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The resource name of the service alias. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /** + * Get the name property: The name of the service alias. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the service alias. + * + * @param name the name value to set. + * @return the AvailableServiceAliasInner object itself. + */ + public AvailableServiceAliasInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: The ID of the service alias. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the service alias. + * + * @param id the id value to set. + * @return the AvailableServiceAliasInner object itself. + */ + public AvailableServiceAliasInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the resource. + * + * @param type the type value to set. + * @return the AvailableServiceAliasInner object itself. + */ + public AvailableServiceAliasInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the resourceName property: The resource name of the service alias. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The resource name of the service alias. + * + * @param resourceName the resourceName value to set. + * @return the AvailableServiceAliasInner object itself. + */ + public AvailableServiceAliasInner withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagInner.java new file mode 100644 index 0000000000000..1dae1cf30a78c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Azure Firewall FQDN Tag Resource. */ +@JsonFlatten +@Fluent +public class AzureFirewallFqdnTagInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The provisioning state of the Azure firewall FQDN tag resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The name of this FQDN Tag. + */ + @JsonProperty(value = "properties.fqdnTagName", access = JsonProperty.Access.WRITE_ONLY) + private String fqdnTagName; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioningState property: The provisioning state of the Azure firewall FQDN tag resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the fqdnTagName property: The name of this FQDN Tag. + * + * @return the fqdnTagName value. + */ + public String fqdnTagName() { + return this.fqdnTagName; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the AzureFirewallFqdnTagInner object itself. + */ + public AzureFirewallFqdnTagInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFirewallFqdnTagInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFirewallFqdnTagInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallInner.java new file mode 100644 index 0000000000000..9c6dd534bde6a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallInner.java @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpGroups; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure Firewall resource. */ +@JsonFlatten +@Fluent +public class AzureFirewallInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallInner.class); + + /* + * A list of availability zones denoting where the resource needs to come + * from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Collection of application rule collections used by Azure Firewall. + */ + @JsonProperty(value = "properties.applicationRuleCollections") + private List applicationRuleCollections; + + /* + * Collection of NAT rule collections used by Azure Firewall. + */ + @JsonProperty(value = "properties.natRuleCollections") + private List natRuleCollections; + + /* + * Collection of network rule collections used by Azure Firewall. + */ + @JsonProperty(value = "properties.networkRuleCollections") + private List networkRuleCollections; + + /* + * IP configuration of the Azure Firewall resource. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * IP configuration of the Azure Firewall used for management traffic. + */ + @JsonProperty(value = "properties.managementIpConfiguration") + private AzureFirewallIpConfiguration managementIpConfiguration; + + /* + * The provisioning state of the Azure firewall resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The operation mode for Threat Intelligence. + */ + @JsonProperty(value = "properties.threatIntelMode") + private AzureFirewallThreatIntelMode threatIntelMode; + + /* + * The virtualHub to which the firewall belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /* + * The firewallPolicy associated with this azure firewall. + */ + @JsonProperty(value = "properties.firewallPolicy") + private SubResource firewallPolicy; + + /* + * IP addresses associated with AzureFirewall. + */ + @JsonProperty(value = "properties.hubIPAddresses") + private HubIpAddresses hubIpAddresses; + + /* + * IpGroups associated with AzureFirewall. + */ + @JsonProperty(value = "properties.ipGroups", access = JsonProperty.Access.WRITE_ONLY) + private List ipGroups; + + /* + * The Azure Firewall Resource SKU. + */ + @JsonProperty(value = "properties.sku") + private AzureFirewallSku sku; + + /* + * The additional properties used to further config this azure firewall. + */ + @JsonProperty(value = "properties.additionalProperties") + private Map additionalProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @param zones the zones value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the applicationRuleCollections property: Collection of application rule collections used by Azure Firewall. + * + * @return the applicationRuleCollections value. + */ + public List applicationRuleCollections() { + return this.applicationRuleCollections; + } + + /** + * Set the applicationRuleCollections property: Collection of application rule collections used by Azure Firewall. + * + * @param applicationRuleCollections the applicationRuleCollections value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withApplicationRuleCollections( + List applicationRuleCollections) { + this.applicationRuleCollections = applicationRuleCollections; + return this; + } + + /** + * Get the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall. + * + * @return the natRuleCollections value. + */ + public List natRuleCollections() { + return this.natRuleCollections; + } + + /** + * Set the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall. + * + * @param natRuleCollections the natRuleCollections value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withNatRuleCollections(List natRuleCollections) { + this.natRuleCollections = natRuleCollections; + return this; + } + + /** + * Get the networkRuleCollections property: Collection of network rule collections used by Azure Firewall. + * + * @return the networkRuleCollections value. + */ + public List networkRuleCollections() { + return this.networkRuleCollections; + } + + /** + * Set the networkRuleCollections property: Collection of network rule collections used by Azure Firewall. + * + * @param networkRuleCollections the networkRuleCollections value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withNetworkRuleCollections( + List networkRuleCollections) { + this.networkRuleCollections = networkRuleCollections; + return this; + } + + /** + * Get the ipConfigurations property: IP configuration of the Azure Firewall resource. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: IP configuration of the Azure Firewall resource. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the managementIpConfiguration property: IP configuration of the Azure Firewall used for management traffic. + * + * @return the managementIpConfiguration value. + */ + public AzureFirewallIpConfiguration managementIpConfiguration() { + return this.managementIpConfiguration; + } + + /** + * Set the managementIpConfiguration property: IP configuration of the Azure Firewall used for management traffic. + * + * @param managementIpConfiguration the managementIpConfiguration value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withManagementIpConfiguration(AzureFirewallIpConfiguration managementIpConfiguration) { + this.managementIpConfiguration = managementIpConfiguration; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Azure firewall resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @return the threatIntelMode value. + */ + public AzureFirewallThreatIntelMode threatIntelMode() { + return this.threatIntelMode; + } + + /** + * Set the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @param threatIntelMode the threatIntelMode value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { + this.threatIntelMode = threatIntelMode; + return this; + } + + /** + * Get the virtualHub property: The virtualHub to which the firewall belongs. + * + * @return the virtualHub value. + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the virtualHub property: The virtualHub to which the firewall belongs. + * + * @param virtualHub the virtualHub value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get the firewallPolicy property: The firewallPolicy associated with this azure firewall. + * + * @return the firewallPolicy value. + */ + public SubResource firewallPolicy() { + return this.firewallPolicy; + } + + /** + * Set the firewallPolicy property: The firewallPolicy associated with this azure firewall. + * + * @param firewallPolicy the firewallPolicy value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withFirewallPolicy(SubResource firewallPolicy) { + this.firewallPolicy = firewallPolicy; + return this; + } + + /** + * Get the hubIpAddresses property: IP addresses associated with AzureFirewall. + * + * @return the hubIpAddresses value. + */ + public HubIpAddresses hubIpAddresses() { + return this.hubIpAddresses; + } + + /** + * Set the hubIpAddresses property: IP addresses associated with AzureFirewall. + * + * @param hubIpAddresses the hubIpAddresses value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withHubIpAddresses(HubIpAddresses hubIpAddresses) { + this.hubIpAddresses = hubIpAddresses; + return this; + } + + /** + * Get the ipGroups property: IpGroups associated with AzureFirewall. + * + * @return the ipGroups value. + */ + public List ipGroups() { + return this.ipGroups; + } + + /** + * Get the sku property: The Azure Firewall Resource SKU. + * + * @return the sku value. + */ + public AzureFirewallSku sku() { + return this.sku; + } + + /** + * Set the sku property: The Azure Firewall Resource SKU. + * + * @param sku the sku value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withSku(AzureFirewallSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the additionalProperties property: The additional properties used to further config this azure firewall. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: The additional properties used to further config this azure firewall. + * + * @param additionalProperties the additionalProperties value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFirewallInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFirewallInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationRuleCollections() != null) { + applicationRuleCollections().forEach(e -> e.validate()); + } + if (natRuleCollections() != null) { + natRuleCollections().forEach(e -> e.validate()); + } + if (networkRuleCollections() != null) { + networkRuleCollections().forEach(e -> e.validate()); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (managementIpConfiguration() != null) { + managementIpConfiguration().validate(); + } + if (hubIpAddresses() != null) { + hubIpAddresses().validate(); + } + if (ipGroups() != null) { + ipGroups().forEach(e -> e.validate()); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureReachabilityReportInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureReachabilityReportInner.java new file mode 100644 index 0000000000000..0d38d04ae2a66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureReachabilityReportInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportItem; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure reachability report details. */ +@Fluent +public final class AzureReachabilityReportInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportInner.class); + + /* + * The aggregation level of Azure reachability report. Can be Country, + * State or City. + */ + @JsonProperty(value = "aggregationLevel", required = true) + private String aggregationLevel; + + /* + * Parameters that define a geographic location. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /* + * List of Azure reachability report items. + */ + @JsonProperty(value = "reachabilityReport", required = true) + private List reachabilityReport; + + /** + * Get the aggregationLevel property: The aggregation level of Azure reachability report. Can be Country, State or + * City. + * + * @return the aggregationLevel value. + */ + public String aggregationLevel() { + return this.aggregationLevel; + } + + /** + * Set the aggregationLevel property: The aggregation level of Azure reachability report. Can be Country, State or + * City. + * + * @param aggregationLevel the aggregationLevel value to set. + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withAggregationLevel(String aggregationLevel) { + this.aggregationLevel = aggregationLevel; + return this; + } + + /** + * Get the providerLocation property: Parameters that define a geographic location. + * + * @return the providerLocation value. + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation property: Parameters that define a geographic location. + * + * @param providerLocation the providerLocation value to set. + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get the reachabilityReport property: List of Azure reachability report items. + * + * @return the reachabilityReport value. + */ + public List reachabilityReport() { + return this.reachabilityReport; + } + + /** + * Set the reachabilityReport property: List of Azure reachability report items. + * + * @param reachabilityReport the reachabilityReport value to set. + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withReachabilityReport(List reachabilityReport) { + this.reachabilityReport = reachabilityReport; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aggregationLevel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property aggregationLevel in model AzureReachabilityReportInner")); + } + if (providerLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerLocation in model AzureReachabilityReportInner")); + } else { + providerLocation().validate(); + } + if (reachabilityReport() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property reachabilityReport in model AzureReachabilityReportInner")); + } else { + reachabilityReport().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryInner.java new file mode 100644 index 0000000000000..1d6675caa0f95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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; + +/** Azure Web Category Resource. */ +@JsonFlatten +@Fluent +public class AzureWebCategoryInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWebCategoryInner.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The name of the group that the category belongs to. + */ + @JsonProperty(value = "properties.group", access = JsonProperty.Access.WRITE_ONLY) + private String group; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the AzureWebCategoryInner object itself. + */ + public AzureWebCategoryInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the group property: The name of the group that the category belongs to. + * + * @return the group value. + */ + public String group() { + return this.group; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolInner.java new file mode 100644 index 0000000000000..8937462a55f7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolInner.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pool of backend IP addresses. */ +@JsonFlatten +@Fluent +public class BackendAddressPoolInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendAddressPoolInner.class); + + /* + * The name of the resource that is unique within the set of backend + * address pools used by the load balancer. This name can be used to access + * the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The location of the backend address pool. + */ + @JsonProperty(value = "properties.location") + private String location; + + /* + * An array of gateway load balancer tunnel interfaces. + */ + @JsonProperty(value = "properties.tunnelInterfaces") + private List tunnelInterfaces; + + /* + * An array of backend addresses. + */ + @JsonProperty(value = "properties.loadBalancerBackendAddresses") + private List loadBalancerBackendAddresses; + + /* + * An array of references to IP addresses defined in network interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List backendIpConfigurations; + + /* + * An array of references to load balancing rules that use this backend + * address pool. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /* + * A reference to an outbound rule that uses this backend address pool. + */ + @JsonProperty(value = "properties.outboundRule", access = JsonProperty.Access.WRITE_ONLY) + private SubResource outboundRule; + + /* + * An array of references to outbound rules that use this backend address + * pool. + */ + @JsonProperty(value = "properties.outboundRules", access = JsonProperty.Access.WRITE_ONLY) + private List outboundRules; + + /* + * The provisioning state of the backend address pool resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within the set of backend address pools used by + * the load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the set of backend address pools used by + * the load balancer. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: The location of the backend address pool. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the backend address pool. + * + * @param location the location value to set. + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tunnelInterfaces property: An array of gateway load balancer tunnel interfaces. + * + * @return the tunnelInterfaces value. + */ + public List tunnelInterfaces() { + return this.tunnelInterfaces; + } + + /** + * Set the tunnelInterfaces property: An array of gateway load balancer tunnel interfaces. + * + * @param tunnelInterfaces the tunnelInterfaces value to set. + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withTunnelInterfaces(List tunnelInterfaces) { + this.tunnelInterfaces = tunnelInterfaces; + return this; + } + + /** + * Get the loadBalancerBackendAddresses property: An array of backend addresses. + * + * @return the loadBalancerBackendAddresses value. + */ + public List loadBalancerBackendAddresses() { + return this.loadBalancerBackendAddresses; + } + + /** + * Set the loadBalancerBackendAddresses property: An array of backend addresses. + * + * @param loadBalancerBackendAddresses the loadBalancerBackendAddresses value to set. + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withLoadBalancerBackendAddresses( + List loadBalancerBackendAddresses) { + this.loadBalancerBackendAddresses = loadBalancerBackendAddresses; + return this; + } + + /** + * Get the backendIpConfigurations property: An array of references to IP addresses defined in network interfaces. + * + * @return the backendIpConfigurations value. + */ + public List backendIpConfigurations() { + return this.backendIpConfigurations; + } + + /** + * Get the loadBalancingRules property: An array of references to load balancing rules that use this backend address + * pool. + * + * @return the loadBalancingRules value. + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the outboundRule property: A reference to an outbound rule that uses this backend address pool. + * + * @return the outboundRule value. + */ + public SubResource outboundRule() { + return this.outboundRule; + } + + /** + * Get the outboundRules property: An array of references to outbound rules that use this backend address pool. + * + * @return the outboundRules value. + */ + public List outboundRules() { + return this.outboundRules; + } + + /** + * Get the provisioningState property: The provisioning state of the backend address pool resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public BackendAddressPoolInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tunnelInterfaces() != null) { + tunnelInterfaces().forEach(e -> e.validate()); + } + if (loadBalancerBackendAddresses() != null) { + loadBalancerBackendAddresses().forEach(e -> e.validate()); + } + if (backendIpConfigurations() != null) { + backendIpConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionActiveSessionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionActiveSessionInner.java new file mode 100644 index 0000000000000..5c81812ffcb72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionActiveSessionInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BastionConnectProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The session detail for a target. */ +@Immutable +public final class BastionActiveSessionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionActiveSessionInner.class); + + /* + * A unique id for the session. + */ + @JsonProperty(value = "sessionId", access = JsonProperty.Access.WRITE_ONLY) + private String sessionId; + + /* + * The time when the session started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private Object startTime; + + /* + * The subscription id for the target virtual machine. + */ + @JsonProperty(value = "targetSubscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String targetSubscriptionId; + + /* + * The type of the resource. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The host name of the target. + */ + @JsonProperty(value = "targetHostName", access = JsonProperty.Access.WRITE_ONLY) + private String targetHostname; + + /* + * The resource group of the target. + */ + @JsonProperty(value = "targetResourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceGroup; + + /* + * The user name who is active on this session. + */ + @JsonProperty(value = "userName", access = JsonProperty.Access.WRITE_ONLY) + private String username; + + /* + * The IP Address of the target. + */ + @JsonProperty(value = "targetIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String targetIpAddress; + + /* + * The protocol used to connect to the target. + */ + @JsonProperty(value = "protocol", access = JsonProperty.Access.WRITE_ONLY) + private BastionConnectProtocol protocol; + + /* + * The resource id of the target. + */ + @JsonProperty(value = "targetResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceId; + + /* + * Duration in mins the session has been active. + */ + @JsonProperty(value = "sessionDurationInMins", access = JsonProperty.Access.WRITE_ONLY) + private Float sessionDurationInMins; + + /** + * Get the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Get the startTime property: The time when the session started. + * + * @return the startTime value. + */ + public Object startTime() { + return this.startTime; + } + + /** + * Get the targetSubscriptionId property: The subscription id for the target virtual machine. + * + * @return the targetSubscriptionId value. + */ + public String targetSubscriptionId() { + return this.targetSubscriptionId; + } + + /** + * Get the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the targetHostname property: The host name of the target. + * + * @return the targetHostname value. + */ + public String targetHostname() { + return this.targetHostname; + } + + /** + * Get the targetResourceGroup property: The resource group of the target. + * + * @return the targetResourceGroup value. + */ + public String targetResourceGroup() { + return this.targetResourceGroup; + } + + /** + * Get the username property: The user name who is active on this session. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Get the targetIpAddress property: The IP Address of the target. + * + * @return the targetIpAddress value. + */ + public String targetIpAddress() { + return this.targetIpAddress; + } + + /** + * Get the protocol property: The protocol used to connect to the target. + * + * @return the protocol value. + */ + public BastionConnectProtocol protocol() { + return this.protocol; + } + + /** + * Get the targetResourceId property: The resource id of the target. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Get the sessionDurationInMins property: Duration in mins the session has been active. + * + * @return the sessionDurationInMins value. + */ + public Float sessionDurationInMins() { + return this.sessionDurationInMins; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostInner.java new file mode 100644 index 0000000000000..abe9112ae80a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostInner.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Bastion Host resource. */ +@JsonFlatten +@Fluent +public class BastionHostInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The sku of this Bastion Host. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * IP configuration of the Bastion Host resource. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * FQDN for the endpoint on which bastion host is accessible. + */ + @JsonProperty(value = "properties.dnsName") + private String dnsName; + + /* + * The provisioning state of the bastion host resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the sku property: The sku of this Bastion Host. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku of this Bastion Host. + * + * @param sku the sku value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the ipConfigurations property: IP configuration of the Bastion Host resource. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: IP configuration of the Bastion Host resource. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the dnsName property: FQDN for the endpoint on which bastion host is accessible. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.dnsName; + } + + /** + * Set the dnsName property: FQDN for the endpoint on which bastion host is accessible. + * + * @param dnsName the dnsName value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withDnsName(String dnsName) { + this.dnsName = dnsName; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the bastion host resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public BastionHostInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BastionHostInner 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) { + sku().validate(); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionSessionStateInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionSessionStateInner.java new file mode 100644 index 0000000000000..99a62e938cda8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionSessionStateInner.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.network.generated.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; + +/** The session state detail for a target. */ +@Immutable +public final class BastionSessionStateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionSessionStateInner.class); + + /* + * A unique id for the session. + */ + @JsonProperty(value = "sessionId", access = JsonProperty.Access.WRITE_ONLY) + private String sessionId; + + /* + * Used for extra information. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The state of the session. Disconnected/Failed/NotFound. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Get the message property: Used for extra information. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the state property: The state of the session. Disconnected/Failed/NotFound. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionShareableLinkInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionShareableLinkInner.java new file mode 100644 index 0000000000000..90f6177165d0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionShareableLinkInner.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.VM; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Bastion Shareable Link. */ +@Fluent +public final class BastionShareableLinkInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionShareableLinkInner.class); + + /* + * Reference of the virtual machine resource. + */ + @JsonProperty(value = "vm", required = true) + private VM vm; + + /* + * The unique Bastion Shareable Link to the virtual machine. + */ + @JsonProperty(value = "bsl", access = JsonProperty.Access.WRITE_ONLY) + private String bsl; + + /* + * The time when the link was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private String createdAt; + + /* + * Optional field indicating the warning or error message related to the vm + * in case of partial failure. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the vm property: Reference of the virtual machine resource. + * + * @return the vm value. + */ + public VM vm() { + return this.vm; + } + + /** + * Set the vm property: Reference of the virtual machine resource. + * + * @param vm the vm value to set. + * @return the BastionShareableLinkInner object itself. + */ + public BastionShareableLinkInner withVm(VM vm) { + this.vm = vm; + return this; + } + + /** + * Get the bsl property: The unique Bastion Shareable Link to the virtual machine. + * + * @return the bsl value. + */ + public String bsl() { + return this.bsl; + } + + /** + * Get the createdAt property: The time when the link was created. + * + * @return the createdAt value. + */ + public String createdAt() { + return this.createdAt; + } + + /** + * Get the message property: Optional field indicating the warning or error message related to the vm in case of + * partial failure. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vm() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property vm in model BastionShareableLinkInner")); + } else { + vm().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionInner.java new file mode 100644 index 0000000000000..b4d4665262846 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionInner.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.HubBgpConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Appliance Site resource. */ +@JsonFlatten +@Fluent +public class BgpConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpConnectionInner.class); + + /* + * Name of the connection. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Connection type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Peer ASN. + */ + @JsonProperty(value = "properties.peerAsn") + private Long peerAsn; + + /* + * Peer IP. + */ + @JsonProperty(value = "properties.peerIp") + private String peerIp; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The current state of the VirtualHub to Peer. + */ + @JsonProperty(value = "properties.connectionState", access = JsonProperty.Access.WRITE_ONLY) + private HubBgpConnectionStatus connectionState; + + /** + * Get the name property: Name of the connection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the connection. + * + * @param name the name value to set. + * @return the BgpConnectionInner object itself. + */ + public BgpConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Connection type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the peerAsn property: Peer ASN. + * + * @return the peerAsn value. + */ + public Long peerAsn() { + return this.peerAsn; + } + + /** + * Set the peerAsn property: Peer ASN. + * + * @param peerAsn the peerAsn value to set. + * @return the BgpConnectionInner object itself. + */ + public BgpConnectionInner withPeerAsn(Long peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + /** + * Get the peerIp property: Peer IP. + * + * @return the peerIp value. + */ + public String peerIp() { + return this.peerIp; + } + + /** + * Set the peerIp property: Peer IP. + * + * @param peerIp the peerIp value to set. + * @return the BgpConnectionInner object itself. + */ + public BgpConnectionInner withPeerIp(String peerIp) { + this.peerIp = peerIp; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the connectionState property: The current state of the VirtualHub to Peer. + * + * @return the connectionState value. + */ + public HubBgpConnectionStatus connectionState() { + return this.connectionState; + } + + /** {@inheritDoc} */ + @Override + public BgpConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpPeerStatusListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpPeerStatusListResultInner.java new file mode 100644 index 0000000000000..71c63fe7c9fdb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpPeerStatusListResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list BGP peer status API service call. */ +@Fluent +public final class BgpPeerStatusListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpPeerStatusListResultInner.class); + + /* + * List of BGP peers. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of BGP peers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of BGP peers. + * + * @param value the value value to set. + * @return the BgpPeerStatusListResultInner object itself. + */ + public BgpPeerStatusListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityInner.java new file mode 100644 index 0000000000000..d2eb9feffab7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityInner.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.network.generated.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.network.generated.models.BgpCommunity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Service Community Properties. */ +@JsonFlatten +@Fluent +public class BgpServiceCommunityInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunityInner.class); + + /* + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "properties.serviceName") + private String serviceName; + + /* + * A list of bgp communities. + */ + @JsonProperty(value = "properties.bgpCommunities") + private List bgpCommunities; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the serviceName property: The name of the bgp community. e.g. Skype. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the bgp community. e.g. Skype. + * + * @param serviceName the serviceName value to set. + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the bgpCommunities property: A list of bgp communities. + * + * @return the bgpCommunities value. + */ + public List bgpCommunities() { + return this.bgpCommunities; + } + + /** + * Set the bgpCommunities property: A list of bgp communities. + * + * @param bgpCommunities the bgpCommunities value to set. + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withBgpCommunities(List bgpCommunities) { + this.bgpCommunities = bgpCommunities; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public BgpServiceCommunityInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BgpServiceCommunityInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bgpCommunities() != null) { + bgpCommunities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorQueryResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorQueryResultInner.java new file mode 100644 index 0000000000000..9a06fa9337062 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorQueryResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSourceStatus; +import com.azure.resourcemanager.network.generated.models.ConnectionStateSnapshot; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of connection states snapshots. */ +@Fluent +public final class ConnectionMonitorQueryResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorQueryResultInner.class); + + /* + * Status of connection monitor source. + */ + @JsonProperty(value = "sourceStatus") + private ConnectionMonitorSourceStatus sourceStatus; + + /* + * Information about connection states. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get the sourceStatus property: Status of connection monitor source. + * + * @return the sourceStatus value. + */ + public ConnectionMonitorSourceStatus sourceStatus() { + return this.sourceStatus; + } + + /** + * Set the sourceStatus property: Status of connection monitor source. + * + * @param sourceStatus the sourceStatus value to set. + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withSourceStatus(ConnectionMonitorSourceStatus sourceStatus) { + this.sourceStatus = sourceStatus; + return this; + } + + /** + * Get the states property: Information about connection states. + * + * @return the states value. + */ + public List states() { + return this.states; + } + + /** + * Set the states property: Information about connection states. + * + * @param states the states value to set. + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withStates(List states) { + this.states = states; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (states() != null) { + states().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultInner.java new file mode 100644 index 0000000000000..fa9fbd489dc2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultInner.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ConnectionMonitorDestination; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorOutput; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSource; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Information about the connection monitor. */ +@JsonFlatten +@Fluent +public class ConnectionMonitorResultInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorResultInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Describes the source of connection monitor. + */ + @JsonProperty(value = "properties.source") + private ConnectionMonitorSource source; + + /* + * Describes the destination of connection monitor. + */ + @JsonProperty(value = "properties.destination") + private ConnectionMonitorDestination destination; + + /* + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /* + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /* + * List of connection monitor endpoints. + */ + @JsonProperty(value = "properties.endpoints") + private List endpoints; + + /* + * List of connection monitor test configurations. + */ + @JsonProperty(value = "properties.testConfigurations") + private List testConfigurations; + + /* + * List of connection monitor test groups. + */ + @JsonProperty(value = "properties.testGroups") + private List testGroups; + + /* + * List of connection monitor outputs. + */ + @JsonProperty(value = "properties.outputs") + private List outputs; + + /* + * Optional notes to be associated with the connection monitor. + */ + @JsonProperty(value = "properties.notes") + private String notes; + + /* + * The provisioning state of the connection monitor. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The date and time when the connection monitor was started. + */ + @JsonProperty(value = "properties.startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The monitoring status of the connection monitor. + */ + @JsonProperty(value = "properties.monitoringStatus", access = JsonProperty.Access.WRITE_ONLY) + private String monitoringStatus; + + /* + * Type of connection monitor. + */ + @JsonProperty(value = "properties.connectionMonitorType", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionMonitorType connectionMonitorType; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the source property: Describes the source of connection monitor. + * + * @return the source value. + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source property: Describes the source of connection monitor. + * + * @param source the source value to set. + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Describes the destination of connection monitor. + * + * @return the destination value. + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Describes the destination of connection monitor. + * + * @param destination the destination value to set. + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the autoStart property: Determines if the connection monitor will start automatically once created. + * + * @return the autoStart value. + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set the autoStart property: Determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set. + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value. + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set. + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + + /** + * Get the endpoints property: List of connection monitor endpoints. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: List of connection monitor endpoints. + * + * @param endpoints the endpoints value to set. + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the testConfigurations property: List of connection monitor test configurations. + * + * @return the testConfigurations value. + */ + public List testConfigurations() { + return this.testConfigurations; + } + + /** + * Set the testConfigurations property: List of connection monitor test configurations. + * + * @param testConfigurations the testConfigurations value to set. + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withTestConfigurations( + List testConfigurations) { + this.testConfigurations = testConfigurations; + return this; + } + + /** + * Get the testGroups property: List of connection monitor test groups. + * + * @return the testGroups value. + */ + public List testGroups() { + return this.testGroups; + } + + /** + * Set the testGroups property: List of connection monitor test groups. + * + * @param testGroups the testGroups value to set. + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withTestGroups(List testGroups) { + this.testGroups = testGroups; + return this; + } + + /** + * Get the outputs property: List of connection monitor outputs. + * + * @return the outputs value. + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs property: List of connection monitor outputs. + * + * @param outputs the outputs value to set. + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get the notes property: Optional notes to be associated with the connection monitor. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: Optional notes to be associated with the connection monitor. + * + * @param notes the notes value to set. + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the connection monitor. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the startTime property: The date and time when the connection monitor was started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the monitoringStatus property: The monitoring status of the connection monitor. + * + * @return the monitoringStatus value. + */ + public String monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Get the connectionMonitorType property: Type of connection monitor. + * + * @return the connectionMonitorType value. + */ + public ConnectionMonitorType connectionMonitorType() { + return this.connectionMonitorType; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (destination() != null) { + destination().validate(); + } + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (testConfigurations() != null) { + testConfigurations().forEach(e -> e.validate()); + } + if (testGroups() != null) { + testGroups().forEach(e -> e.validate()); + } + if (outputs() != null) { + outputs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java new file mode 100644 index 0000000000000..e4e55e39168fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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 virtual network connection reset shared key. */ +@Fluent +public final class ConnectionResetSharedKeyInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionResetSharedKeyInner.class); + + /* + * The virtual network connection reset shared key length, should between 1 + * and 128. + */ + @JsonProperty(value = "keyLength", required = true) + private int keyLength; + + /** + * Get the keyLength property: The virtual network connection reset shared key length, should between 1 and 128. + * + * @return the keyLength value. + */ + public int keyLength() { + return this.keyLength; + } + + /** + * Set the keyLength property: The virtual network connection reset shared key length, should between 1 and 128. + * + * @param keyLength the keyLength value to set. + * @return the ConnectionResetSharedKeyInner object itself. + */ + public ConnectionResetSharedKeyInner withKeyLength(int keyLength) { + this.keyLength = keyLength; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyInner.java new file mode 100644 index 0000000000000..a29c5289329b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyInner.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for GetConnectionSharedKey API service call. */ +@Fluent +public final class ConnectionSharedKeyInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionSharedKeyInner.class); + + /* + * The virtual network connection shared key value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the value property: The virtual network connection shared key value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The virtual network connection shared key value. + * + * @param value the value value to set. + * @return the ConnectionSharedKeyInner object itself. + */ + public ConnectionSharedKeyInner withValue(String value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionSharedKeyInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ConnectionSharedKeyInner")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityInformationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityInformationInner.java new file mode 100644 index 0000000000000..50b956164b659 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityInformationInner.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ConnectivityHop; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information on the connectivity status. */ +@Immutable +public final class ConnectivityInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityInformationInner.class); + + /* + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /* + * The connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionStatus connectionStatus; + + /* + * Average latency in milliseconds. + */ + @JsonProperty(value = "avgLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer avgLatencyInMs; + + /* + * Minimum latency in milliseconds. + */ + @JsonProperty(value = "minLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer minLatencyInMs; + + /* + * Maximum latency in milliseconds. + */ + @JsonProperty(value = "maxLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxLatencyInMs; + + /* + * Total number of probes sent. + */ + @JsonProperty(value = "probesSent", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesSent; + + /* + * Number of failed probes. + */ + @JsonProperty(value = "probesFailed", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesFailed; + + /** + * Get the hops property: List of hops between the source and the destination. + * + * @return the hops value. + */ + public List hops() { + return this.hops; + } + + /** + * Get the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + public ConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the avgLatencyInMs property: Average latency in milliseconds. + * + * @return the avgLatencyInMs value. + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Get the minLatencyInMs property: Minimum latency in milliseconds. + * + * @return the minLatencyInMs value. + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Get the maxLatencyInMs property: Maximum latency in milliseconds. + * + * @return the maxLatencyInMs value. + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Get the probesSent property: Total number of probes sent. + * + * @return the probesSent value. + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Get the probesFailed property: Number of failed probes. + * + * @return the probesFailed value. + */ + public Integer probesFailed() { + return this.probesFailed; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hops() != null) { + hops().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixInner.java new file mode 100644 index 0000000000000..eb24764b19805 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixInner.java @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CommissionedState; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Custom IP prefix resource. */ +@JsonFlatten +@Fluent +public class CustomIpPrefixInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomIpPrefixInner.class); + + /* + * The extended location of the custom IP prefix. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The prefix range in CIDR notation. Should include the start address and + * the prefix length. + */ + @JsonProperty(value = "properties.cidr") + private String cidr; + + /* + * Signed message for WAN validation. + */ + @JsonProperty(value = "properties.signedMessage") + private String signedMessage; + + /* + * Authorization message for WAN validation. + */ + @JsonProperty(value = "properties.authorizationMessage") + private String authorizationMessage; + + /* + * The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + */ + @JsonProperty(value = "properties.customIpPrefixParent") + private CustomIpPrefixInner customIpPrefixParent; + + /* + * The list of all Children for IPv6 /48 CustomIpPrefix. + */ + @JsonProperty(value = "properties.childCustomIpPrefixes", access = JsonProperty.Access.WRITE_ONLY) + private List childCustomIpPrefixes; + + /* + * The commissioned state of the Custom IP Prefix. + */ + @JsonProperty(value = "properties.commissionedState") + private CommissionedState commissionedState; + + /* + * The list of all referenced PublicIpPrefixes. + */ + @JsonProperty(value = "properties.publicIpPrefixes", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpPrefixes; + + /* + * The resource GUID property of the custom IP prefix resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The reason why resource is in failed state. + */ + @JsonProperty(value = "properties.failedReason", access = JsonProperty.Access.WRITE_ONLY) + private String failedReason; + + /* + * The provisioning state of the custom IP prefix resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the extendedLocation property: The extended location of the custom IP prefix. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the custom IP prefix. + * + * @param extendedLocation the extendedLocation value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @param zones the zones value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the cidr property: The prefix range in CIDR notation. Should include the start address and the prefix length. + * + * @return the cidr value. + */ + public String cidr() { + return this.cidr; + } + + /** + * Set the cidr property: The prefix range in CIDR notation. Should include the start address and the prefix length. + * + * @param cidr the cidr value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withCidr(String cidr) { + this.cidr = cidr; + return this; + } + + /** + * Get the signedMessage property: Signed message for WAN validation. + * + * @return the signedMessage value. + */ + public String signedMessage() { + return this.signedMessage; + } + + /** + * Set the signedMessage property: Signed message for WAN validation. + * + * @param signedMessage the signedMessage value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withSignedMessage(String signedMessage) { + this.signedMessage = signedMessage; + return this; + } + + /** + * Get the authorizationMessage property: Authorization message for WAN validation. + * + * @return the authorizationMessage value. + */ + public String authorizationMessage() { + return this.authorizationMessage; + } + + /** + * Set the authorizationMessage property: Authorization message for WAN validation. + * + * @param authorizationMessage the authorizationMessage value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withAuthorizationMessage(String authorizationMessage) { + this.authorizationMessage = authorizationMessage; + return this; + } + + /** + * Get the customIpPrefixParent property: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + * + * @return the customIpPrefixParent value. + */ + public CustomIpPrefixInner customIpPrefixParent() { + return this.customIpPrefixParent; + } + + /** + * Set the customIpPrefixParent property: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + * + * @param customIpPrefixParent the customIpPrefixParent value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withCustomIpPrefixParent(CustomIpPrefixInner customIpPrefixParent) { + this.customIpPrefixParent = customIpPrefixParent; + return this; + } + + /** + * Get the childCustomIpPrefixes property: The list of all Children for IPv6 /48 CustomIpPrefix. + * + * @return the childCustomIpPrefixes value. + */ + public List childCustomIpPrefixes() { + return this.childCustomIpPrefixes; + } + + /** + * Get the commissionedState property: The commissioned state of the Custom IP Prefix. + * + * @return the commissionedState value. + */ + public CommissionedState commissionedState() { + return this.commissionedState; + } + + /** + * Set the commissionedState property: The commissioned state of the Custom IP Prefix. + * + * @param commissionedState the commissionedState value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withCommissionedState(CommissionedState commissionedState) { + this.commissionedState = commissionedState; + return this; + } + + /** + * Get the publicIpPrefixes property: The list of all referenced PublicIpPrefixes. + * + * @return the publicIpPrefixes value. + */ + public List publicIpPrefixes() { + return this.publicIpPrefixes; + } + + /** + * Get the resourceGuid property: The resource GUID property of the custom IP prefix resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the failedReason property: The reason why resource is in failed state. + * + * @return the failedReason value. + */ + public String failedReason() { + return this.failedReason; + } + + /** + * Get the provisioningState property: The provisioning state of the custom IP prefix resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomIpPrefixInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomIpPrefixInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (customIpPrefixParent() != null) { + customIpPrefixParent().validate(); + } + if (childCustomIpPrefixes() != null) { + childCustomIpPrefixes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyInner.java new file mode 100644 index 0000000000000..5ae1e22b52443 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProtocolCustomSettingsFormat; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A DDoS custom policy in a resource group. */ +@JsonFlatten +@Fluent +public class DdosCustomPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosCustomPolicyInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The resource GUID property of the DDoS custom policy resource. It + * uniquely identifies the resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the DDoS custom policy resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The list of public IPs associated with the DDoS custom policy resource. + * This list is read-only. + */ + @JsonProperty(value = "properties.publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpAddresses; + + /* + * The protocol-specific DDoS policy customization parameters. + */ + @JsonProperty(value = "properties.protocolCustomSettings") + private List protocolCustomSettings; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the resourceGuid property: The resource GUID property of the DDoS custom policy resource. It uniquely + * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or + * resource groups. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the DDoS custom policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicIpAddresses property: The list of public IPs associated with the DDoS custom policy resource. This + * list is read-only. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Get the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. + * + * @return the protocolCustomSettings value. + */ + public List protocolCustomSettings() { + return this.protocolCustomSettings; + } + + /** + * Set the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. + * + * @param protocolCustomSettings the protocolCustomSettings value to set. + * @return the DdosCustomPolicyInner object itself. + */ + public DdosCustomPolicyInner withProtocolCustomSettings(List protocolCustomSettings) { + this.protocolCustomSettings = protocolCustomSettings; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the DdosCustomPolicyInner object itself. + */ + public DdosCustomPolicyInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public DdosCustomPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DdosCustomPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocolCustomSettings() != null) { + protocolCustomSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanInner.java new file mode 100644 index 0000000000000..aa0f62259dd6a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A DDoS protection plan in a resource group. */ +@JsonFlatten +@Fluent +public class DdosProtectionPlanInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlanInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The resource GUID property of the DDoS protection plan resource. It + * uniquely identifies the resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the DDoS protection plan resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The list of virtual networks associated with the DDoS protection plan + * resource. This list is read-only. + */ + @JsonProperty(value = "properties.virtualNetworks", access = JsonProperty.Access.WRITE_ONLY) + private List virtualNetworks; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the resourceGuid property: The resource GUID property of the DDoS protection plan resource. It uniquely + * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or + * resource groups. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the DDoS protection plan resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtualNetworks property: The list of virtual networks associated with the DDoS protection plan resource. + * This list is read-only. + * + * @return the virtualNetworks value. + */ + public List virtualNetworks() { + return this.virtualNetworks; + } + + /** {@inheritDoc} */ + @Override + public DdosProtectionPlanInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DdosProtectionPlanInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DnsNameAvailabilityResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DnsNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..3465c028c92bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DnsNameAvailabilityResultInner.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.network.generated.fluent.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; + +/** Response for the CheckDnsNameAvailability API service call. */ +@Fluent +public final class DnsNameAvailabilityResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DnsNameAvailabilityResultInner.class); + + /* + * Domain availability (True/False). + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Get the available property: Domain availability (True/False). + * + * @return the available value. + */ + public Boolean available() { + return this.available; + } + + /** + * Set the available property: Domain availability (True/False). + * + * @param available the available value to set. + * @return the DnsNameAvailabilityResultInner object itself. + */ + public DnsNameAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationInner.java new file mode 100644 index 0000000000000..7df01a4faa376 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationInner.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ProtocolType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.QosIpRange; +import com.azure.resourcemanager.network.generated.models.QosPortRange; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** DSCP Configuration in a resource group. */ +@JsonFlatten +@Fluent +public class DscpConfigurationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DscpConfigurationInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * List of markings to be used in the configuration. + */ + @JsonProperty(value = "properties.markings") + private List markings; + + /* + * Source IP ranges. + */ + @JsonProperty(value = "properties.sourceIpRanges") + private List sourceIpRanges; + + /* + * Destination IP ranges. + */ + @JsonProperty(value = "properties.destinationIpRanges") + private List destinationIpRanges; + + /* + * Sources port ranges. + */ + @JsonProperty(value = "properties.sourcePortRanges") + private List sourcePortRanges; + + /* + * Destination port ranges. + */ + @JsonProperty(value = "properties.destinationPortRanges") + private List destinationPortRanges; + + /* + * RNM supported protocol types. + */ + @JsonProperty(value = "properties.protocol") + private ProtocolType protocol; + + /* + * Qos Collection ID generated by RNM. + */ + @JsonProperty(value = "properties.qosCollectionId", access = JsonProperty.Access.WRITE_ONLY) + private String qosCollectionId; + + /* + * Associated Network Interfaces to the DSCP Configuration. + */ + @JsonProperty(value = "properties.associatedNetworkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List associatedNetworkInterfaces; + + /* + * The resource GUID property of the DSCP Configuration resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the DSCP Configuration resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the markings property: List of markings to be used in the configuration. + * + * @return the markings value. + */ + public List markings() { + return this.markings; + } + + /** + * Set the markings property: List of markings to be used in the configuration. + * + * @param markings the markings value to set. + * @return the DscpConfigurationInner object itself. + */ + public DscpConfigurationInner withMarkings(List markings) { + this.markings = markings; + return this; + } + + /** + * Get the sourceIpRanges property: Source IP ranges. + * + * @return the sourceIpRanges value. + */ + public List sourceIpRanges() { + return this.sourceIpRanges; + } + + /** + * Set the sourceIpRanges property: Source IP ranges. + * + * @param sourceIpRanges the sourceIpRanges value to set. + * @return the DscpConfigurationInner object itself. + */ + public DscpConfigurationInner withSourceIpRanges(List sourceIpRanges) { + this.sourceIpRanges = sourceIpRanges; + return this; + } + + /** + * Get the destinationIpRanges property: Destination IP ranges. + * + * @return the destinationIpRanges value. + */ + public List destinationIpRanges() { + return this.destinationIpRanges; + } + + /** + * Set the destinationIpRanges property: Destination IP ranges. + * + * @param destinationIpRanges the destinationIpRanges value to set. + * @return the DscpConfigurationInner object itself. + */ + public DscpConfigurationInner withDestinationIpRanges(List destinationIpRanges) { + this.destinationIpRanges = destinationIpRanges; + return this; + } + + /** + * Get the sourcePortRanges property: Sources port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the sourcePortRanges property: Sources port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set. + * @return the DscpConfigurationInner object itself. + */ + public DscpConfigurationInner withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destinationPortRanges property: Destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destinationPortRanges property: Destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set. + * @return the DscpConfigurationInner object itself. + */ + public DscpConfigurationInner withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the protocol property: RNM supported protocol types. + * + * @return the protocol value. + */ + public ProtocolType protocol() { + return this.protocol; + } + + /** + * Set the protocol property: RNM supported protocol types. + * + * @param protocol the protocol value to set. + * @return the DscpConfigurationInner object itself. + */ + public DscpConfigurationInner withProtocol(ProtocolType protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the qosCollectionId property: Qos Collection ID generated by RNM. + * + * @return the qosCollectionId value. + */ + public String qosCollectionId() { + return this.qosCollectionId; + } + + /** + * Get the associatedNetworkInterfaces property: Associated Network Interfaces to the DSCP Configuration. + * + * @return the associatedNetworkInterfaces value. + */ + public List associatedNetworkInterfaces() { + return this.associatedNetworkInterfaces; + } + + /** + * Get the resourceGuid property: The resource GUID property of the DSCP Configuration resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the DSCP Configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the DscpConfigurationInner object itself. + */ + public DscpConfigurationInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public DscpConfigurationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DscpConfigurationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceIpRanges() != null) { + sourceIpRanges().forEach(e -> e.validate()); + } + if (destinationIpRanges() != null) { + destinationIpRanges().forEach(e -> e.validate()); + } + if (sourcePortRanges() != null) { + sourcePortRanges().forEach(e -> e.validate()); + } + if (destinationPortRanges() != null) { + destinationPortRanges().forEach(e -> e.validate()); + } + if (associatedNetworkInterfaces() != null) { + associatedNetworkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveNetworkSecurityGroupListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveNetworkSecurityGroupListResultInner.java new file mode 100644 index 0000000000000..53da2145c4770 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveNetworkSecurityGroupListResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroup; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list effective network security groups API service call. */ +@Fluent +public final class EffectiveNetworkSecurityGroupListResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityGroupListResultInner.class); + + /* + * A list of effective network security groups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of effective network security groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of effective network security groups. + * + * @param value the value value to set. + * @return the EffectiveNetworkSecurityGroupListResultInner object itself. + */ + public EffectiveNetworkSecurityGroupListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteListResultInner.java new file mode 100644 index 0000000000000..a64daabff7fe3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.EffectiveRoute; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list effective route API service call. */ +@Fluent +public final class EffectiveRouteListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveRouteListResultInner.class); + + /* + * A list of effective routes. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of effective routes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of effective routes. + * + * @param value the value value to set. + * @return the EffectiveRouteListResultInner object itself. + */ + public EffectiveRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EndpointServiceResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EndpointServiceResultInner.java new file mode 100644 index 0000000000000..0d7cefe3807ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EndpointServiceResultInner.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Endpoint service. */ +@Fluent +public final class EndpointServiceResultInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointServiceResultInner.class); + + /* + * Name of the endpoint service. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Type of the endpoint service. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the name property: Name of the endpoint service. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Type of the endpoint service. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public EndpointServiceResultInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitAuthorizationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitAuthorizationInner.java new file mode 100644 index 0000000000000..cb734c2218ab4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitAuthorizationInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authorization in an ExpressRouteCircuit resource. */ +@JsonFlatten +@Fluent +public class ExpressRouteCircuitAuthorizationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitAuthorizationInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /* + * The authorization use status. + */ + @JsonProperty(value = "properties.authorizationUseStatus") + private AuthorizationUseStatus authorizationUseStatus; + + /* + * The provisioning state of the authorization resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey property: The authorization key. + * + * @param authorizationKey the authorizationKey value to set. + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the authorizationUseStatus property: The authorization use status. + * + * @return the authorizationUseStatus value. + */ + public AuthorizationUseStatus authorizationUseStatus() { + return this.authorizationUseStatus; + } + + /** + * Set the authorizationUseStatus property: The authorization use status. + * + * @param authorizationUseStatus the authorizationUseStatus value to set. + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationUseStatus( + AuthorizationUseStatus authorizationUseStatus) { + this.authorizationUseStatus = authorizationUseStatus; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the authorization resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteCircuitAuthorizationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionInner.java new file mode 100644 index 0000000000000..b1b51eca742cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. */ +@JsonFlatten +@Fluent +public class ExpressRouteCircuitConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering") + private SubResource expressRouteCircuitPeering; + + /* + * Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + */ + @JsonProperty(value = "properties.peerExpressRouteCircuitPeering") + private SubResource peerExpressRouteCircuitPeering; + + /* + * /29 IP address space to carve out Customer addresses for tunnels. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /* + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /* + * IPv6 Address PrefixProperties of the express route circuit connection. + */ + @JsonProperty(value = "properties.ipv6CircuitConnectionConfig") + private Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig; + + /* + * Express Route Circuit connection state. + */ + @JsonProperty(value = "properties.circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /* + * The provisioning state of the express route circuit connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + * + * @return the expressRouteCircuitPeering value. + */ + public SubResource expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set. + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of + * the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value. + */ + public SubResource peerExpressRouteCircuitPeering() { + return this.peerExpressRouteCircuitPeering; + } + + /** + * Set the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of + * the peered circuit. + * + * @param peerExpressRouteCircuitPeering the peerExpressRouteCircuitPeering value to set. + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withPeerExpressRouteCircuitPeering( + SubResource peerExpressRouteCircuitPeering) { + this.peerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + return this; + } + + /** + * Get the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. + * + * @param addressPrefix the addressPrefix value to set. + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey property: The authorization key. + * + * @param authorizationKey the authorizationKey value to set. + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the ipv6CircuitConnectionConfig property: IPv6 Address PrefixProperties of the express route circuit + * connection. + * + * @return the ipv6CircuitConnectionConfig value. + */ + public Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig() { + return this.ipv6CircuitConnectionConfig; + } + + /** + * Set the ipv6CircuitConnectionConfig property: IPv6 Address PrefixProperties of the express route circuit + * connection. + * + * @param ipv6CircuitConnectionConfig the ipv6CircuitConnectionConfig value to set. + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withIpv6CircuitConnectionConfig( + Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig) { + this.ipv6CircuitConnectionConfig = ipv6CircuitConnectionConfig; + return this; + } + + /** + * Get the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Get the provisioningState property: The provisioning state of the express route circuit connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteCircuitConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipv6CircuitConnectionConfig() != null) { + ipv6CircuitConnectionConfig().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitInner.java new file mode 100644 index 0000000000000..c44cb5c292e2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitInner.java @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitServiceProviderProperties; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRouteCircuit resource. */ +@JsonFlatten +@Fluent +public class ExpressRouteCircuitInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitInner.class); + + /* + * The SKU. + */ + @JsonProperty(value = "sku") + private ExpressRouteCircuitSku sku; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Allow classic operations. + */ + @JsonProperty(value = "properties.allowClassicOperations") + private Boolean allowClassicOperations; + + /* + * The CircuitProvisioningState state of the resource. + */ + @JsonProperty(value = "properties.circuitProvisioningState") + private String circuitProvisioningState; + + /* + * The ServiceProviderProvisioningState state of the resource. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /* + * The list of authorizations. + */ + @JsonProperty(value = "properties.authorizations") + private List authorizations; + + /* + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /* + * The ServiceKey. + */ + @JsonProperty(value = "properties.serviceKey") + private String serviceKey; + + /* + * The ServiceProviderNotes. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /* + * The ServiceProviderProperties. + */ + @JsonProperty(value = "properties.serviceProviderProperties") + private ExpressRouteCircuitServiceProviderProperties serviceProviderProperties; + + /* + * The reference to the ExpressRoutePort resource when the circuit is + * provisioned on an ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.expressRoutePort") + private SubResource expressRoutePort; + + /* + * The bandwidth of the circuit when the circuit is provisioned on an + * ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.bandwidthInGbps") + private Float bandwidthInGbps; + + /* + * The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + */ + @JsonProperty(value = "properties.stag", access = JsonProperty.Access.WRITE_ONLY) + private Integer stag; + + /* + * The provisioning state of the express route circuit resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /* + * Flag denoting global reach status. + */ + @JsonProperty(value = "properties.globalReachEnabled") + private Boolean globalReachEnabled; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the sku property: The SKU. + * + * @return the sku value. + */ + public ExpressRouteCircuitSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU. + * + * @param sku the sku value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withSku(ExpressRouteCircuitSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the allowClassicOperations property: Allow classic operations. + * + * @return the allowClassicOperations value. + */ + public Boolean allowClassicOperations() { + return this.allowClassicOperations; + } + + /** + * Set the allowClassicOperations property: Allow classic operations. + * + * @param allowClassicOperations the allowClassicOperations value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAllowClassicOperations(Boolean allowClassicOperations) { + this.allowClassicOperations = allowClassicOperations; + return this; + } + + /** + * Get the circuitProvisioningState property: The CircuitProvisioningState state of the resource. + * + * @return the circuitProvisioningState value. + */ + public String circuitProvisioningState() { + return this.circuitProvisioningState; + } + + /** + * Set the circuitProvisioningState property: The CircuitProvisioningState state of the resource. + * + * @param circuitProvisioningState the circuitProvisioningState value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withCircuitProvisioningState(String circuitProvisioningState) { + this.circuitProvisioningState = circuitProvisioningState; + return this; + } + + /** + * Get the serviceProviderProvisioningState property: The ServiceProviderProvisioningState state of the resource. + * + * @return the serviceProviderProvisioningState value. + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the serviceProviderProvisioningState property: The ServiceProviderProvisioningState state of the resource. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get the authorizations property: The list of authorizations. + * + * @return the authorizations value. + */ + public List authorizations() { + return this.authorizations; + } + + /** + * Set the authorizations property: The list of authorizations. + * + * @param authorizations the authorizations value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAuthorizations(List authorizations) { + this.authorizations = authorizations; + return this; + } + + /** + * Get the peerings property: The list of peerings. + * + * @return the peerings value. + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the peerings property: The list of peerings. + * + * @param peerings the peerings value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the serviceKey property: The ServiceKey. + * + * @return the serviceKey value. + */ + public String serviceKey() { + return this.serviceKey; + } + + /** + * Set the serviceKey property: The ServiceKey. + * + * @param serviceKey the serviceKey value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceKey(String serviceKey) { + this.serviceKey = serviceKey; + return this; + } + + /** + * Get the serviceProviderNotes property: The ServiceProviderNotes. + * + * @return the serviceProviderNotes value. + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set the serviceProviderNotes property: The ServiceProviderNotes. + * + * @param serviceProviderNotes the serviceProviderNotes value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get the serviceProviderProperties property: The ServiceProviderProperties. + * + * @return the serviceProviderProperties value. + */ + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.serviceProviderProperties; + } + + /** + * Set the serviceProviderProperties property: The ServiceProviderProperties. + * + * @param serviceProviderProperties the serviceProviderProperties value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProperties( + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.serviceProviderProperties = serviceProviderProperties; + return this; + } + + /** + * Get the expressRoutePort property: The reference to the ExpressRoutePort resource when the circuit is provisioned + * on an ExpressRoutePort resource. + * + * @return the expressRoutePort value. + */ + public SubResource expressRoutePort() { + return this.expressRoutePort; + } + + /** + * Set the expressRoutePort property: The reference to the ExpressRoutePort resource when the circuit is provisioned + * on an ExpressRoutePort resource. + * + * @param expressRoutePort the expressRoutePort value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withExpressRoutePort(SubResource expressRoutePort) { + this.expressRoutePort = expressRoutePort; + return this; + } + + /** + * Get the bandwidthInGbps property: The bandwidth of the circuit when the circuit is provisioned on an + * ExpressRoutePort resource. + * + * @return the bandwidthInGbps value. + */ + public Float bandwidthInGbps() { + return this.bandwidthInGbps; + } + + /** + * Set the bandwidthInGbps property: The bandwidth of the circuit when the circuit is provisioned on an + * ExpressRoutePort resource. + * + * @param bandwidthInGbps the bandwidthInGbps value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withBandwidthInGbps(Float bandwidthInGbps) { + this.bandwidthInGbps = bandwidthInGbps; + return this; + } + + /** + * Get the stag property: The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + * + * @return the stag value. + */ + public Integer stag() { + return this.stag; + } + + /** + * Get the provisioningState property: The provisioning state of the express route circuit resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the gatewayManagerEtag property: The GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get the globalReachEnabled property: Flag denoting global reach status. + * + * @return the globalReachEnabled value. + */ + public Boolean globalReachEnabled() { + return this.globalReachEnabled; + } + + /** + * Set the globalReachEnabled property: Flag denoting global reach status. + * + * @param globalReachEnabled the globalReachEnabled value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withGlobalReachEnabled(Boolean globalReachEnabled) { + this.globalReachEnabled = globalReachEnabled; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteCircuitInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteCircuitInner 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) { + sku().validate(); + } + if (authorizations() != null) { + authorizations().forEach(e -> e.validate()); + } + if (peerings() != null) { + peerings().forEach(e -> e.validate()); + } + if (serviceProviderProperties() != null) { + serviceProviderProperties().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringInner.java new file mode 100644 index 0000000000000..6aa8d8010c8c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringInner.java @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionId; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Peering in an ExpressRouteCircuit resource. */ +@JsonFlatten +@Fluent +public class ExpressRouteCircuitPeeringInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The peering type. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /* + * The peering state. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /* + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN") + private Integer azureAsn; + + /* + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerAsn; + + /* + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /* + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort") + private String primaryAzurePort; + + /* + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort") + private String secondaryAzurePort; + + /* + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /* + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /* + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The peering stats of express route circuit. + */ + @JsonProperty(value = "properties.stats") + private ExpressRouteCircuitStatsInner stats; + + /* + * The provisioning state of the express route circuit peering resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /* + * Who was the last to modify the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedBy; + + /* + * The reference to the RouteFilter resource. + */ + @JsonProperty(value = "properties.routeFilter") + private SubResource routeFilter; + + /* + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /* + * The ExpressRoute connection. + */ + @JsonProperty(value = "properties.expressRouteConnection") + private ExpressRouteConnectionId expressRouteConnection; + + /* + * The list of circuit connections associated with Azure Private Peering + * for this circuit. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /* + * The list of peered circuit connections associated with Azure Private + * Peering for this circuit. + */ + @JsonProperty(value = "properties.peeredConnections", access = JsonProperty.Access.WRITE_ONLY) + private List peeredConnections; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the peeringType property: The peering type. + * + * @return the peeringType value. + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peeringType property: The peering type. + * + * @param peeringType the peeringType value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the state property: The peering state. + * + * @return the state value. + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the state property: The peering state. + * + * @param state the state value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the azureAsn property: The Azure ASN. + * + * @return the azureAsn value. + */ + public Integer azureAsn() { + return this.azureAsn; + } + + /** + * Set the azureAsn property: The Azure ASN. + * + * @param azureAsn the azureAsn value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withAzureAsn(Integer azureAsn) { + this.azureAsn = azureAsn; + return this; + } + + /** + * Get the peerAsn property: The peer ASN. + * + * @return the peerAsn value. + */ + public Long peerAsn() { + return this.peerAsn; + } + + /** + * Set the peerAsn property: The peer ASN. + * + * @param peerAsn the peerAsn value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeerAsn(Long peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + /** + * Get the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primaryPeerAddressPrefix property: The primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primaryAzurePort property: The primary port. + * + * @return the primaryAzurePort value. + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Set the primaryAzurePort property: The primary port. + * + * @param primaryAzurePort the primaryAzurePort value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryAzurePort(String primaryAzurePort) { + this.primaryAzurePort = primaryAzurePort; + return this; + } + + /** + * Get the secondaryAzurePort property: The secondary port. + * + * @return the secondaryAzurePort value. + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Set the secondaryAzurePort property: The secondary port. + * + * @param secondaryAzurePort the secondaryAzurePort value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryAzurePort(String secondaryAzurePort) { + this.secondaryAzurePort = secondaryAzurePort; + return this; + } + + /** + * Get the sharedKey property: The shared key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the sharedKey property: The shared key. + * + * @param sharedKey the sharedKey value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the vlanId property: The VLAN ID. + * + * @return the vlanId value. + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the vlanId property: The VLAN ID. + * + * @param vlanId the vlanId value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withMicrosoftPeeringConfig( + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get the stats property: The peering stats of express route circuit. + * + * @return the stats value. + */ + public ExpressRouteCircuitStatsInner stats() { + return this.stats; + } + + /** + * Set the stats property: The peering stats of express route circuit. + * + * @param stats the stats value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withStats(ExpressRouteCircuitStatsInner stats) { + this.stats = stats; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the express route circuit peering resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the gatewayManagerEtag property: The GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get the lastModifiedBy property: Who was the last to modify the peering. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Get the routeFilter property: The reference to the RouteFilter resource. + * + * @return the routeFilter value. + */ + public SubResource routeFilter() { + return this.routeFilter; + } + + /** + * Set the routeFilter property: The reference to the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withRouteFilter(SubResource routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value. + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withIpv6PeeringConfig( + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** + * Get the expressRouteConnection property: The ExpressRoute connection. + * + * @return the expressRouteConnection value. + */ + public ExpressRouteConnectionId expressRouteConnection() { + return this.expressRouteConnection; + } + + /** + * Set the expressRouteConnection property: The ExpressRoute connection. + * + * @param expressRouteConnection the expressRouteConnection value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection) { + this.expressRouteConnection = expressRouteConnection; + return this; + } + + /** + * Get the connections property: The list of circuit connections associated with Azure Private Peering for this + * circuit. + * + * @return the connections value. + */ + public List connections() { + return this.connections; + } + + /** + * Set the connections property: The list of circuit connections associated with Azure Private Peering for this + * circuit. + * + * @param connections the connections value to set. + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get the peeredConnections property: The list of peered circuit connections associated with Azure Private Peering + * for this circuit. + * + * @return the peeredConnections value. + */ + public List peeredConnections() { + return this.peeredConnections; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteCircuitPeeringInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (microsoftPeeringConfig() != null) { + microsoftPeeringConfig().validate(); + } + if (stats() != null) { + stats().validate(); + } + if (ipv6PeeringConfig() != null) { + ipv6PeeringConfig().validate(); + } + if (expressRouteConnection() != null) { + expressRouteConnection().validate(); + } + if (connections() != null) { + connections().forEach(e -> e.validate()); + } + if (peeredConnections() != null) { + peeredConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitStatsInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitStatsInner.java new file mode 100644 index 0000000000000..0fe8b429db7b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitStatsInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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; + +/** Contains stats associated with the peering. */ +@Fluent +public final class ExpressRouteCircuitStatsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitStatsInner.class); + + /* + * The Primary BytesIn of the peering. + */ + @JsonProperty(value = "primarybytesIn") + private Long primarybytesIn; + + /* + * The primary BytesOut of the peering. + */ + @JsonProperty(value = "primarybytesOut") + private Long primarybytesOut; + + /* + * The secondary BytesIn of the peering. + */ + @JsonProperty(value = "secondarybytesIn") + private Long secondarybytesIn; + + /* + * The secondary BytesOut of the peering. + */ + @JsonProperty(value = "secondarybytesOut") + private Long secondarybytesOut; + + /** + * Get the primarybytesIn property: The Primary BytesIn of the peering. + * + * @return the primarybytesIn value. + */ + public Long primarybytesIn() { + return this.primarybytesIn; + } + + /** + * Set the primarybytesIn property: The Primary BytesIn of the peering. + * + * @param primarybytesIn the primarybytesIn value to set. + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesIn(Long primarybytesIn) { + this.primarybytesIn = primarybytesIn; + return this; + } + + /** + * Get the primarybytesOut property: The primary BytesOut of the peering. + * + * @return the primarybytesOut value. + */ + public Long primarybytesOut() { + return this.primarybytesOut; + } + + /** + * Set the primarybytesOut property: The primary BytesOut of the peering. + * + * @param primarybytesOut the primarybytesOut value to set. + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesOut(Long primarybytesOut) { + this.primarybytesOut = primarybytesOut; + return this; + } + + /** + * Get the secondarybytesIn property: The secondary BytesIn of the peering. + * + * @return the secondarybytesIn value. + */ + public Long secondarybytesIn() { + return this.secondarybytesIn; + } + + /** + * Set the secondarybytesIn property: The secondary BytesIn of the peering. + * + * @param secondarybytesIn the secondarybytesIn value to set. + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesIn(Long secondarybytesIn) { + this.secondarybytesIn = secondarybytesIn; + return this; + } + + /** + * Get the secondarybytesOut property: The secondary BytesOut of the peering. + * + * @return the secondarybytesOut value. + */ + public Long secondarybytesOut() { + return this.secondarybytesOut; + } + + /** + * Set the secondarybytesOut property: The secondary BytesOut of the peering. + * + * @param secondarybytesOut the secondarybytesOut value to set. + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesOut(Long secondarybytesOut) { + this.secondarybytesOut = secondarybytesOut; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java new file mode 100644 index 0000000000000..56e2ba66559f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitArpTable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListArpTable associated with the Express Route Circuits API. */ +@Fluent +public final class ExpressRouteCircuitsArpTableListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsArpTableListResultInner.class); + + /* + * A list of the ARP tables. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of the ARP tables. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of the ARP tables. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java new file mode 100644 index 0000000000000..cc92c14c9bd2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListRoutesTable associated with the Express Route Circuits API. */ +@Fluent +public final class ExpressRouteCircuitsRoutesTableListResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsRoutesTableListResultInner.class); + + /* + * The list of routes table. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of routes table. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of routes table. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java new file mode 100644 index 0000000000000..7f0b261189d3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListRoutesTable associated with the Express Route Circuits API. */ +@Fluent +public final class ExpressRouteCircuitsRoutesTableSummaryListResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsRoutesTableSummaryListResultInner.class); + + /* + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of the routes table. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of the routes table. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionInner.java new file mode 100644 index 0000000000000..ac9ff9bd9a93f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionInner.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRouteConnection resource. */ +@JsonFlatten +@Fluent +public class ExpressRouteConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionInner.class); + + /* + * The name of the resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The provisioning state of the express route connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The ExpressRoute circuit peering. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering") + private ExpressRouteCircuitPeeringId expressRouteCircuitPeering; + + /* + * Authorization key to establish the connection. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /* + * The routing weight associated to the connection. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /* + * Enable internet security. + */ + @JsonProperty(value = "properties.enableInternetSecurity") + private Boolean enableInternetSecurity; + + /* + * Enable FastPath to vWan Firewall hub. + */ + @JsonProperty(value = "properties.expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /* + * The Routing Configuration indicating the associated and propagated route + * tables on this connection. + */ + @JsonProperty(value = "properties.routingConfiguration") + private RoutingConfiguration routingConfiguration; + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. + * + * @param name the name value to set. + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the express route connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the expressRouteCircuitPeering property: The ExpressRoute circuit peering. + * + * @return the expressRouteCircuitPeering value. + */ + public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set the expressRouteCircuitPeering property: The ExpressRoute circuit peering. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set. + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withExpressRouteCircuitPeering( + ExpressRouteCircuitPeeringId expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get the authorizationKey property: Authorization key to establish the connection. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey property: Authorization key to establish the connection. + * + * @param authorizationKey the authorizationKey value to set. + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the routingWeight property: The routing weight associated to the connection. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routingWeight property: The routing weight associated to the connection. + * + * @param routingWeight the routingWeight value to set. + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + public Boolean enableInternetSecurity() { + return this.enableInternetSecurity; + } + + /** + * Set the enableInternetSecurity property: Enable internet security. + * + * @param enableInternetSecurity the enableInternetSecurity value to set. + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.enableInternetSecurity = enableInternetSecurity; + return this; + } + + /** + * Get the expressRouteGatewayBypass property: Enable FastPath to vWan Firewall hub. + * + * @return the expressRouteGatewayBypass value. + */ + public Boolean expressRouteGatewayBypass() { + return this.expressRouteGatewayBypass; + } + + /** + * Set the expressRouteGatewayBypass property: Enable FastPath to vWan Firewall hub. + * + * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set. + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + public RoutingConfiguration routingConfiguration() { + return this.routingConfiguration; + } + + /** + * Set the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @param routingConfiguration the routingConfiguration value to set. + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withRoutingConfiguration(RoutingConfiguration routingConfiguration) { + this.routingConfiguration = routingConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteConnectionInner withId(String id) { + super.withId(id); + 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 ExpressRouteConnectionInner")); + } + if (expressRouteCircuitPeering() != null) { + expressRouteCircuitPeering().validate(); + } + if (routingConfiguration() != null) { + routingConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionListInner.java new file mode 100644 index 0000000000000..d837c40f27f3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionListInner.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.network.generated.fluent.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; + +/** ExpressRouteConnection list. */ +@Fluent +public final class ExpressRouteConnectionListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionListInner.class); + + /* + * The list of ExpressRoute connections. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of ExpressRoute connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of ExpressRoute connections. + * + * @param value the value value to set. + * @return the ExpressRouteConnectionListInner object itself. + */ + public ExpressRouteConnectionListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionInner.java new file mode 100644 index 0000000000000..7a1c7ce7a6416 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionInner.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ExpressRouteCircuitReference; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRouteCrossConnection resource. */ +@JsonFlatten +@Fluent +public class ExpressRouteCrossConnectionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The name of the primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /* + * The name of the secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /* + * The identifier of the circuit traffic. + */ + @JsonProperty(value = "properties.sTag", access = JsonProperty.Access.WRITE_ONLY) + private Integer stag; + + /* + * The peering location of the ExpressRoute circuit. + */ + @JsonProperty(value = "properties.peeringLocation", access = JsonProperty.Access.WRITE_ONLY) + private String peeringLocation; + + /* + * The circuit bandwidth In Mbps. + */ + @JsonProperty(value = "properties.bandwidthInMbps", access = JsonProperty.Access.WRITE_ONLY) + private Integer bandwidthInMbps; + + /* + * The ExpressRouteCircuit. + */ + @JsonProperty(value = "properties.expressRouteCircuit") + private ExpressRouteCircuitReference expressRouteCircuit; + + /* + * The provisioning state of the circuit in the connectivity provider + * system. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /* + * Additional read only notes set by the connectivity provider. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /* + * The provisioning state of the express route cross connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the primaryAzurePort property: The name of the primary port. + * + * @return the primaryAzurePort value. + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the secondaryAzurePort property: The name of the secondary port. + * + * @return the secondaryAzurePort value. + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the stag property: The identifier of the circuit traffic. + * + * @return the stag value. + */ + public Integer stag() { + return this.stag; + } + + /** + * Get the peeringLocation property: The peering location of the ExpressRoute circuit. + * + * @return the peeringLocation value. + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Get the bandwidthInMbps property: The circuit bandwidth In Mbps. + * + * @return the bandwidthInMbps value. + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Get the expressRouteCircuit property: The ExpressRouteCircuit. + * + * @return the expressRouteCircuit value. + */ + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.expressRouteCircuit; + } + + /** + * Set the expressRouteCircuit property: The ExpressRouteCircuit. + * + * @param expressRouteCircuit the expressRouteCircuit value to set. + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.expressRouteCircuit = expressRouteCircuit; + return this; + } + + /** + * Get the serviceProviderProvisioningState property: The provisioning state of the circuit in the connectivity + * provider system. + * + * @return the serviceProviderProvisioningState value. + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the serviceProviderProvisioningState property: The provisioning state of the circuit in the connectivity + * provider system. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set. + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get the serviceProviderNotes property: Additional read only notes set by the connectivity provider. + * + * @return the serviceProviderNotes value. + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set the serviceProviderNotes property: Additional read only notes set by the connectivity provider. + * + * @param serviceProviderNotes the serviceProviderNotes value to set. + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the express route cross connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the peerings property: The list of peerings. + * + * @return the peerings value. + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the peerings property: The list of peerings. + * + * @param peerings the peerings value to set. + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteCrossConnectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteCrossConnectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expressRouteCircuit() != null) { + expressRouteCircuit().validate(); + } + if (peerings() != null) { + peerings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringInner.java new file mode 100644 index 0000000000000..e972c3c28983d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringInner.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peering in an ExpressRoute Cross Connection resource. */ +@JsonFlatten +@Fluent +public class ExpressRouteCrossConnectionPeeringInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The peering type. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /* + * The peering state. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /* + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN", access = JsonProperty.Access.WRITE_ONLY) + private Integer azureAsn; + + /* + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerAsn; + + /* + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /* + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /* + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /* + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /* + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /* + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The provisioning state of the express route cross connection peering + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /* + * Who was the last to modify the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedBy; + + /* + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the peeringType property: The peering type. + * + * @return the peeringType value. + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peeringType property: The peering type. + * + * @param peeringType the peeringType value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the state property: The peering state. + * + * @return the state value. + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the state property: The peering state. + * + * @param state the state value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the azureAsn property: The Azure ASN. + * + * @return the azureAsn value. + */ + public Integer azureAsn() { + return this.azureAsn; + } + + /** + * Get the peerAsn property: The peer ASN. + * + * @return the peerAsn value. + */ + public Long peerAsn() { + return this.peerAsn; + } + + /** + * Set the peerAsn property: The peer ASN. + * + * @param peerAsn the peerAsn value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeerAsn(Long peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + /** + * Get the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primaryPeerAddressPrefix property: The primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primaryAzurePort property: The primary port. + * + * @return the primaryAzurePort value. + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the secondaryAzurePort property: The secondary port. + * + * @return the secondaryAzurePort value. + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the sharedKey property: The shared key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the sharedKey property: The shared key. + * + * @param sharedKey the sharedKey value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the vlanId property: The VLAN ID. + * + * @return the vlanId value. + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the vlanId property: The VLAN ID. + * + * @param vlanId the vlanId value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withMicrosoftPeeringConfig( + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the express route cross connection peering + * resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the gatewayManagerEtag property: The GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get the lastModifiedBy property: Who was the last to modify the peering. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Get the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value. + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set. + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withIpv6PeeringConfig( + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteCrossConnectionPeeringInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (microsoftPeeringConfig() != null) { + microsoftPeeringConfig().validate(); + } + if (ipv6PeeringConfig() != null) { + ipv6PeeringConfig().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java new file mode 100644 index 0000000000000..14338e4c9fa85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListRoutesTable associated with the Express Route Cross Connections. */ +@Fluent +public final class ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class); + + /* + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of the routes table. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of the routes table. + * + * @param value the value value to set. + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayInner.java new file mode 100644 index 0000000000000..bfa34907d76ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayInner.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRoute gateway resource. */ +@JsonFlatten +@Fluent +public class ExpressRouteGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Configuration for auto scaling. + */ + @JsonProperty(value = "properties.autoScaleConfiguration") + private ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration; + + /* + * List of ExpressRoute connections to the ExpressRoute gateway. + */ + @JsonProperty(value = "properties.expressRouteConnections", access = JsonProperty.Access.WRITE_ONLY) + private List expressRouteConnections; + + /* + * The provisioning state of the express route gateway resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The Virtual Hub where the ExpressRoute gateway is or will be deployed. + */ + @JsonProperty(value = "properties.virtualHub") + private VirtualHubId virtualHub; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the autoScaleConfiguration property: Configuration for auto scaling. + * + * @return the autoScaleConfiguration value. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration() { + return this.autoScaleConfiguration; + } + + /** + * Set the autoScaleConfiguration property: Configuration for auto scaling. + * + * @param autoScaleConfiguration the autoScaleConfiguration value to set. + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withAutoScaleConfiguration( + ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { + this.autoScaleConfiguration = autoScaleConfiguration; + return this; + } + + /** + * Get the expressRouteConnections property: List of ExpressRoute connections to the ExpressRoute gateway. + * + * @return the expressRouteConnections value. + */ + public List expressRouteConnections() { + return this.expressRouteConnections; + } + + /** + * Get the provisioningState property: The provisioning state of the express route gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtualHub property: The Virtual Hub where the ExpressRoute gateway is or will be deployed. + * + * @return the virtualHub value. + */ + public VirtualHubId virtualHub() { + return this.virtualHub; + } + + /** + * Set the virtualHub property: The Virtual Hub where the ExpressRoute gateway is or will be deployed. + * + * @param virtualHub the virtualHub value to set. + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withVirtualHub(VirtualHubId virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoScaleConfiguration() != null) { + autoScaleConfiguration().validate(); + } + if (expressRouteConnections() != null) { + expressRouteConnections().forEach(e -> e.validate()); + } + if (virtualHub() != null) { + virtualHub().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayListInner.java new file mode 100644 index 0000000000000..386c1bc94e7aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayListInner.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.network.generated.fluent.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; + +/** List of ExpressRoute gateways. */ +@Fluent +public final class ExpressRouteGatewayListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayListInner.class); + + /* + * List of ExpressRoute gateways. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of ExpressRoute gateways. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of ExpressRoute gateways. + * + * @param value the value value to set. + * @return the ExpressRouteGatewayListInner object itself. + */ + public ExpressRouteGatewayListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkInner.java new file mode 100644 index 0000000000000..2a77b804dbb31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkInner.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkConnectorType; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkMacSecConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRouteLink child resource definition. */ +@JsonFlatten +@Fluent +public class ExpressRouteLinkInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkInner.class); + + /* + * Name of child port resource that is unique among child port resources of + * the parent. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Name of Azure router associated with physical port. + */ + @JsonProperty(value = "properties.routerName", access = JsonProperty.Access.WRITE_ONLY) + private String routerName; + + /* + * Name of Azure router interface. + */ + @JsonProperty(value = "properties.interfaceName", access = JsonProperty.Access.WRITE_ONLY) + private String interfaceName; + + /* + * Mapping between physical port to patch panel port. + */ + @JsonProperty(value = "properties.patchPanelId", access = JsonProperty.Access.WRITE_ONLY) + private String patchPanelId; + + /* + * Mapping of physical patch panel to rack. + */ + @JsonProperty(value = "properties.rackId", access = JsonProperty.Access.WRITE_ONLY) + private String rackId; + + /* + * Physical fiber port type. + */ + @JsonProperty(value = "properties.connectorType", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRouteLinkConnectorType connectorType; + + /* + * Administrative state of the physical port. + */ + @JsonProperty(value = "properties.adminState") + private ExpressRouteLinkAdminState adminState; + + /* + * The provisioning state of the express route link resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * MacSec configuration. + */ + @JsonProperty(value = "properties.macSecConfig") + private ExpressRouteLinkMacSecConfig macSecConfig; + + /** + * Get the name property: Name of child port resource that is unique among child port resources of the parent. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of child port resource that is unique among child port resources of the parent. + * + * @param name the name value to set. + * @return the ExpressRouteLinkInner object itself. + */ + public ExpressRouteLinkInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the routerName property: Name of Azure router associated with physical port. + * + * @return the routerName value. + */ + public String routerName() { + return this.routerName; + } + + /** + * Get the interfaceName property: Name of Azure router interface. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.interfaceName; + } + + /** + * Get the patchPanelId property: Mapping between physical port to patch panel port. + * + * @return the patchPanelId value. + */ + public String patchPanelId() { + return this.patchPanelId; + } + + /** + * Get the rackId property: Mapping of physical patch panel to rack. + * + * @return the rackId value. + */ + public String rackId() { + return this.rackId; + } + + /** + * Get the connectorType property: Physical fiber port type. + * + * @return the connectorType value. + */ + public ExpressRouteLinkConnectorType connectorType() { + return this.connectorType; + } + + /** + * Get the adminState property: Administrative state of the physical port. + * + * @return the adminState value. + */ + public ExpressRouteLinkAdminState adminState() { + return this.adminState; + } + + /** + * Set the adminState property: Administrative state of the physical port. + * + * @param adminState the adminState value to set. + * @return the ExpressRouteLinkInner object itself. + */ + public ExpressRouteLinkInner withAdminState(ExpressRouteLinkAdminState adminState) { + this.adminState = adminState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the express route link resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the macSecConfig property: MacSec configuration. + * + * @return the macSecConfig value. + */ + public ExpressRouteLinkMacSecConfig macSecConfig() { + return this.macSecConfig; + } + + /** + * Set the macSecConfig property: MacSec configuration. + * + * @param macSecConfig the macSecConfig value to set. + * @return the ExpressRouteLinkInner object itself. + */ + public ExpressRouteLinkInner withMacSecConfig(ExpressRouteLinkMacSecConfig macSecConfig) { + this.macSecConfig = macSecConfig; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteLinkInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (macSecConfig() != null) { + macSecConfig().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortInner.java new file mode 100644 index 0000000000000..2585dadcec0a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortInner.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsEncapsulation; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRoutePort resource definition. */ +@JsonFlatten +@Fluent +public class ExpressRoutePortInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The identity of ExpressRoutePort, if configured. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * The name of the peering location that the ExpressRoutePort is mapped to + * physically. + */ + @JsonProperty(value = "properties.peeringLocation") + private String peeringLocation; + + /* + * Bandwidth of procured ports in Gbps. + */ + @JsonProperty(value = "properties.bandwidthInGbps") + private Integer bandwidthInGbps; + + /* + * Aggregate Gbps of associated circuit bandwidths. + */ + @JsonProperty(value = "properties.provisionedBandwidthInGbps", access = JsonProperty.Access.WRITE_ONLY) + private Float provisionedBandwidthInGbps; + + /* + * Maximum transmission unit of the physical port pair(s). + */ + @JsonProperty(value = "properties.mtu", access = JsonProperty.Access.WRITE_ONLY) + private String mtu; + + /* + * Encapsulation method on physical ports. + */ + @JsonProperty(value = "properties.encapsulation") + private ExpressRoutePortsEncapsulation encapsulation; + + /* + * Ether type of the physical port. + */ + @JsonProperty(value = "properties.etherType", access = JsonProperty.Access.WRITE_ONLY) + private String etherType; + + /* + * Date of the physical port allocation to be used in Letter of + * Authorization. + */ + @JsonProperty(value = "properties.allocationDate", access = JsonProperty.Access.WRITE_ONLY) + private String allocationDate; + + /* + * The set of physical links of the ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.links") + private List links; + + /* + * Reference the ExpressRoute circuit(s) that are provisioned on this + * ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.circuits", access = JsonProperty.Access.WRITE_ONLY) + private List circuits; + + /* + * The provisioning state of the express route port resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The resource GUID property of the express route port resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the identity property: The identity of ExpressRoutePort, if configured. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of ExpressRoutePort, if configured. + * + * @param identity the identity value to set. + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the peeringLocation property: The name of the peering location that the ExpressRoutePort is mapped to + * physically. + * + * @return the peeringLocation value. + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peeringLocation property: The name of the peering location that the ExpressRoutePort is mapped to + * physically. + * + * @param peeringLocation the peeringLocation value to set. + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the bandwidthInGbps property: Bandwidth of procured ports in Gbps. + * + * @return the bandwidthInGbps value. + */ + public Integer bandwidthInGbps() { + return this.bandwidthInGbps; + } + + /** + * Set the bandwidthInGbps property: Bandwidth of procured ports in Gbps. + * + * @param bandwidthInGbps the bandwidthInGbps value to set. + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withBandwidthInGbps(Integer bandwidthInGbps) { + this.bandwidthInGbps = bandwidthInGbps; + return this; + } + + /** + * Get the provisionedBandwidthInGbps property: Aggregate Gbps of associated circuit bandwidths. + * + * @return the provisionedBandwidthInGbps value. + */ + public Float provisionedBandwidthInGbps() { + return this.provisionedBandwidthInGbps; + } + + /** + * Get the mtu property: Maximum transmission unit of the physical port pair(s). + * + * @return the mtu value. + */ + public String mtu() { + return this.mtu; + } + + /** + * Get the encapsulation property: Encapsulation method on physical ports. + * + * @return the encapsulation value. + */ + public ExpressRoutePortsEncapsulation encapsulation() { + return this.encapsulation; + } + + /** + * Set the encapsulation property: Encapsulation method on physical ports. + * + * @param encapsulation the encapsulation value to set. + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { + this.encapsulation = encapsulation; + return this; + } + + /** + * Get the etherType property: Ether type of the physical port. + * + * @return the etherType value. + */ + public String etherType() { + return this.etherType; + } + + /** + * Get the allocationDate property: Date of the physical port allocation to be used in Letter of Authorization. + * + * @return the allocationDate value. + */ + public String allocationDate() { + return this.allocationDate; + } + + /** + * Get the links property: The set of physical links of the ExpressRoutePort resource. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Set the links property: The set of physical links of the ExpressRoutePort resource. + * + * @param links the links value to set. + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withLinks(List links) { + this.links = links; + return this; + } + + /** + * Get the circuits property: Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort + * resource. + * + * @return the circuits value. + */ + public List circuits() { + return this.circuits; + } + + /** + * Get the provisioningState property: The provisioning state of the express route port resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: The resource GUID property of the express route port resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRoutePortInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRoutePortInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (links() != null) { + links().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationInner.java new file mode 100644 index 0000000000000..e8de30b7f320e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ExpressRoutePortsLocationBandwidths; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Definition of the ExpressRoutePorts peering location resource. */ +@JsonFlatten +@Fluent +public class ExpressRoutePortsLocationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationInner.class); + + /* + * Address of peering location. + */ + @JsonProperty(value = "properties.address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /* + * Contact details of peering locations. + */ + @JsonProperty(value = "properties.contact", access = JsonProperty.Access.WRITE_ONLY) + private String contact; + + /* + * The inventory of available ExpressRoutePort bandwidths. + */ + @JsonProperty(value = "properties.availableBandwidths") + private List availableBandwidths; + + /* + * The provisioning state of the express route port location resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the address property: Address of peering location. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Get the contact property: Contact details of peering locations. + * + * @return the contact value. + */ + public String contact() { + return this.contact; + } + + /** + * Get the availableBandwidths property: The inventory of available ExpressRoutePort bandwidths. + * + * @return the availableBandwidths value. + */ + public List availableBandwidths() { + return this.availableBandwidths; + } + + /** + * Set the availableBandwidths property: The inventory of available ExpressRoutePort bandwidths. + * + * @param availableBandwidths the availableBandwidths value to set. + * @return the ExpressRoutePortsLocationInner object itself. + */ + public ExpressRoutePortsLocationInner withAvailableBandwidths( + List availableBandwidths) { + this.availableBandwidths = availableBandwidths; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the express route port location resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ExpressRoutePortsLocationInner object itself. + */ + public ExpressRoutePortsLocationInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRoutePortsLocationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRoutePortsLocationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availableBandwidths() != null) { + availableBandwidths().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderInner.java new file mode 100644 index 0000000000000..c9e61b6ca0164 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderInner.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.network.generated.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.network.generated.models.ExpressRouteServiceProviderBandwidthsOffered; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A ExpressRouteResourceProvider object. */ +@JsonFlatten +@Fluent +public class ExpressRouteServiceProviderInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderInner.class); + + /* + * A list of peering locations. + */ + @JsonProperty(value = "properties.peeringLocations") + private List peeringLocations; + + /* + * A list of bandwidths offered. + */ + @JsonProperty(value = "properties.bandwidthsOffered") + private List bandwidthsOffered; + + /* + * The provisioning state of the express route service provider resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the peeringLocations property: A list of peering locations. + * + * @return the peeringLocations value. + */ + public List peeringLocations() { + return this.peeringLocations; + } + + /** + * Set the peeringLocations property: A list of peering locations. + * + * @param peeringLocations the peeringLocations value to set. + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withPeeringLocations(List peeringLocations) { + this.peeringLocations = peeringLocations; + return this; + } + + /** + * Get the bandwidthsOffered property: A list of bandwidths offered. + * + * @return the bandwidthsOffered value. + */ + public List bandwidthsOffered() { + return this.bandwidthsOffered; + } + + /** + * Set the bandwidthsOffered property: A list of bandwidths offered. + * + * @param bandwidthsOffered the bandwidthsOffered value to set. + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withBandwidthsOffered( + List bandwidthsOffered) { + this.bandwidthsOffered = bandwidthsOffered; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the express route service provider resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteServiceProviderInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExpressRouteServiceProviderInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bandwidthsOffered() != null) { + bandwidthsOffered().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyInner.java new file mode 100644 index 0000000000000..f1ae0734ea079 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyInner.java @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySku; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyTransportSecurity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** FirewallPolicy Resource. */ +@JsonFlatten +@Fluent +public class FirewallPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The identity of the firewall policy. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * List of references to FirewallPolicyRuleCollectionGroups. + */ + @JsonProperty(value = "properties.ruleCollectionGroups", access = JsonProperty.Access.WRITE_ONLY) + private List ruleCollectionGroups; + + /* + * The provisioning state of the firewall policy resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The parent firewall policy from which rules are inherited. + */ + @JsonProperty(value = "properties.basePolicy") + private SubResource basePolicy; + + /* + * List of references to Azure Firewalls that this Firewall Policy is + * associated with. + */ + @JsonProperty(value = "properties.firewalls", access = JsonProperty.Access.WRITE_ONLY) + private List firewalls; + + /* + * List of references to Child Firewall Policies. + */ + @JsonProperty(value = "properties.childPolicies", access = JsonProperty.Access.WRITE_ONLY) + private List childPolicies; + + /* + * The operation mode for Threat Intelligence. + */ + @JsonProperty(value = "properties.threatIntelMode") + private AzureFirewallThreatIntelMode threatIntelMode; + + /* + * ThreatIntel Whitelist for Firewall Policy. + */ + @JsonProperty(value = "properties.threatIntelWhitelist") + private FirewallPolicyThreatIntelWhitelist threatIntelWhitelist; + + /* + * Insights on Firewall Policy. + */ + @JsonProperty(value = "properties.insights") + private FirewallPolicyInsights insights; + + /* + * The private IP addresses/IP ranges to which traffic will not be SNAT. + */ + @JsonProperty(value = "properties.snat") + private FirewallPolicySnat snat; + + /* + * DNS Proxy Settings definition. + */ + @JsonProperty(value = "properties.dnsSettings") + private DnsSettings dnsSettings; + + /* + * The configuration for Intrusion detection. + */ + @JsonProperty(value = "properties.intrusionDetection") + private FirewallPolicyIntrusionDetection intrusionDetection; + + /* + * TLS Configuration definition. + */ + @JsonProperty(value = "properties.transportSecurity") + private FirewallPolicyTransportSecurity transportSecurity; + + /* + * The Firewall Policy SKU. + */ + @JsonProperty(value = "properties.sku") + private FirewallPolicySku sku; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the identity property: The identity of the firewall policy. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the firewall policy. + * + * @param identity the identity value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the ruleCollectionGroups property: List of references to FirewallPolicyRuleCollectionGroups. + * + * @return the ruleCollectionGroups value. + */ + public List ruleCollectionGroups() { + return this.ruleCollectionGroups; + } + + /** + * Get the provisioningState property: The provisioning state of the firewall policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the basePolicy property: The parent firewall policy from which rules are inherited. + * + * @return the basePolicy value. + */ + public SubResource basePolicy() { + return this.basePolicy; + } + + /** + * Set the basePolicy property: The parent firewall policy from which rules are inherited. + * + * @param basePolicy the basePolicy value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withBasePolicy(SubResource basePolicy) { + this.basePolicy = basePolicy; + return this; + } + + /** + * Get the firewalls property: List of references to Azure Firewalls that this Firewall Policy is associated with. + * + * @return the firewalls value. + */ + public List firewalls() { + return this.firewalls; + } + + /** + * Get the childPolicies property: List of references to Child Firewall Policies. + * + * @return the childPolicies value. + */ + public List childPolicies() { + return this.childPolicies; + } + + /** + * Get the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @return the threatIntelMode value. + */ + public AzureFirewallThreatIntelMode threatIntelMode() { + return this.threatIntelMode; + } + + /** + * Set the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @param threatIntelMode the threatIntelMode value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { + this.threatIntelMode = threatIntelMode; + return this; + } + + /** + * Get the threatIntelWhitelist property: ThreatIntel Whitelist for Firewall Policy. + * + * @return the threatIntelWhitelist value. + */ + public FirewallPolicyThreatIntelWhitelist threatIntelWhitelist() { + return this.threatIntelWhitelist; + } + + /** + * Set the threatIntelWhitelist property: ThreatIntel Whitelist for Firewall Policy. + * + * @param threatIntelWhitelist the threatIntelWhitelist value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withThreatIntelWhitelist(FirewallPolicyThreatIntelWhitelist threatIntelWhitelist) { + this.threatIntelWhitelist = threatIntelWhitelist; + return this; + } + + /** + * Get the insights property: Insights on Firewall Policy. + * + * @return the insights value. + */ + public FirewallPolicyInsights insights() { + return this.insights; + } + + /** + * Set the insights property: Insights on Firewall Policy. + * + * @param insights the insights value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withInsights(FirewallPolicyInsights insights) { + this.insights = insights; + return this; + } + + /** + * Get the snat property: The private IP addresses/IP ranges to which traffic will not be SNAT. + * + * @return the snat value. + */ + public FirewallPolicySnat snat() { + return this.snat; + } + + /** + * Set the snat property: The private IP addresses/IP ranges to which traffic will not be SNAT. + * + * @param snat the snat value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withSnat(FirewallPolicySnat snat) { + this.snat = snat; + return this; + } + + /** + * Get the dnsSettings property: DNS Proxy Settings definition. + * + * @return the dnsSettings value. + */ + public DnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: DNS Proxy Settings definition. + * + * @param dnsSettings the dnsSettings value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withDnsSettings(DnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the intrusionDetection property: The configuration for Intrusion detection. + * + * @return the intrusionDetection value. + */ + public FirewallPolicyIntrusionDetection intrusionDetection() { + return this.intrusionDetection; + } + + /** + * Set the intrusionDetection property: The configuration for Intrusion detection. + * + * @param intrusionDetection the intrusionDetection value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withIntrusionDetection(FirewallPolicyIntrusionDetection intrusionDetection) { + this.intrusionDetection = intrusionDetection; + return this; + } + + /** + * Get the transportSecurity property: TLS Configuration definition. + * + * @return the transportSecurity value. + */ + public FirewallPolicyTransportSecurity transportSecurity() { + return this.transportSecurity; + } + + /** + * Set the transportSecurity property: TLS Configuration definition. + * + * @param transportSecurity the transportSecurity value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withTransportSecurity(FirewallPolicyTransportSecurity transportSecurity) { + this.transportSecurity = transportSecurity; + return this; + } + + /** + * Get the sku property: The Firewall Policy SKU. + * + * @return the sku value. + */ + public FirewallPolicySku sku() { + return this.sku; + } + + /** + * Set the sku property: The Firewall Policy SKU. + * + * @param sku the sku value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withSku(FirewallPolicySku sku) { + this.sku = sku; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (threatIntelWhitelist() != null) { + threatIntelWhitelist().validate(); + } + if (insights() != null) { + insights().validate(); + } + if (snat() != null) { + snat().validate(); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (intrusionDetection() != null) { + intrusionDetection().validate(); + } + if (transportSecurity() != null) { + transportSecurity().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupInner.java new file mode 100644 index 0000000000000..4dcae164bd44c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rule Collection Group resource. */ +@JsonFlatten +@Fluent +public class FirewallPolicyRuleCollectionGroupInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollectionGroupInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Rule Group type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Priority of the Firewall Policy Rule Collection Group resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /* + * Group of Firewall Policy rule collections. + */ + @JsonProperty(value = "properties.ruleCollections") + private List ruleCollections; + + /* + * The provisioning state of the firewall policy rule collection group + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the FirewallPolicyRuleCollectionGroupInner object itself. + */ + public FirewallPolicyRuleCollectionGroupInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Rule Group type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the priority property: Priority of the Firewall Policy Rule Collection Group resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the Firewall Policy Rule Collection Group resource. + * + * @param priority the priority value to set. + * @return the FirewallPolicyRuleCollectionGroupInner object itself. + */ + public FirewallPolicyRuleCollectionGroupInner withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the ruleCollections property: Group of Firewall Policy rule collections. + * + * @return the ruleCollections value. + */ + public List ruleCollections() { + return this.ruleCollections; + } + + /** + * Set the ruleCollections property: Group of Firewall Policy rule collections. + * + * @param ruleCollections the ruleCollections value to set. + * @return the FirewallPolicyRuleCollectionGroupInner object itself. + */ + public FirewallPolicyRuleCollectionGroupInner withRuleCollections( + List ruleCollections) { + this.ruleCollections = ruleCollections; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the firewall policy rule collection group resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyRuleCollectionGroupInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleCollections() != null) { + ruleCollections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInformationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInformationInner.java new file mode 100644 index 0000000000000..13f2185abdc07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInformationInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information on the configuration of flow log and traffic analytics (optional) . */ +@JsonFlatten +@Fluent +public class FlowLogInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogInformationInner.class); + + /* + * The ID of the resource to configure for flow log and traffic analytics + * (optional) . + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * Parameters that define the configuration of traffic analytics. + */ + @JsonProperty(value = "flowAnalyticsConfiguration") + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /* + * ID of the storage account which is used to store the flow log. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /* + * Flag to enable/disable flow logging. + */ + @JsonProperty(value = "properties.enabled", required = true) + private boolean enabled; + + /* + * Parameters that define the retention policy for flow log. + */ + @JsonProperty(value = "properties.retentionPolicy") + private RetentionPolicyParameters retentionPolicy; + + /* + * Parameters that define the flow log format. + */ + @JsonProperty(value = "properties.format") + private FlowLogFormatParameters format; + + /** + * Get the targetResourceId property: The ID of the resource to configure for flow log and traffic analytics + * (optional) . + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The ID of the resource to configure for flow log and traffic analytics + * (optional) . + * + * @param targetResourceId the targetResourceId value to set. + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. + * + * @return the flowAnalyticsConfiguration value. + */ + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.flowAnalyticsConfiguration; + } + + /** + * Set the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. + * + * @param flowAnalyticsConfiguration the flowAnalyticsConfiguration value to set. + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withFlowAnalyticsConfiguration( + TrafficAnalyticsProperties flowAnalyticsConfiguration) { + this.flowAnalyticsConfiguration = flowAnalyticsConfiguration; + return this; + } + + /** + * Get the storageId property: ID of the storage account which is used to store the flow log. + * + * @return the storageId value. + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the storageId property: ID of the storage account which is used to store the flow log. + * + * @param storageId the storageId value to set. + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the enabled property: Flag to enable/disable flow logging. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Flag to enable/disable flow logging. + * + * @param enabled the enabled value to set. + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the retentionPolicy property: Parameters that define the retention policy for flow log. + * + * @return the retentionPolicy value. + */ + public RetentionPolicyParameters retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: Parameters that define the retention policy for flow log. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get the format property: Parameters that define the flow log format. + * + * @return the format value. + */ + public FlowLogFormatParameters format() { + return this.format; + } + + /** + * Set the format property: Parameters that define the flow log format. + * + * @param format the format value to set. + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withFormat(FlowLogFormatParameters format) { + this.format = format; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model FlowLogInformationInner")); + } + if (flowAnalyticsConfiguration() != null) { + flowAnalyticsConfiguration().validate(); + } + if (storageId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageId in model FlowLogInformationInner")); + } + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + if (format() != null) { + format().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInner.java new file mode 100644 index 0000000000000..5f8ab02bf9e1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInner.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A flow log resource. */ +@JsonFlatten +@Fluent +public class FlowLogInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * ID of network security group to which flow log will be applied. + */ + @JsonProperty(value = "properties.targetResourceId") + private String targetResourceId; + + /* + * Guid of network security group to which flow log will be applied. + */ + @JsonProperty(value = "properties.targetResourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceGuid; + + /* + * ID of the storage account which is used to store the flow log. + */ + @JsonProperty(value = "properties.storageId") + private String storageId; + + /* + * Flag to enable/disable flow logging. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /* + * Parameters that define the retention policy for flow log. + */ + @JsonProperty(value = "properties.retentionPolicy") + private RetentionPolicyParameters retentionPolicy; + + /* + * Parameters that define the flow log format. + */ + @JsonProperty(value = "properties.format") + private FlowLogFormatParameters format; + + /* + * Parameters that define the configuration of traffic analytics. + */ + @JsonProperty(value = "properties.flowAnalyticsConfiguration") + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /* + * The provisioning state of the flow log. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the targetResourceId property: ID of network security group to which flow log will be applied. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: ID of network security group to which flow log will be applied. + * + * @param targetResourceId the targetResourceId value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the targetResourceGuid property: Guid of network security group to which flow log will be applied. + * + * @return the targetResourceGuid value. + */ + public String targetResourceGuid() { + return this.targetResourceGuid; + } + + /** + * Get the storageId property: ID of the storage account which is used to store the flow log. + * + * @return the storageId value. + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the storageId property: ID of the storage account which is used to store the flow log. + * + * @param storageId the storageId value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the enabled property: Flag to enable/disable flow logging. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Flag to enable/disable flow logging. + * + * @param enabled the enabled value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the retentionPolicy property: Parameters that define the retention policy for flow log. + * + * @return the retentionPolicy value. + */ + public RetentionPolicyParameters retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: Parameters that define the retention policy for flow log. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get the format property: Parameters that define the flow log format. + * + * @return the format value. + */ + public FlowLogFormatParameters format() { + return this.format; + } + + /** + * Set the format property: Parameters that define the flow log format. + * + * @param format the format value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withFormat(FlowLogFormatParameters format) { + this.format = format; + return this; + } + + /** + * Get the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. + * + * @return the flowAnalyticsConfiguration value. + */ + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.flowAnalyticsConfiguration; + } + + /** + * Set the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. + * + * @param flowAnalyticsConfiguration the flowAnalyticsConfiguration value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration) { + this.flowAnalyticsConfiguration = flowAnalyticsConfiguration; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the flow log. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public FlowLogInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public FlowLogInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + if (format() != null) { + format().validate(); + } + if (flowAnalyticsConfiguration() != null) { + flowAnalyticsConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationInner.java new file mode 100644 index 0000000000000..a0bfd1abe0fb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationInner.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Frontend IP address of the load balancer. */ +@JsonFlatten +@Fluent +public class FrontendIpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontendIpConfigurationInner.class); + + /* + * The name of the resource that is unique within the set of frontend IP + * configurations used by the load balancer. This name can be used to + * access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * An array of references to inbound rules that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatRules", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatRules; + + /* + * An array of references to inbound pools that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatPools", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatPools; + + /* + * An array of references to outbound rules that use this frontend IP. + */ + @JsonProperty(value = "properties.outboundRules", access = JsonProperty.Access.WRITE_ONLY) + private List outboundRules; + + /* + * An array of references to load balancing rules that use this frontend + * IP. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIpAddress; + + /* + * The Private IP allocation method. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken + * as IPv4. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IpVersion privateIpAddressVersion; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /* + * The reference to the Public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIpAddressInner publicIpAddress; + + /* + * The reference to the Public IP Prefix resource. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIpPrefix; + + /* + * The reference to gateway load balancer frontend IP. + */ + @JsonProperty(value = "properties.gatewayLoadBalancer") + private SubResource gatewayLoadBalancer; + + /* + * The provisioning state of the frontend IP configuration resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within the set of frontend IP configurations used + * by the load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the set of frontend IP configurations used + * by the load balancer. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the FrontendIpConfigurationInner object itself. + */ + public FrontendIpConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @param zones the zones value to set. + * @return the FrontendIpConfigurationInner object itself. + */ + public FrontendIpConfigurationInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the inboundNatRules property: An array of references to inbound rules that use this frontend IP. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Get the inboundNatPools property: An array of references to inbound pools that use this frontend IP. + * + * @return the inboundNatPools value. + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Get the outboundRules property: An array of references to outbound rules that use this frontend IP. + * + * @return the outboundRules value. + */ + public List outboundRules() { + return this.outboundRules; + } + + /** + * Get the loadBalancingRules property: An array of references to load balancing rules that use this frontend IP. + * + * @return the loadBalancingRules value. + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the FrontendIpConfigurationInner object itself. + */ + public FrontendIpConfigurationInner withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: The Private IP allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: The Private IP allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the FrontendIpConfigurationInner object itself. + */ + public FrontendIpConfigurationInner withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the privateIpAddressVersion property: Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken + * as IPv4. + * + * @return the privateIpAddressVersion value. + */ + public IpVersion privateIpAddressVersion() { + return this.privateIpAddressVersion; + } + + /** + * Set the privateIpAddressVersion property: Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken + * as IPv4. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the FrontendIpConfigurationInner object itself. + */ + public FrontendIpConfigurationInner withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { + this.privateIpAddressVersion = privateIpAddressVersion; + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The reference to the subnet resource. + * + * @param subnet the subnet value to set. + * @return the FrontendIpConfigurationInner object itself. + */ + public FrontendIpConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the publicIpAddress property: The reference to the Public IP resource. + * + * @return the publicIpAddress value. + */ + public PublicIpAddressInner publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: The reference to the Public IP resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the FrontendIpConfigurationInner object itself. + */ + public FrontendIpConfigurationInner withPublicIpAddress(PublicIpAddressInner publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the publicIpPrefix property: The reference to the Public IP Prefix resource. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.publicIpPrefix; + } + + /** + * Set the publicIpPrefix property: The reference to the Public IP Prefix resource. + * + * @param publicIpPrefix the publicIpPrefix value to set. + * @return the FrontendIpConfigurationInner object itself. + */ + public FrontendIpConfigurationInner withPublicIpPrefix(SubResource publicIpPrefix) { + this.publicIpPrefix = publicIpPrefix; + return this; + } + + /** + * Get the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @return the gatewayLoadBalancer value. + */ + public SubResource gatewayLoadBalancer() { + return this.gatewayLoadBalancer; + } + + /** + * Set the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @param gatewayLoadBalancer the gatewayLoadBalancer value to set. + * @return the FrontendIpConfigurationInner object itself. + */ + public FrontendIpConfigurationInner withGatewayLoadBalancer(SubResource gatewayLoadBalancer) { + this.gatewayLoadBalancer = gatewayLoadBalancer; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the frontend IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public FrontendIpConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + if (publicIpAddress() != null) { + publicIpAddress().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GatewayRouteListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GatewayRouteListResultInner.java new file mode 100644 index 0000000000000..f835029558555 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GatewayRouteListResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.GatewayRoute; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of virtual network gateway routes. */ +@Fluent +public final class GatewayRouteListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayRouteListResultInner.class); + + /* + * List of gateway routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of gateway routes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of gateway routes. + * + * @param value the value value to set. + * @return the GatewayRouteListResultInner object itself. + */ + public GatewayRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GenerateExpressRoutePortsLoaResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GenerateExpressRoutePortsLoaResultInner.java new file mode 100644 index 0000000000000..8adad211a9a00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GenerateExpressRoutePortsLoaResultInner.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.network.generated.fluent.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; + +/** Response for GenerateExpressRoutePortsLOA API service call. */ +@Fluent +public final class GenerateExpressRoutePortsLoaResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenerateExpressRoutePortsLoaResultInner.class); + + /* + * The content as a base64 encoded string. + */ + @JsonProperty(value = "encodedContent") + private String encodedContent; + + /** + * Get the encodedContent property: The content as a base64 encoded string. + * + * @return the encodedContent value. + */ + public String encodedContent() { + return this.encodedContent; + } + + /** + * Set the encodedContent property: The content as a base64 encoded string. + * + * @param encodedContent the encodedContent value to set. + * @return the GenerateExpressRoutePortsLoaResultInner object itself. + */ + public GenerateExpressRoutePortsLoaResultInner withEncodedContent(String encodedContent) { + this.encodedContent = encodedContent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationInner.java new file mode 100644 index 0000000000000..166cb65144dae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IpConfigurations. */ +@JsonFlatten +@Fluent +public class HubIpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubIpConfigurationInner.class); + + /* + * Name of the Ip Configuration. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Ipconfiguration type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /* + * The reference to the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIpAddressInner publicIpAddress; + + /* + * The provisioning state of the IP configuration resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the Ip Configuration. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Ip Configuration. + * + * @param name the name value to set. + * @return the HubIpConfigurationInner object itself. + */ + public HubIpConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Ipconfiguration type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the HubIpConfigurationInner object itself. + */ + public HubIpConfigurationInner withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: The private IP address allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the HubIpConfigurationInner object itself. + */ + public HubIpConfigurationInner withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The reference to the subnet resource. + * + * @param subnet the subnet value to set. + * @return the HubIpConfigurationInner object itself. + */ + public HubIpConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + public PublicIpAddressInner publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: The reference to the public IP resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the HubIpConfigurationInner object itself. + */ + public HubIpConfigurationInner withPublicIpAddress(PublicIpAddressInner publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public HubIpConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + if (publicIpAddress() != null) { + publicIpAddress().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableInner.java new file mode 100644 index 0000000000000..271ffa24d19a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.HubRoute; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RouteTable resource in a virtual hub. */ +@JsonFlatten +@Fluent +public class HubRouteTableInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubRouteTableInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * List of all routes. + */ + @JsonProperty(value = "properties.routes") + private List routes; + + /* + * List of labels associated with this route table. + */ + @JsonProperty(value = "properties.labels") + private List labels; + + /* + * List of all connections associated with this route table. + */ + @JsonProperty(value = "properties.associatedConnections", access = JsonProperty.Access.WRITE_ONLY) + private List associatedConnections; + + /* + * List of all connections that advertise to this route table. + */ + @JsonProperty(value = "properties.propagatingConnections", access = JsonProperty.Access.WRITE_ONLY) + private List propagatingConnections; + + /* + * The provisioning state of the RouteTable resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the HubRouteTableInner object itself. + */ + public HubRouteTableInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the routes property: List of all routes. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: List of all routes. + * + * @param routes the routes value to set. + * @return the HubRouteTableInner object itself. + */ + public HubRouteTableInner withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Get the labels property: List of labels associated with this route table. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: List of labels associated with this route table. + * + * @param labels the labels value to set. + * @return the HubRouteTableInner object itself. + */ + public HubRouteTableInner withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the associatedConnections property: List of all connections associated with this route table. + * + * @return the associatedConnections value. + */ + public List associatedConnections() { + return this.associatedConnections; + } + + /** + * Get the propagatingConnections property: List of all connections that advertise to this route table. + * + * @return the propagatingConnections value. + */ + public List propagatingConnections() { + return this.propagatingConnections; + } + + /** + * Get the provisioningState property: The provisioning state of the RouteTable resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public HubRouteTableInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionInner.java new file mode 100644 index 0000000000000..38f98b43746f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionInner.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HubVirtualNetworkConnection Resource. */ +@JsonFlatten +@Fluent +public class HubVirtualNetworkConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Reference to the remote virtual network. + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /* + * Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + */ + @JsonProperty(value = "properties.allowHubToRemoteVnetTransit") + private Boolean allowHubToRemoteVnetTransit; + + /* + * Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. + */ + @JsonProperty(value = "properties.allowRemoteVnetToUseHubVnetGateways") + private Boolean allowRemoteVnetToUseHubVnetGateways; + + /* + * Enable internet security. + */ + @JsonProperty(value = "properties.enableInternetSecurity") + private Boolean enableInternetSecurity; + + /* + * The Routing Configuration indicating the associated and propagated route + * tables on this connection. + */ + @JsonProperty(value = "properties.routingConfiguration") + private RoutingConfiguration routingConfiguration; + + /* + * The provisioning state of the hub virtual network connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the remoteVirtualNetwork property: Reference to the remote virtual network. + * + * @return the remoteVirtualNetwork value. + */ + public SubResource remoteVirtualNetwork() { + return this.remoteVirtualNetwork; + } + + /** + * Set the remoteVirtualNetwork property: Reference to the remote virtual network. + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set. + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get the allowHubToRemoteVnetTransit property: Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + * + * @return the allowHubToRemoteVnetTransit value. + */ + public Boolean allowHubToRemoteVnetTransit() { + return this.allowHubToRemoteVnetTransit; + } + + /** + * Set the allowHubToRemoteVnetTransit property: Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + * + * @param allowHubToRemoteVnetTransit the allowHubToRemoteVnetTransit value to set. + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowHubToRemoteVnetTransit(Boolean allowHubToRemoteVnetTransit) { + this.allowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit; + return this; + } + + /** + * Get the allowRemoteVnetToUseHubVnetGateways property: Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. + * + * @return the allowRemoteVnetToUseHubVnetGateways value. + */ + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.allowRemoteVnetToUseHubVnetGateways; + } + + /** + * Set the allowRemoteVnetToUseHubVnetGateways property: Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. + * + * @param allowRemoteVnetToUseHubVnetGateways the allowRemoteVnetToUseHubVnetGateways value to set. + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowRemoteVnetToUseHubVnetGateways( + Boolean allowRemoteVnetToUseHubVnetGateways) { + this.allowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways; + return this; + } + + /** + * Get the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + public Boolean enableInternetSecurity() { + return this.enableInternetSecurity; + } + + /** + * Set the enableInternetSecurity property: Enable internet security. + * + * @param enableInternetSecurity the enableInternetSecurity value to set. + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.enableInternetSecurity = enableInternetSecurity; + return this; + } + + /** + * Get the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + public RoutingConfiguration routingConfiguration() { + return this.routingConfiguration; + } + + /** + * Set the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @param routingConfiguration the routingConfiguration value to set. + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withRoutingConfiguration(RoutingConfiguration routingConfiguration) { + this.routingConfiguration = routingConfiguration; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the hub virtual network connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public HubVirtualNetworkConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routingConfiguration() != null) { + routingConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRuleInner.java new file mode 100644 index 0000000000000..27d5cf6f2dfd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRuleInner.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Inbound NAT rule of the load balancer. */ +@JsonFlatten +@Fluent +public class InboundNatRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRuleInner.class); + + /* + * The name of the resource that is unique within the set of inbound NAT + * rules used by the load balancer. This name can be used to access the + * resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIpConfiguration; + + /* + * A reference to a private IP address defined on a network interface of a + * VM. Traffic sent to the frontend port of each of the frontend IP + * configurations is forwarded to the backend IP. + */ + @JsonProperty(value = "properties.backendIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private NetworkInterfaceIpConfigurationInner backendIpConfiguration; + + /* + * The reference to the transport protocol used by the load balancing rule. + */ + @JsonProperty(value = "properties.protocol") + private TransportProtocol protocol; + + /* + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values range from 1 to + * 65534. + */ + @JsonProperty(value = "properties.frontendPort") + private Integer frontendPort; + + /* + * The port used for the internal endpoint. Acceptable values range from 1 + * to 65535. + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /* + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIp; + + /* + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /* + * The provisioning state of the inbound NAT rule resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within the set of inbound NAT rules used by the + * load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the set of inbound NAT rules used by the + * load balancer. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @return the frontendIpConfiguration value. + */ + public SubResource frontendIpConfiguration() { + return this.frontendIpConfiguration; + } + + /** + * Set the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @param frontendIpConfiguration the frontendIpConfiguration value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendIpConfiguration(SubResource frontendIpConfiguration) { + this.frontendIpConfiguration = frontendIpConfiguration; + return this; + } + + /** + * Get the backendIpConfiguration property: A reference to a private IP address defined on a network interface of a + * VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. + * + * @return the backendIpConfiguration value. + */ + public NetworkInterfaceIpConfigurationInner backendIpConfiguration() { + return this.backendIpConfiguration; + } + + /** + * Get the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @return the protocol value. + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @param protocol the protocol value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @return the frontendPort value. + */ + public Integer frontendPort() { + return this.frontendPort; + } + + /** + * Set the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @param frontendPort the frontendPort value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendPort(Integer frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the backendPort property: The port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @return the backendPort value. + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the backendPort property: The port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @param backendPort the backendPort value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIp value. + */ + public Boolean enableFloatingIp() { + return this.enableFloatingIp; + } + + /** + * Set the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIp the enableFloatingIp value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEnableFloatingIp(Boolean enableFloatingIp) { + this.enableFloatingIp = enableFloatingIp; + return this; + } + + /** + * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value. + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the inbound NAT rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public InboundNatRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendIpConfiguration() != null) { + backendIpConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleInner.java new file mode 100644 index 0000000000000..b6cfbee808979 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NVA Inbound Security Rule resource. */ +@JsonFlatten +@Fluent +public class InboundSecurityRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundSecurityRuleInner.class); + + /* + * Name of security rule collection. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * NVA inbound security rule type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * List of allowed rules. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of security rule collection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of security rule collection. + * + * @param name the name value to set. + * @return the InboundSecurityRuleInner object itself. + */ + public InboundSecurityRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: NVA inbound security rule type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the rules property: List of allowed rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of allowed rules. + * + * @param rules the rules value to set. + * @return the InboundSecurityRuleInner object itself. + */ + public InboundSecurityRuleInner withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public InboundSecurityRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAddressAvailabilityResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAddressAvailabilityResultInner.java new file mode 100644 index 0000000000000..766b422ad4dd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAddressAvailabilityResultInner.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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; + +/** Response for CheckIPAddressAvailability API service call. */ +@Fluent +public final class IpAddressAvailabilityResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAddressAvailabilityResultInner.class); + + /* + * Private IP address availability. + */ + @JsonProperty(value = "available") + private Boolean available; + + /* + * Contains other available private IP addresses if the asked for address + * is taken. + */ + @JsonProperty(value = "availableIPAddresses") + private List availableIpAddresses; + + /* + * Private IP address platform reserved. + */ + @JsonProperty(value = "isPlatformReserved") + private Boolean isPlatformReserved; + + /** + * Get the available property: Private IP address availability. + * + * @return the available value. + */ + public Boolean available() { + return this.available; + } + + /** + * Set the available property: Private IP address availability. + * + * @param available the available value to set. + * @return the IpAddressAvailabilityResultInner object itself. + */ + public IpAddressAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + + /** + * Get the availableIpAddresses property: Contains other available private IP addresses if the asked for address is + * taken. + * + * @return the availableIpAddresses value. + */ + public List availableIpAddresses() { + return this.availableIpAddresses; + } + + /** + * Set the availableIpAddresses property: Contains other available private IP addresses if the asked for address is + * taken. + * + * @param availableIpAddresses the availableIpAddresses value to set. + * @return the IpAddressAvailabilityResultInner object itself. + */ + public IpAddressAvailabilityResultInner withAvailableIpAddresses(List availableIpAddresses) { + this.availableIpAddresses = availableIpAddresses; + return this; + } + + /** + * Get the isPlatformReserved property: Private IP address platform reserved. + * + * @return the isPlatformReserved value. + */ + public Boolean isPlatformReserved() { + return this.isPlatformReserved; + } + + /** + * Set the isPlatformReserved property: Private IP address platform reserved. + * + * @param isPlatformReserved the isPlatformReserved value to set. + * @return the IpAddressAvailabilityResultInner object itself. + */ + public IpAddressAvailabilityResultInner withIsPlatformReserved(Boolean isPlatformReserved) { + this.isPlatformReserved = isPlatformReserved; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationInner.java new file mode 100644 index 0000000000000..f8a4294afb22f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationInner.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** IpAllocation resource. */ +@JsonFlatten +@Fluent +public class IpAllocationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAllocationInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The Subnet that using the prefix of this IpAllocation resource. + */ + @JsonProperty(value = "properties.subnet", access = JsonProperty.Access.WRITE_ONLY) + private SubResource subnet; + + /* + * The VirtualNetwork that using the prefix of this IpAllocation resource. + */ + @JsonProperty(value = "properties.virtualNetwork", access = JsonProperty.Access.WRITE_ONLY) + private SubResource virtualNetwork; + + /* + * The type for the IpAllocation. + */ + @JsonProperty(value = "properties.type") + private IpAllocationType typePropertiesType; + + /* + * The address prefix for the IpAllocation. + */ + @JsonProperty(value = "properties.prefix") + private String prefix; + + /* + * The address prefix length for the IpAllocation. + */ + @JsonProperty(value = "properties.prefixLength") + private Integer prefixLength; + + /* + * The address prefix Type for the IpAllocation. + */ + @JsonProperty(value = "properties.prefixType") + private IpVersion prefixType; + + /* + * The IPAM allocation ID. + */ + @JsonProperty(value = "properties.ipamAllocationId") + private String ipamAllocationId; + + /* + * IpAllocation tags. + */ + @JsonProperty(value = "properties.allocationTags") + private Map allocationTags; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the subnet property: The Subnet that using the prefix of this IpAllocation resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Get the virtualNetwork property: The VirtualNetwork that using the prefix of this IpAllocation resource. + * + * @return the virtualNetwork value. + */ + public SubResource virtualNetwork() { + return this.virtualNetwork; + } + + /** + * Get the typePropertiesType property: The type for the IpAllocation. + * + * @return the typePropertiesType value. + */ + public IpAllocationType typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: The type for the IpAllocation. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the IpAllocationInner object itself. + */ + public IpAllocationInner withTypePropertiesType(IpAllocationType typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the prefix property: The address prefix for the IpAllocation. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The address prefix for the IpAllocation. + * + * @param prefix the prefix value to set. + * @return the IpAllocationInner object itself. + */ + public IpAllocationInner withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the prefixLength property: The address prefix length for the IpAllocation. + * + * @return the prefixLength value. + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Set the prefixLength property: The address prefix length for the IpAllocation. + * + * @param prefixLength the prefixLength value to set. + * @return the IpAllocationInner object itself. + */ + public IpAllocationInner withPrefixLength(Integer prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Get the prefixType property: The address prefix Type for the IpAllocation. + * + * @return the prefixType value. + */ + public IpVersion prefixType() { + return this.prefixType; + } + + /** + * Set the prefixType property: The address prefix Type for the IpAllocation. + * + * @param prefixType the prefixType value to set. + * @return the IpAllocationInner object itself. + */ + public IpAllocationInner withPrefixType(IpVersion prefixType) { + this.prefixType = prefixType; + return this; + } + + /** + * Get the ipamAllocationId property: The IPAM allocation ID. + * + * @return the ipamAllocationId value. + */ + public String ipamAllocationId() { + return this.ipamAllocationId; + } + + /** + * Set the ipamAllocationId property: The IPAM allocation ID. + * + * @param ipamAllocationId the ipamAllocationId value to set. + * @return the IpAllocationInner object itself. + */ + public IpAllocationInner withIpamAllocationId(String ipamAllocationId) { + this.ipamAllocationId = ipamAllocationId; + return this; + } + + /** + * Get the allocationTags property: IpAllocation tags. + * + * @return the allocationTags value. + */ + public Map allocationTags() { + return this.allocationTags; + } + + /** + * Set the allocationTags property: IpAllocation tags. + * + * @param allocationTags the allocationTags value to set. + * @return the IpAllocationInner object itself. + */ + public IpAllocationInner withAllocationTags(Map allocationTags) { + this.allocationTags = allocationTags; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the IpAllocationInner object itself. + */ + public IpAllocationInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public IpAllocationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IpAllocationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationInner.java new file mode 100644 index 0000000000000..8769753858618 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationInner.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration. */ +@JsonFlatten +@Fluent +public class IpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /* + * The reference to the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIpAddressInner publicIpAddress; + + /* + * The provisioning state of the IP configuration resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the IpConfigurationInner object itself. + */ + public IpConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the IpConfigurationInner object itself. + */ + public IpConfigurationInner withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: The private IP address allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the IpConfigurationInner object itself. + */ + public IpConfigurationInner withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The reference to the subnet resource. + * + * @param subnet the subnet value to set. + * @return the IpConfigurationInner object itself. + */ + public IpConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + public PublicIpAddressInner publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: The reference to the public IP resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the IpConfigurationInner object itself. + */ + public IpConfigurationInner withPublicIpAddress(PublicIpAddressInner publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public IpConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + if (publicIpAddress() != null) { + publicIpAddress().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfileInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfileInner.java new file mode 100644 index 0000000000000..3e2ccdbbb7dc0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfileInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration profile child resource. */ +@JsonFlatten +@Fluent +public class IpConfigurationProfileInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationProfileInner.class); + + /* + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The reference to the subnet resource to create a container network + * interface ip configuration. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /* + * The provisioning state of the IP configuration profile resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the IpConfigurationProfileInner object itself. + */ + public IpConfigurationProfileInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Sub Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the subnet property: The reference to the subnet resource to create a container network interface ip + * configuration. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The reference to the subnet resource to create a container network interface ip + * configuration. + * + * @param subnet the subnet value to set. + * @return the IpConfigurationProfileInner object itself. + */ + public IpConfigurationProfileInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the IP configuration profile resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public IpConfigurationProfileInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupInner.java new file mode 100644 index 0000000000000..4e3c0a5809306 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupInner.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The IpGroups resource information. */ +@JsonFlatten +@Fluent +public class IpGroupInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpGroupInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The provisioning state of the IpGroups resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * IpAddresses/IpAddressPrefixes in the IpGroups resource. + */ + @JsonProperty(value = "properties.ipAddresses") + private List ipAddresses; + + /* + * List of references to Firewall resources that this IpGroups is + * associated with. + */ + @JsonProperty(value = "properties.firewalls", access = JsonProperty.Access.WRITE_ONLY) + private List firewalls; + + /* + * List of references to Firewall Policies resources that this IpGroups is + * associated with. + */ + @JsonProperty(value = "properties.firewallPolicies", access = JsonProperty.Access.WRITE_ONLY) + private List firewallPolicies; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioningState property: The provisioning state of the IpGroups resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ipAddresses property: IpAddresses/IpAddressPrefixes in the IpGroups resource. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set the ipAddresses property: IpAddresses/IpAddressPrefixes in the IpGroups resource. + * + * @param ipAddresses the ipAddresses value to set. + * @return the IpGroupInner object itself. + */ + public IpGroupInner withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Get the firewalls property: List of references to Firewall resources that this IpGroups is associated with. + * + * @return the firewalls value. + */ + public List firewalls() { + return this.firewalls; + } + + /** + * Get the firewallPolicies property: List of references to Firewall Policies resources that this IpGroups is + * associated with. + * + * @return the firewallPolicies value. + */ + public List firewallPolicies() { + return this.firewallPolicies; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the IpGroupInner object itself. + */ + public IpGroupInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public IpGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IpGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerInner.java new file mode 100644 index 0000000000000..a0d7ef779f774 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerInner.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** LoadBalancer resource. */ +@JsonFlatten +@Fluent +public class LoadBalancerInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerInner.class); + + /* + * The extended location of the load balancer. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The load balancer SKU. + */ + @JsonProperty(value = "sku") + private LoadBalancerSku sku; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Object representing the frontend IPs to be used for the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIpConfigurations; + + /* + * Collection of backend address pools used by a load balancer. + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /* + * Object collection representing the load balancing rules Gets the + * provisioning. + */ + @JsonProperty(value = "properties.loadBalancingRules") + private List loadBalancingRules; + + /* + * Collection of probe objects used in the load balancer. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /* + * Collection of inbound NAT Rules used by a load balancer. Defining + * inbound NAT rules on your load balancer is mutually exclusive with + * defining an inbound NAT pool. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual + * virtual machines cannot reference an Inbound NAT pool. They have to + * reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatRules") + private List inboundNatRules; + + /* + * Defines an external port range for inbound NAT to a single backend port + * on NICs associated with a load balancer. Inbound NAT rules are created + * automatically for each NIC associated with the Load Balancer using an + * external port from this range. Defining an Inbound NAT pool on your Load + * Balancer is mutually exclusive with defining inbound Nat rules. Inbound + * NAT pools are referenced from virtual machine scale sets. NICs that are + * associated with individual virtual machines cannot reference an inbound + * NAT pool. They have to reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatPools") + private List inboundNatPools; + + /* + * The outbound rules. + */ + @JsonProperty(value = "properties.outboundRules") + private List outboundRules; + + /* + * The resource GUID property of the load balancer resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the load balancer resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the extendedLocation property: The extended location of the load balancer. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the load balancer. + * + * @param extendedLocation the extendedLocation value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the sku property: The load balancer SKU. + * + * @return the sku value. + */ + public LoadBalancerSku sku() { + return this.sku; + } + + /** + * Set the sku property: The load balancer SKU. + * + * @param sku the sku value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withSku(LoadBalancerSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the frontendIpConfigurations property: Object representing the frontend IPs to be used for the load balancer. + * + * @return the frontendIpConfigurations value. + */ + public List frontendIpConfigurations() { + return this.frontendIpConfigurations; + } + + /** + * Set the frontendIpConfigurations property: Object representing the frontend IPs to be used for the load balancer. + * + * @param frontendIpConfigurations the frontendIpConfigurations value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withFrontendIpConfigurations(List frontendIpConfigurations) { + this.frontendIpConfigurations = frontendIpConfigurations; + return this; + } + + /** + * Get the backendAddressPools property: Collection of backend address pools used by a load balancer. + * + * @return the backendAddressPools value. + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools property: Collection of backend address pools used by a load balancer. + * + * @param backendAddressPools the backendAddressPools value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get the loadBalancingRules property: Object collection representing the load balancing rules Gets the + * provisioning. + * + * @return the loadBalancingRules value. + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Set the loadBalancingRules property: Object collection representing the load balancing rules Gets the + * provisioning. + * + * @param loadBalancingRules the loadBalancingRules value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withLoadBalancingRules(List loadBalancingRules) { + this.loadBalancingRules = loadBalancingRules; + return this; + } + + /** + * Get the probes property: Collection of probe objects used in the load balancer. + * + * @return the probes value. + */ + public List probes() { + return this.probes; + } + + /** + * Set the probes property: Collection of probe objects used in the load balancer. + * + * @param probes the probes value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get the inboundNatRules property: Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT + * rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot + * reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Set the inboundNatRules property: Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT + * rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot + * reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatRules(List inboundNatRules) { + this.inboundNatRules = inboundNatRules; + return this; + } + + /** + * Get the inboundNatPools property: Defines an external port range for inbound NAT to a single backend port on NICs + * associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the + * Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is + * mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale + * sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @return the inboundNatPools value. + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Set the inboundNatPools property: Defines an external port range for inbound NAT to a single backend port on NICs + * associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the + * Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is + * mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale + * sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @param inboundNatPools the inboundNatPools value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatPools(List inboundNatPools) { + this.inboundNatPools = inboundNatPools; + return this; + } + + /** + * Get the outboundRules property: The outbound rules. + * + * @return the outboundRules value. + */ + public List outboundRules() { + return this.outboundRules; + } + + /** + * Set the outboundRules property: The outbound rules. + * + * @param outboundRules the outboundRules value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withOutboundRules(List outboundRules) { + this.outboundRules = outboundRules; + return this; + } + + /** + * Get the resourceGuid property: The resource GUID property of the load balancer resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the load balancer resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (frontendIpConfigurations() != null) { + frontendIpConfigurations().forEach(e -> e.validate()); + } + if (backendAddressPools() != null) { + backendAddressPools().forEach(e -> e.validate()); + } + if (loadBalancingRules() != null) { + loadBalancingRules().forEach(e -> e.validate()); + } + if (probes() != null) { + probes().forEach(e -> e.validate()); + } + if (inboundNatRules() != null) { + inboundNatRules().forEach(e -> e.validate()); + } + if (inboundNatPools() != null) { + inboundNatPools().forEach(e -> e.validate()); + } + if (outboundRules() != null) { + outboundRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRuleInner.java new file mode 100644 index 0000000000000..795c60ebce65c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRuleInner.java @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.LoadDistribution; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A load balancing rule for a load balancer. */ +@JsonFlatten +@Fluent +public class LoadBalancingRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingRuleInner.class); + + /* + * The name of the resource that is unique within the set of load balancing + * rules used by the load balancer. This name can be used to access the + * resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIpConfiguration; + + /* + * A reference to a pool of DIPs. Inbound traffic is randomly load balanced + * across IPs in the backend IPs. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /* + * An array of references to pool of DIPs. + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /* + * The reference to the load balancer probe used by the load balancing + * rule. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /* + * The reference to the transport protocol used by the load balancing rule. + */ + @JsonProperty(value = "properties.protocol") + private TransportProtocol protocol; + + /* + * The load distribution policy for this rule. + */ + @JsonProperty(value = "properties.loadDistribution") + private LoadDistribution loadDistribution; + + /* + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values are between 0 and + * 65534. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "properties.frontendPort") + private Integer frontendPort; + + /* + * The port used for internal connections on the endpoint. Acceptable + * values are between 0 and 65535. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /* + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIp; + + /* + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /* + * Configures SNAT for the VMs in the backend pool to use the publicIP + * address specified in the frontend of the load balancing rule. + */ + @JsonProperty(value = "properties.disableOutboundSnat") + private Boolean disableOutboundSnat; + + /* + * The provisioning state of the load balancing rule resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within the set of load balancing rules used by the + * load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the set of load balancing rules used by the + * load balancer. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @return the frontendIpConfiguration value. + */ + public SubResource frontendIpConfiguration() { + return this.frontendIpConfiguration; + } + + /** + * Set the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @param frontendIpConfiguration the frontendIpConfiguration value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withFrontendIpConfiguration(SubResource frontendIpConfiguration) { + this.frontendIpConfiguration = frontendIpConfiguration; + return this; + } + + /** + * Get the backendAddressPool property: A reference to a pool of DIPs. Inbound traffic is randomly load balanced + * across IPs in the backend IPs. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: A reference to a pool of DIPs. Inbound traffic is randomly load balanced + * across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendAddressPools property: An array of references to pool of DIPs. + * + * @return the backendAddressPools value. + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools property: An array of references to pool of DIPs. + * + * @param backendAddressPools the backendAddressPools value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get the probe property: The reference to the load balancer probe used by the load balancing rule. + * + * @return the probe value. + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set the probe property: The reference to the load balancer probe used by the load balancing rule. + * + * @param probe the probe value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @return the protocol value. + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @param protocol the protocol value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the loadDistribution property: The load distribution policy for this rule. + * + * @return the loadDistribution value. + */ + public LoadDistribution loadDistribution() { + return this.loadDistribution; + } + + /** + * Set the loadDistribution property: The load distribution policy for this rule. + * + * @param loadDistribution the loadDistribution value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withLoadDistribution(LoadDistribution loadDistribution) { + this.loadDistribution = loadDistribution; + return this; + } + + /** + * Get the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @return the frontendPort value. + */ + public Integer frontendPort() { + return this.frontendPort; + } + + /** + * Set the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @param frontendPort the frontendPort value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withFrontendPort(Integer frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the backendPort property: The port used for internal connections on the endpoint. Acceptable values are + * between 0 and 65535. Note that value 0 enables "Any Port". + * + * @return the backendPort value. + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the backendPort property: The port used for internal connections on the endpoint. Acceptable values are + * between 0 and 65535. Note that value 0 enables "Any Port". + * + * @param backendPort the backendPort value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIp value. + */ + public Boolean enableFloatingIp() { + return this.enableFloatingIp; + } + + /** + * Set the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIp the enableFloatingIp value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEnableFloatingIp(Boolean enableFloatingIp) { + this.enableFloatingIp = enableFloatingIp; + return this; + } + + /** + * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value. + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get the disableOutboundSnat property: Configures SNAT for the VMs in the backend pool to use the publicIP address + * specified in the frontend of the load balancing rule. + * + * @return the disableOutboundSnat value. + */ + public Boolean disableOutboundSnat() { + return this.disableOutboundSnat; + } + + /** + * Set the disableOutboundSnat property: Configures SNAT for the VMs in the backend pool to use the publicIP address + * specified in the frontend of the load balancing rule. + * + * @param disableOutboundSnat the disableOutboundSnat value to set. + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withDisableOutboundSnat(Boolean disableOutboundSnat) { + this.disableOutboundSnat = disableOutboundSnat; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the load balancing rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancingRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayInner.java new file mode 100644 index 0000000000000..f432e99a18ef8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayInner.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A common class for general resource information. */ +@JsonFlatten +@Fluent +public class LocalNetworkGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewayInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Local network site address space. + */ + @JsonProperty(value = "properties.localNetworkAddressSpace") + private AddressSpace localNetworkAddressSpace; + + /* + * IP address of local network gateway. + */ + @JsonProperty(value = "properties.gatewayIpAddress") + private String gatewayIpAddress; + + /* + * FQDN of local network gateway. + */ + @JsonProperty(value = "properties.fqdn") + private String fqdn; + + /* + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /* + * The resource GUID property of the local network gateway resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the local network gateway resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the localNetworkAddressSpace property: Local network site address space. + * + * @return the localNetworkAddressSpace value. + */ + public AddressSpace localNetworkAddressSpace() { + return this.localNetworkAddressSpace; + } + + /** + * Set the localNetworkAddressSpace property: Local network site address space. + * + * @param localNetworkAddressSpace the localNetworkAddressSpace value to set. + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.localNetworkAddressSpace = localNetworkAddressSpace; + return this; + } + + /** + * Get the gatewayIpAddress property: IP address of local network gateway. + * + * @return the gatewayIpAddress value. + */ + public String gatewayIpAddress() { + return this.gatewayIpAddress; + } + + /** + * Set the gatewayIpAddress property: IP address of local network gateway. + * + * @param gatewayIpAddress the gatewayIpAddress value to set. + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withGatewayIpAddress(String gatewayIpAddress) { + this.gatewayIpAddress = gatewayIpAddress; + return this; + } + + /** + * Get the fqdn property: FQDN of local network gateway. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: FQDN of local network gateway. + * + * @param fqdn the fqdn value to set. + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the bgpSettings property: Local network gateway's BGP speaker settings. + * + * @return the bgpSettings value. + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set the bgpSettings property: Local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set. + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the resourceGuid property: The resource GUID property of the local network gateway resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the local network gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public LocalNetworkGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LocalNetworkGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (localNetworkAddressSpace() != null) { + localNetworkAddressSpace().validate(); + } + if (bgpSettings() != null) { + bgpSettings().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayInner.java new file mode 100644 index 0000000000000..b151a2b146fa3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayInner.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NatGatewaySku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Nat Gateway resource. */ +@JsonFlatten +@Fluent +public class NatGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatGatewayInner.class); + + /* + * The nat gateway SKU. + */ + @JsonProperty(value = "sku") + private NatGatewaySku sku; + + /* + * A list of availability zones denoting the zone in which Nat Gateway + * should be deployed. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The idle timeout of the nat gateway. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * An array of public ip addresses associated with the nat gateway + * resource. + */ + @JsonProperty(value = "properties.publicIpAddresses") + private List publicIpAddresses; + + /* + * An array of public ip prefixes associated with the nat gateway resource. + */ + @JsonProperty(value = "properties.publicIpPrefixes") + private List publicIpPrefixes; + + /* + * An array of references to the subnets using this nat gateway resource. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /* + * The resource GUID property of the NAT gateway resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the NAT gateway resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the sku property: The nat gateway SKU. + * + * @return the sku value. + */ + public NatGatewaySku sku() { + return this.sku; + } + + /** + * Set the sku property: The nat gateway SKU. + * + * @param sku the sku value to set. + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withSku(NatGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get the zones property: A list of availability zones denoting the zone in which Nat Gateway should be deployed. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting the zone in which Nat Gateway should be deployed. + * + * @param zones the zones value to set. + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the nat gateway. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The idle timeout of the nat gateway. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the publicIpAddresses property: An array of public ip addresses associated with the nat gateway resource. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Set the publicIpAddresses property: An array of public ip addresses associated with the nat gateway resource. + * + * @param publicIpAddresses the publicIpAddresses value to set. + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withPublicIpAddresses(List publicIpAddresses) { + this.publicIpAddresses = publicIpAddresses; + return this; + } + + /** + * Get the publicIpPrefixes property: An array of public ip prefixes associated with the nat gateway resource. + * + * @return the publicIpPrefixes value. + */ + public List publicIpPrefixes() { + return this.publicIpPrefixes; + } + + /** + * Set the publicIpPrefixes property: An array of public ip prefixes associated with the nat gateway resource. + * + * @param publicIpPrefixes the publicIpPrefixes value to set. + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withPublicIpPrefixes(List publicIpPrefixes) { + this.publicIpPrefixes = publicIpPrefixes; + return this; + } + + /** + * Get the subnets property: An array of references to the subnets using this nat gateway resource. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the resourceGuid property: The resource GUID property of the NAT gateway resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the NAT gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public NatGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NatGatewayInner 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) { + sku().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkConfigurationDiagnosticResponseInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkConfigurationDiagnosticResponseInner.java new file mode 100644 index 0000000000000..93ca7fbb26691 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkConfigurationDiagnosticResponseInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Results of network configuration diagnostic on the target resource. */ +@Immutable +public final class NetworkConfigurationDiagnosticResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticResponseInner.class); + + /* + * List of network configuration diagnostic results. + */ + @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Get the results property: List of network configuration diagnostic results. + * + * @return the results value. + */ + public List results() { + return this.results; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (results() != null) { + results().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceInner.java new file mode 100644 index 0000000000000..8a4c36d7a1a09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceInner.java @@ -0,0 +1,509 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceDnsSettings; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceMigrationPhase; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceNicType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A network interface in a resource group. */ +@JsonFlatten +@Fluent +public class NetworkInterfaceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceInner.class); + + /* + * The extended location of the network interface. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The reference to a virtual machine. + */ + @JsonProperty(value = "properties.virtualMachine", access = JsonProperty.Access.WRITE_ONLY) + private SubResource virtualMachine; + + /* + * The reference to the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /* + * A reference to the private endpoint to which the network interface is + * linked. + */ + @JsonProperty(value = "properties.privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointInner privateEndpoint; + + /* + * A list of IPConfigurations of the network interface. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * A list of TapConfigurations of the network interface. + */ + @JsonProperty(value = "properties.tapConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List tapConfigurations; + + /* + * The DNS settings in network interface. + */ + @JsonProperty(value = "properties.dnsSettings") + private NetworkInterfaceDnsSettings dnsSettings; + + /* + * The MAC address of the network interface. + */ + @JsonProperty(value = "properties.macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * Whether this is a primary network interface on a virtual machine. + */ + @JsonProperty(value = "properties.primary", access = JsonProperty.Access.WRITE_ONLY) + private Boolean primary; + + /* + * If the network interface is accelerated networking enabled. + */ + @JsonProperty(value = "properties.enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * Indicates whether IP forwarding is enabled on this network interface. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIpForwarding; + + /* + * A list of references to linked BareMetal resources. + */ + @JsonProperty(value = "properties.hostedWorkloads", access = JsonProperty.Access.WRITE_ONLY) + private List hostedWorkloads; + + /* + * A reference to the dscp configuration to which the network interface is + * linked. + */ + @JsonProperty(value = "properties.dscpConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private SubResource dscpConfiguration; + + /* + * The resource GUID property of the network interface resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the network interface resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * WorkloadType of the NetworkInterface for BareMetal resources + */ + @JsonProperty(value = "properties.workloadType") + private String workloadType; + + /* + * Type of Network Interface resource. + */ + @JsonProperty(value = "properties.nicType") + private NetworkInterfaceNicType nicType; + + /* + * Privatelinkservice of the network interface resource. + */ + @JsonProperty(value = "properties.privateLinkService") + private PrivateLinkServiceInner privateLinkService; + + /* + * Migration phase of Network Interface resource. + */ + @JsonProperty(value = "properties.migrationPhase") + private NetworkInterfaceMigrationPhase migrationPhase; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the extendedLocation property: The extended location of the network interface. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the network interface. + * + * @param extendedLocation the extendedLocation value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the virtualMachine property: The reference to a virtual machine. + * + * @return the virtualMachine value. + */ + public SubResource virtualMachine() { + return this.virtualMachine; + } + + /** + * Get the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value. + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the privateEndpoint property: A reference to the private endpoint to which the network interface is linked. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointInner privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Get the ipConfigurations property: A list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: A list of IPConfigurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the tapConfigurations property: A list of TapConfigurations of the network interface. + * + * @return the tapConfigurations value. + */ + public List tapConfigurations() { + return this.tapConfigurations; + } + + /** + * Get the dnsSettings property: The DNS settings in network interface. + * + * @return the dnsSettings value. + */ + public NetworkInterfaceDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The DNS settings in network interface. + * + * @param dnsSettings the dnsSettings value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the macAddress property: The MAC address of the network interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the primary property: Whether this is a primary network interface on a virtual machine. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Get the enableAcceleratedNetworking property: If the network interface is accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set the enableAcceleratedNetworking property: If the network interface is accelerated networking enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.enableIpForwarding; + } + + /** + * Set the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. + * + * @param enableIpForwarding the enableIpForwarding value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableIpForwarding(Boolean enableIpForwarding) { + this.enableIpForwarding = enableIpForwarding; + return this; + } + + /** + * Get the hostedWorkloads property: A list of references to linked BareMetal resources. + * + * @return the hostedWorkloads value. + */ + public List hostedWorkloads() { + return this.hostedWorkloads; + } + + /** + * Get the dscpConfiguration property: A reference to the dscp configuration to which the network interface is + * linked. + * + * @return the dscpConfiguration value. + */ + public SubResource dscpConfiguration() { + return this.dscpConfiguration; + } + + /** + * Get the resourceGuid property: The resource GUID property of the network interface resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the network interface resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the workloadType property: WorkloadType of the NetworkInterface for BareMetal resources. + * + * @return the workloadType value. + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: WorkloadType of the NetworkInterface for BareMetal resources. + * + * @param workloadType the workloadType value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the nicType property: Type of Network Interface resource. + * + * @return the nicType value. + */ + public NetworkInterfaceNicType nicType() { + return this.nicType; + } + + /** + * Set the nicType property: Type of Network Interface resource. + * + * @param nicType the nicType value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withNicType(NetworkInterfaceNicType nicType) { + this.nicType = nicType; + return this; + } + + /** + * Get the privateLinkService property: Privatelinkservice of the network interface resource. + * + * @return the privateLinkService value. + */ + public PrivateLinkServiceInner privateLinkService() { + return this.privateLinkService; + } + + /** + * Set the privateLinkService property: Privatelinkservice of the network interface resource. + * + * @param privateLinkService the privateLinkService value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withPrivateLinkService(PrivateLinkServiceInner privateLinkService) { + this.privateLinkService = privateLinkService; + return this; + } + + /** + * Get the migrationPhase property: Migration phase of Network Interface resource. + * + * @return the migrationPhase value. + */ + public NetworkInterfaceMigrationPhase migrationPhase() { + return this.migrationPhase; + } + + /** + * Set the migrationPhase property: Migration phase of Network Interface resource. + * + * @param migrationPhase the migrationPhase value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withMigrationPhase(NetworkInterfaceMigrationPhase migrationPhase) { + this.migrationPhase = migrationPhase; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (networkSecurityGroup() != null) { + networkSecurityGroup().validate(); + } + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (tapConfigurations() != null) { + tapConfigurations().forEach(e -> e.validate()); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (privateLinkService() != null) { + privateLinkService().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationInner.java new file mode 100644 index 0000000000000..ee960eef4055a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IPConfiguration in a network interface. */ +@JsonFlatten +@Fluent +public class NetworkInterfaceIpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The reference to gateway load balancer frontend IP. + */ + @JsonProperty(value = "properties.gatewayLoadBalancer") + private SubResource gatewayLoadBalancer; + + /* + * The reference to Virtual Network Taps. + */ + @JsonProperty(value = "properties.virtualNetworkTaps") + private List virtualNetworkTaps; + + /* + * The reference to ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /* + * The reference to LoadBalancerBackendAddressPool resource. + */ + @JsonProperty(value = "properties.loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /* + * A list of references of LoadBalancerInboundNatRules. + */ + @JsonProperty(value = "properties.loadBalancerInboundNatRules") + private List loadBalancerInboundNatRules; + + /* + * Private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IpVersion privateIpAddressVersion; + + /* + * Subnet bound to the IP configuration. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /* + * Whether this is a primary customer address on the network interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * Public IP address bound to the IP configuration. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIpAddressInner publicIpAddress; + + /* + * Application security groups in which the IP configuration is included. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /* + * The provisioning state of the network interface IP configuration. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * PrivateLinkConnection properties for the network interface. + */ + @JsonProperty(value = "properties.privateLinkConnectionProperties", access = JsonProperty.Access.WRITE_ONLY) + private NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. + * + * @param type the type value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @return the gatewayLoadBalancer value. + */ + public SubResource gatewayLoadBalancer() { + return this.gatewayLoadBalancer; + } + + /** + * Set the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @param gatewayLoadBalancer the gatewayLoadBalancer value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withGatewayLoadBalancer(SubResource gatewayLoadBalancer) { + this.gatewayLoadBalancer = gatewayLoadBalancer; + return this; + } + + /** + * Get the virtualNetworkTaps property: The reference to Virtual Network Taps. + * + * @return the virtualNetworkTaps value. + */ + public List virtualNetworkTaps() { + return this.virtualNetworkTaps; + } + + /** + * Set the virtualNetworkTaps property: The reference to Virtual Network Taps. + * + * @param virtualNetworkTaps the virtualNetworkTaps value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withVirtualNetworkTaps( + List virtualNetworkTaps) { + this.virtualNetworkTaps = virtualNetworkTaps; + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: The reference to ApplicationGatewayBackendAddressPool + * resource. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the applicationGatewayBackendAddressPools property: The reference to ApplicationGatewayBackendAddressPool + * resource. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withApplicationGatewayBackendAddressPools( + List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: The reference to LoadBalancerBackendAddressPool resource. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the loadBalancerBackendAddressPools property: The reference to LoadBalancerBackendAddressPool resource. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withLoadBalancerBackendAddressPools( + List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Get the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. + * + * @return the loadBalancerInboundNatRules value. + */ + public List loadBalancerInboundNatRules() { + return this.loadBalancerInboundNatRules; + } + + /** + * Set the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. + * + * @param loadBalancerInboundNatRules the loadBalancerInboundNatRules value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withLoadBalancerInboundNatRules( + List loadBalancerInboundNatRules) { + this.loadBalancerInboundNatRules = loadBalancerInboundNatRules; + return this; + } + + /** + * Get the privateIpAddress property: Private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: The private IP address allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withPrivateIpAllocationMethod( + IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + * + * @return the privateIpAddressVersion value. + */ + public IpVersion privateIpAddressVersion() { + return this.privateIpAddressVersion; + } + + /** + * Set the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { + this.privateIpAddressVersion = privateIpAddressVersion; + return this; + } + + /** + * Get the subnet property: Subnet bound to the IP configuration. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Subnet bound to the IP configuration. + * + * @param subnet the subnet value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the primary property: Whether this is a primary customer address on the network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Whether this is a primary customer address on the network interface. + * + * @param primary the primary value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the publicIpAddress property: Public IP address bound to the IP configuration. + * + * @return the publicIpAddress value. + */ + public PublicIpAddressInner publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: Public IP address bound to the IP configuration. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withPublicIpAddress(PublicIpAddressInner publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the applicationSecurityGroups property: Application security groups in which the IP configuration is + * included. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set the applicationSecurityGroups property: Application security groups in which the IP configuration is + * included. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withApplicationSecurityGroups( + List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the network interface IP configuration. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateLinkConnectionProperties property: PrivateLinkConnection properties for the network interface. + * + * @return the privateLinkConnectionProperties value. + */ + public NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties() { + return this.privateLinkConnectionProperties; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfaceIpConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkTaps() != null) { + virtualNetworkTaps().forEach(e -> e.validate()); + } + if (applicationGatewayBackendAddressPools() != null) { + applicationGatewayBackendAddressPools().forEach(e -> e.validate()); + } + if (loadBalancerBackendAddressPools() != null) { + loadBalancerBackendAddressPools().forEach(e -> e.validate()); + } + if (loadBalancerInboundNatRules() != null) { + loadBalancerInboundNatRules().forEach(e -> e.validate()); + } + if (subnet() != null) { + subnet().validate(); + } + if (publicIpAddress() != null) { + publicIpAddress().validate(); + } + if (applicationSecurityGroups() != null) { + applicationSecurityGroups().forEach(e -> e.validate()); + } + if (privateLinkConnectionProperties() != null) { + privateLinkConnectionProperties().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationInner.java new file mode 100644 index 0000000000000..acc876ecd06b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Tap configuration in a Network Interface. */ +@JsonFlatten +@Fluent +public class NetworkInterfaceTapConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The reference to the Virtual Network Tap resource. + */ + @JsonProperty(value = "properties.virtualNetworkTap") + private VirtualNetworkTapInner virtualNetworkTap; + + /* + * The provisioning state of the network interface tap configuration + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the NetworkInterfaceTapConfigurationInner object itself. + */ + public NetworkInterfaceTapConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Sub Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the virtualNetworkTap property: The reference to the Virtual Network Tap resource. + * + * @return the virtualNetworkTap value. + */ + public VirtualNetworkTapInner virtualNetworkTap() { + return this.virtualNetworkTap; + } + + /** + * Set the virtualNetworkTap property: The reference to the Virtual Network Tap resource. + * + * @param virtualNetworkTap the virtualNetworkTap value to set. + * @return the NetworkInterfaceTapConfigurationInner object itself. + */ + public NetworkInterfaceTapConfigurationInner withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap) { + this.virtualNetworkTap = virtualNetworkTap; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the network interface tap configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfaceTapConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkTap() != null) { + virtualNetworkTap().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfileInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfileInner.java new file mode 100644 index 0000000000000..e290134f2df1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfileInner.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.network.generated.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.network.generated.models.ContainerNetworkInterface; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Network profile resource. */ +@JsonFlatten +@Fluent +public class NetworkProfileInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfileInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * List of child container network interfaces. + */ + @JsonProperty(value = "properties.containerNetworkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List containerNetworkInterfaces; + + /* + * List of chid container network interface configurations. + */ + @JsonProperty(value = "properties.containerNetworkInterfaceConfigurations") + private List containerNetworkInterfaceConfigurations; + + /* + * The resource GUID property of the network profile resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the network profile resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the containerNetworkInterfaces property: List of child container network interfaces. + * + * @return the containerNetworkInterfaces value. + */ + public List containerNetworkInterfaces() { + return this.containerNetworkInterfaces; + } + + /** + * Get the containerNetworkInterfaceConfigurations property: List of chid container network interface + * configurations. + * + * @return the containerNetworkInterfaceConfigurations value. + */ + public List containerNetworkInterfaceConfigurations() { + return this.containerNetworkInterfaceConfigurations; + } + + /** + * Set the containerNetworkInterfaceConfigurations property: List of chid container network interface + * configurations. + * + * @param containerNetworkInterfaceConfigurations the containerNetworkInterfaceConfigurations value to set. + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withContainerNetworkInterfaceConfigurations( + List containerNetworkInterfaceConfigurations) { + this.containerNetworkInterfaceConfigurations = containerNetworkInterfaceConfigurations; + return this; + } + + /** + * Get the resourceGuid property: The resource GUID property of the network profile resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the network profile resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containerNetworkInterfaces() != null) { + containerNetworkInterfaces().forEach(e -> e.validate()); + } + if (containerNetworkInterfaceConfigurations() != null) { + containerNetworkInterfaceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupInner.java new file mode 100644 index 0000000000000..9cebb50d37e48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupInner.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** NetworkSecurityGroup resource. */ +@JsonFlatten +@Fluent +public class NetworkSecurityGroupInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A collection of security rules of the network security group. + */ + @JsonProperty(value = "properties.securityRules") + private List securityRules; + + /* + * The default security rules of network security group. + */ + @JsonProperty(value = "properties.defaultSecurityRules", access = JsonProperty.Access.WRITE_ONLY) + private List defaultSecurityRules; + + /* + * A collection of references to network interfaces. + */ + @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /* + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /* + * A collection of references to flow log resources. + */ + @JsonProperty(value = "properties.flowLogs", access = JsonProperty.Access.WRITE_ONLY) + private List flowLogs; + + /* + * The resource GUID property of the network security group resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the network security group resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the securityRules property: A collection of security rules of the network security group. + * + * @return the securityRules value. + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set the securityRules property: A collection of security rules of the network security group. + * + * @param securityRules the securityRules value to set. + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** + * Get the defaultSecurityRules property: The default security rules of network security group. + * + * @return the defaultSecurityRules value. + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Get the networkInterfaces property: A collection of references to network interfaces. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get the subnets property: A collection of references to subnets. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the flowLogs property: A collection of references to flow log resources. + * + * @return the flowLogs value. + */ + public List flowLogs() { + return this.flowLogs; + } + + /** + * Get the resourceGuid property: The resource GUID property of the network security group resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the network security group resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkSecurityGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkSecurityGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityRules() != null) { + securityRules().forEach(e -> e.validate()); + } + if (defaultSecurityRules() != null) { + defaultSecurityRules().forEach(e -> e.validate()); + } + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + if (subnets() != null) { + subnets().forEach(e -> e.validate()); + } + if (flowLogs() != null) { + flowLogs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInner.java new file mode 100644 index 0000000000000..3e8b5ae37d4fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInner.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** NetworkVirtualAppliance Resource. */ +@JsonFlatten +@Fluent +public class NetworkVirtualApplianceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceInner.class); + + /* + * The service principal that has read access to cloud-init and config + * blob. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Network Virtual Appliance SKU. + */ + @JsonProperty(value = "properties.nvaSku") + private VirtualApplianceSkuProperties nvaSku; + + /* + * Address Prefix. + */ + @JsonProperty(value = "properties.addressPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String addressPrefix; + + /* + * BootStrapConfigurationBlobs storage URLs. + */ + @JsonProperty(value = "properties.bootStrapConfigurationBlobs") + private List bootStrapConfigurationBlobs; + + /* + * The Virtual Hub where Network Virtual Appliance is being deployed. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /* + * CloudInitConfigurationBlob storage URLs. + */ + @JsonProperty(value = "properties.cloudInitConfigurationBlobs") + private List cloudInitConfigurationBlobs; + + /* + * CloudInitConfiguration string in plain text. + */ + @JsonProperty(value = "properties.cloudInitConfiguration") + private String cloudInitConfiguration; + + /* + * VirtualAppliance ASN. + */ + @JsonProperty(value = "properties.virtualApplianceAsn") + private Long virtualApplianceAsn; + + /* + * List of Virtual Appliance Network Interfaces. + */ + @JsonProperty(value = "properties.virtualApplianceNics", access = JsonProperty.Access.WRITE_ONLY) + private List virtualApplianceNics; + + /* + * List of references to VirtualApplianceSite. + */ + @JsonProperty(value = "properties.virtualApplianceSites", access = JsonProperty.Access.WRITE_ONLY) + private List virtualApplianceSites; + + /* + * List of references to InboundSecurityRules. + */ + @JsonProperty(value = "properties.inboundSecurityRules", access = JsonProperty.Access.WRITE_ONLY) + private List inboundSecurityRules; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the identity property: The service principal that has read access to cloud-init and config blob. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The service principal that has read access to cloud-init and config blob. + * + * @param identity the identity value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the nvaSku property: Network Virtual Appliance SKU. + * + * @return the nvaSku value. + */ + public VirtualApplianceSkuProperties nvaSku() { + return this.nvaSku; + } + + /** + * Set the nvaSku property: Network Virtual Appliance SKU. + * + * @param nvaSku the nvaSku value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withNvaSku(VirtualApplianceSkuProperties nvaSku) { + this.nvaSku = nvaSku; + return this; + } + + /** + * Get the addressPrefix property: Address Prefix. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Get the bootStrapConfigurationBlobs property: BootStrapConfigurationBlobs storage URLs. + * + * @return the bootStrapConfigurationBlobs value. + */ + public List bootStrapConfigurationBlobs() { + return this.bootStrapConfigurationBlobs; + } + + /** + * Set the bootStrapConfigurationBlobs property: BootStrapConfigurationBlobs storage URLs. + * + * @param bootStrapConfigurationBlobs the bootStrapConfigurationBlobs value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withBootStrapConfigurationBlobs(List bootStrapConfigurationBlobs) { + this.bootStrapConfigurationBlobs = bootStrapConfigurationBlobs; + return this; + } + + /** + * Get the virtualHub property: The Virtual Hub where Network Virtual Appliance is being deployed. + * + * @return the virtualHub value. + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the virtualHub property: The Virtual Hub where Network Virtual Appliance is being deployed. + * + * @param virtualHub the virtualHub value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get the cloudInitConfigurationBlobs property: CloudInitConfigurationBlob storage URLs. + * + * @return the cloudInitConfigurationBlobs value. + */ + public List cloudInitConfigurationBlobs() { + return this.cloudInitConfigurationBlobs; + } + + /** + * Set the cloudInitConfigurationBlobs property: CloudInitConfigurationBlob storage URLs. + * + * @param cloudInitConfigurationBlobs the cloudInitConfigurationBlobs value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withCloudInitConfigurationBlobs(List cloudInitConfigurationBlobs) { + this.cloudInitConfigurationBlobs = cloudInitConfigurationBlobs; + return this; + } + + /** + * Get the cloudInitConfiguration property: CloudInitConfiguration string in plain text. + * + * @return the cloudInitConfiguration value. + */ + public String cloudInitConfiguration() { + return this.cloudInitConfiguration; + } + + /** + * Set the cloudInitConfiguration property: CloudInitConfiguration string in plain text. + * + * @param cloudInitConfiguration the cloudInitConfiguration value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withCloudInitConfiguration(String cloudInitConfiguration) { + this.cloudInitConfiguration = cloudInitConfiguration; + return this; + } + + /** + * Get the virtualApplianceAsn property: VirtualAppliance ASN. + * + * @return the virtualApplianceAsn value. + */ + public Long virtualApplianceAsn() { + return this.virtualApplianceAsn; + } + + /** + * Set the virtualApplianceAsn property: VirtualAppliance ASN. + * + * @param virtualApplianceAsn the virtualApplianceAsn value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withVirtualApplianceAsn(Long virtualApplianceAsn) { + this.virtualApplianceAsn = virtualApplianceAsn; + return this; + } + + /** + * Get the virtualApplianceNics property: List of Virtual Appliance Network Interfaces. + * + * @return the virtualApplianceNics value. + */ + public List virtualApplianceNics() { + return this.virtualApplianceNics; + } + + /** + * Get the virtualApplianceSites property: List of references to VirtualApplianceSite. + * + * @return the virtualApplianceSites value. + */ + public List virtualApplianceSites() { + return this.virtualApplianceSites; + } + + /** + * Get the inboundSecurityRules property: List of references to InboundSecurityRules. + * + * @return the inboundSecurityRules value. + */ + public List inboundSecurityRules() { + return this.inboundSecurityRules; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkVirtualApplianceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkVirtualApplianceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (nvaSku() != null) { + nvaSku().validate(); + } + if (virtualApplianceNics() != null) { + virtualApplianceNics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuInner.java new file mode 100644 index 0000000000000..831330b6d60f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuInner.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.network.generated.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.network.generated.models.NetworkVirtualApplianceSkuInstances; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Definition of the NetworkVirtualApplianceSkus resource. */ +@JsonFlatten +@Fluent +public class NetworkVirtualApplianceSkuInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceSkuInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Network Virtual Appliance Sku vendor. + */ + @JsonProperty(value = "properties.vendor", access = JsonProperty.Access.WRITE_ONLY) + private String vendor; + + /* + * Available Network Virtual Appliance versions. + */ + @JsonProperty(value = "properties.availableVersions", access = JsonProperty.Access.WRITE_ONLY) + private List availableVersions; + + /* + * The list of scale units available. + */ + @JsonProperty(value = "properties.availableScaleUnits") + private List availableScaleUnits; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the vendor property: Network Virtual Appliance Sku vendor. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Get the availableVersions property: Available Network Virtual Appliance versions. + * + * @return the availableVersions value. + */ + public List availableVersions() { + return this.availableVersions; + } + + /** + * Get the availableScaleUnits property: The list of scale units available. + * + * @return the availableScaleUnits value. + */ + public List availableScaleUnits() { + return this.availableScaleUnits; + } + + /** + * Set the availableScaleUnits property: The list of scale units available. + * + * @param availableScaleUnits the availableScaleUnits value to set. + * @return the NetworkVirtualApplianceSkuInner object itself. + */ + public NetworkVirtualApplianceSkuInner withAvailableScaleUnits( + List availableScaleUnits) { + this.availableScaleUnits = availableScaleUnits; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the NetworkVirtualApplianceSkuInner object itself. + */ + public NetworkVirtualApplianceSkuInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkVirtualApplianceSkuInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkVirtualApplianceSkuInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availableScaleUnits() != null) { + availableScaleUnits().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherInner.java new file mode 100644 index 0000000000000..b3b3e0d0176b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Network watcher in a resource group. */ +@JsonFlatten +@Fluent +public class NetworkWatcherInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatcherInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The provisioning state of the network watcher resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioningState property: The provisioning state of the network watcher resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkWatcherInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkWatcherInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NextHopResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NextHopResultInner.java new file mode 100644 index 0000000000000..9f088c9d358a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NextHopResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NextHopType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information about next hop from the specified VM. */ +@Fluent +public final class NextHopResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NextHopResultInner.class); + + /* + * Next hop type. + */ + @JsonProperty(value = "nextHopType") + private NextHopType nextHopType; + + /* + * Next hop IP Address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /* + * The resource identifier for the route table associated with the route + * being returned. If the route being returned does not correspond to any + * user created routes then this field will be the string 'System Route'. + */ + @JsonProperty(value = "routeTableId") + private String routeTableId; + + /** + * Get the nextHopType property: Next hop type. + * + * @return the nextHopType value. + */ + public NextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: Next hop type. + * + * @param nextHopType the nextHopType value to set. + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopType(NextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the nextHopIpAddress property: Next hop IP Address. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: Next hop IP Address. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the routeTableId property: The resource identifier for the route table associated with the route being + * returned. If the route being returned does not correspond to any user created routes then this field will be the + * string 'System Route'. + * + * @return the routeTableId value. + */ + public String routeTableId() { + return this.routeTableId; + } + + /** + * Set the routeTableId property: The resource identifier for the route table associated with the route being + * returned. If the route being returned does not correspond to any user created routes then this field will be the + * string 'System Route'. + * + * @param routeTableId the routeTableId value to set. + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withRouteTableId(String routeTableId) { + this.routeTableId = routeTableId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..1ce329afc5847 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.OperationDisplay; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network REST API operation definition. */ +@JsonFlatten +@Fluent +public class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Specification of the service. + */ + @JsonProperty(value = "properties.serviceSpecification") + private OperationPropertiesFormatServiceSpecification serviceSpecification; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display metadata associated with the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @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 serviceSpecification property: Specification of the service. + * + * @return the serviceSpecification value. + */ + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Specification of the service. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(OperationPropertiesFormatServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRuleInner.java new file mode 100644 index 0000000000000..aabe9cbf49dc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRuleInner.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Outbound rule of the load balancer. */ +@JsonFlatten +@Fluent +public class OutboundRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundRuleInner.class); + + /* + * The name of the resource that is unique within the set of outbound rules + * used by the load balancer. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The number of outbound ports to be used for NAT. + */ + @JsonProperty(value = "properties.allocatedOutboundPorts") + private Integer allocatedOutboundPorts; + + /* + * The Frontend IP addresses of the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIpConfigurations; + + /* + * A reference to a pool of DIPs. Outbound traffic is randomly load + * balanced across IPs in the backend IPs. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /* + * The provisioning state of the outbound rule resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The protocol for the outbound rule in load balancer. + */ + @JsonProperty(value = "properties.protocol") + private LoadBalancerOutboundRuleProtocol protocol; + + /* + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /* + * The timeout for the TCP idle connection. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Get the name property: The name of the resource that is unique within the set of outbound rules used by the load + * balancer. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the set of outbound rules used by the load + * balancer. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. + * + * @return the allocatedOutboundPorts value. + */ + public Integer allocatedOutboundPorts() { + return this.allocatedOutboundPorts; + } + + /** + * Set the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. + * + * @param allocatedOutboundPorts the allocatedOutboundPorts value to set. + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { + this.allocatedOutboundPorts = allocatedOutboundPorts; + return this; + } + + /** + * Get the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. + * + * @return the frontendIpConfigurations value. + */ + public List frontendIpConfigurations() { + return this.frontendIpConfigurations; + } + + /** + * Set the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. + * + * @param frontendIpConfigurations the frontendIpConfigurations value to set. + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withFrontendIpConfigurations(List frontendIpConfigurations) { + this.frontendIpConfigurations = frontendIpConfigurations; + return this; + } + + /** + * Get the backendAddressPool property: A reference to a pool of DIPs. Outbound traffic is randomly load balanced + * across IPs in the backend IPs. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: A reference to a pool of DIPs. Outbound traffic is randomly load balanced + * across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the outbound rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the protocol property: The protocol for the outbound rule in load balancer. + * + * @return the protocol value. + */ + public LoadBalancerOutboundRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol for the outbound rule in load balancer. + * + * @param protocol the protocol value to set. + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withProtocol(LoadBalancerOutboundRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value. + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set. + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** {@inheritDoc} */ + @Override + public OutboundRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnConnectionHealthInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnConnectionHealthInner.java new file mode 100644 index 0000000000000..d2adeedab8a75 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnConnectionHealthInner.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.network.generated.fluent.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; + +/** P2S Vpn connection detailed health written to sas url. */ +@Fluent +public final class P2SVpnConnectionHealthInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnConnectionHealthInner.class); + + /* + * Returned sas url of the blob to which the p2s vpn connection detailed + * health will be written. + */ + @JsonProperty(value = "sasUrl") + private String sasUrl; + + /** + * Get the sasUrl property: Returned sas url of the blob to which the p2s vpn connection detailed health will be + * written. + * + * @return the sasUrl value. + */ + public String sasUrl() { + return this.sasUrl; + } + + /** + * Set the sasUrl property: Returned sas url of the blob to which the p2s vpn connection detailed health will be + * written. + * + * @param sasUrl the sasUrl value to set. + * @return the P2SVpnConnectionHealthInner object itself. + */ + public P2SVpnConnectionHealthInner withSasUrl(String sasUrl) { + this.sasUrl = sasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayInner.java new file mode 100644 index 0000000000000..0170517ec439f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayInner.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.P2SConnectionConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealth; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** P2SVpnGateway Resource. */ +@JsonFlatten +@Fluent +public class P2SVpnGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnGatewayInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /* + * List of all p2s connection configurations of the gateway. + */ + @JsonProperty(value = "properties.p2SConnectionConfigurations") + private List p2SConnectionConfigurations; + + /* + * The provisioning state of the P2S VPN gateway resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The scale unit for this p2s vpn gateway. + */ + @JsonProperty(value = "properties.vpnGatewayScaleUnit") + private Integer vpnGatewayScaleUnit; + + /* + * The VpnServerConfiguration to which the p2sVpnGateway is attached to. + */ + @JsonProperty(value = "properties.vpnServerConfiguration") + private SubResource vpnServerConfiguration; + + /* + * All P2S VPN clients' connection health status. + */ + @JsonProperty(value = "properties.vpnClientConnectionHealth", access = JsonProperty.Access.WRITE_ONLY) + private VpnClientConnectionHealth vpnClientConnectionHealth; + + /* + * List of all customer specified DNS servers IP addresses. + */ + @JsonProperty(value = "properties.customDnsServers") + private List customDnsServers; + + /* + * Enable Routing Preference property for the Public IP Interface of the + * P2SVpnGateway. + */ + @JsonProperty(value = "properties.isRoutingPreferenceInternet") + private Boolean isRoutingPreferenceInternet; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the virtualHub property: The VirtualHub to which the gateway belongs. + * + * @return the virtualHub value. + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the virtualHub property: The VirtualHub to which the gateway belongs. + * + * @param virtualHub the virtualHub value to set. + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get the p2SConnectionConfigurations property: List of all p2s connection configurations of the gateway. + * + * @return the p2SConnectionConfigurations value. + */ + public List p2SConnectionConfigurations() { + return this.p2SConnectionConfigurations; + } + + /** + * Set the p2SConnectionConfigurations property: List of all p2s connection configurations of the gateway. + * + * @param p2SConnectionConfigurations the p2SConnectionConfigurations value to set. + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withP2SConnectionConfigurations( + List p2SConnectionConfigurations) { + this.p2SConnectionConfigurations = p2SConnectionConfigurations; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the P2S VPN gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway. + * + * @return the vpnGatewayScaleUnit value. + */ + public Integer vpnGatewayScaleUnit() { + return this.vpnGatewayScaleUnit; + } + + /** + * Set the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway. + * + * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set. + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.vpnGatewayScaleUnit = vpnGatewayScaleUnit; + return this; + } + + /** + * Get the vpnServerConfiguration property: The VpnServerConfiguration to which the p2sVpnGateway is attached to. + * + * @return the vpnServerConfiguration value. + */ + public SubResource vpnServerConfiguration() { + return this.vpnServerConfiguration; + } + + /** + * Set the vpnServerConfiguration property: The VpnServerConfiguration to which the p2sVpnGateway is attached to. + * + * @param vpnServerConfiguration the vpnServerConfiguration value to set. + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withVpnServerConfiguration(SubResource vpnServerConfiguration) { + this.vpnServerConfiguration = vpnServerConfiguration; + return this; + } + + /** + * Get the vpnClientConnectionHealth property: All P2S VPN clients' connection health status. + * + * @return the vpnClientConnectionHealth value. + */ + public VpnClientConnectionHealth vpnClientConnectionHealth() { + return this.vpnClientConnectionHealth; + } + + /** + * Get the customDnsServers property: List of all customer specified DNS servers IP addresses. + * + * @return the customDnsServers value. + */ + public List customDnsServers() { + return this.customDnsServers; + } + + /** + * Set the customDnsServers property: List of all customer specified DNS servers IP addresses. + * + * @param customDnsServers the customDnsServers value to set. + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withCustomDnsServers(List customDnsServers) { + this.customDnsServers = customDnsServers; + return this; + } + + /** + * Get the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP Interface of + * the P2SVpnGateway. + * + * @return the isRoutingPreferenceInternet value. + */ + public Boolean isRoutingPreferenceInternet() { + return this.isRoutingPreferenceInternet; + } + + /** + * Set the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP Interface of + * the P2SVpnGateway. + * + * @param isRoutingPreferenceInternet the isRoutingPreferenceInternet value to set. + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withIsRoutingPreferenceInternet(Boolean isRoutingPreferenceInternet) { + this.isRoutingPreferenceInternet = isRoutingPreferenceInternet; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public P2SVpnGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public P2SVpnGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (p2SConnectionConfigurations() != null) { + p2SConnectionConfigurations().forEach(e -> e.validate()); + } + if (vpnClientConnectionHealth() != null) { + vpnClientConnectionHealth().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureQueryStatusResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureQueryStatusResultInner.java new file mode 100644 index 0000000000000..60cfbfaa4ff05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureQueryStatusResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PcError; +import com.azure.resourcemanager.network.generated.models.PcStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Status of packet capture session. */ +@Fluent +public final class PacketCaptureQueryStatusResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureQueryStatusResultInner.class); + + /* + * The name of the packet capture resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the packet capture resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The start time of the packet capture session. + */ + @JsonProperty(value = "captureStartTime") + private OffsetDateTime captureStartTime; + + /* + * The status of the packet capture session. + */ + @JsonProperty(value = "packetCaptureStatus") + private PcStatus packetCaptureStatus; + + /* + * The reason the current packet capture session was stopped. + */ + @JsonProperty(value = "stopReason") + private String stopReason; + + /* + * List of errors of packet capture session. + */ + @JsonProperty(value = "packetCaptureError") + private List packetCaptureError; + + /** + * Get the name property: The name of the packet capture resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the packet capture resource. + * + * @param name the name value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: The ID of the packet capture resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the packet capture resource. + * + * @param id the id value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the captureStartTime property: The start time of the packet capture session. + * + * @return the captureStartTime value. + */ + public OffsetDateTime captureStartTime() { + return this.captureStartTime; + } + + /** + * Set the captureStartTime property: The start time of the packet capture session. + * + * @param captureStartTime the captureStartTime value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withCaptureStartTime(OffsetDateTime captureStartTime) { + this.captureStartTime = captureStartTime; + return this; + } + + /** + * Get the packetCaptureStatus property: The status of the packet capture session. + * + * @return the packetCaptureStatus value. + */ + public PcStatus packetCaptureStatus() { + return this.packetCaptureStatus; + } + + /** + * Set the packetCaptureStatus property: The status of the packet capture session. + * + * @param packetCaptureStatus the packetCaptureStatus value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureStatus(PcStatus packetCaptureStatus) { + this.packetCaptureStatus = packetCaptureStatus; + return this; + } + + /** + * Get the stopReason property: The reason the current packet capture session was stopped. + * + * @return the stopReason value. + */ + public String stopReason() { + return this.stopReason; + } + + /** + * Set the stopReason property: The reason the current packet capture session was stopped. + * + * @param stopReason the stopReason value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withStopReason(String stopReason) { + this.stopReason = stopReason; + return this; + } + + /** + * Get the packetCaptureError property: List of errors of packet capture session. + * + * @return the packetCaptureError value. + */ + public List packetCaptureError() { + return this.packetCaptureError; + } + + /** + * Set the packetCaptureError property: List of errors of packet capture session. + * + * @param packetCaptureError the packetCaptureError value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureError(List packetCaptureError) { + this.packetCaptureError = packetCaptureError; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultInner.java new file mode 100644 index 0000000000000..d1c101b0eb23c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultInner.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about packet capture session. */ +@JsonFlatten +@Fluent +public class PacketCaptureResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureResultInner.class); + + /* + * Name of the packet capture session. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * ID of the packet capture operation. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target") + private String target; + + /* + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Long bytesToCapturePerPacket; + + /* + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Long totalBytesPerSession; + + /* + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /* + * The storage location for a packet capture session. + */ + @JsonProperty(value = "properties.storageLocation") + private PacketCaptureStorageLocation storageLocation; + + /* + * A list of packet capture filters. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /* + * The provisioning state of the packet capture session. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the packet capture session. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: ID of the packet capture operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the target property: The ID of the targeted resource, only VM is currently supported. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value. + */ + public Long bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withBytesToCapturePerPacket(Long bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get the totalBytesPerSession property: Maximum size of the capture output. + * + * @return the totalBytesPerSession value. + */ + public Long totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set the totalBytesPerSession property: Maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTotalBytesPerSession(Long totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value. + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation property: The storage location for a packet capture session. + * + * @return the storageLocation value. + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation property: The storage location for a packet capture session. + * + * @param storageLocation the storageLocation value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters property: A list of packet capture filters. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: A list of packet capture filters. + * + * @param filters the filters value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the packet capture session. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageLocation() != null) { + storageLocation().validate(); + } + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionInner.java new file mode 100644 index 0000000000000..0de52753b9808 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionInner.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. */ +@JsonFlatten +@Fluent +public class PeerExpressRouteCircuitConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerExpressRouteCircuitConnectionInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Reference to Express Route Circuit Private Peering Resource of the + * circuit. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering") + private SubResource expressRouteCircuitPeering; + + /* + * Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + */ + @JsonProperty(value = "properties.peerExpressRouteCircuitPeering") + private SubResource peerExpressRouteCircuitPeering; + + /* + * /29 IP address space to carve out Customer addresses for tunnels. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /* + * Express Route Circuit connection state. + */ + @JsonProperty(value = "properties.circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /* + * The name of the express route circuit connection resource. + */ + @JsonProperty(value = "properties.connectionName") + private String connectionName; + + /* + * The resource guid of the authorization used for the express route + * circuit connection. + */ + @JsonProperty(value = "properties.authResourceGuid") + private String authResourceGuid; + + /* + * The provisioning state of the peer express route circuit connection + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit. + * + * @return the expressRouteCircuitPeering value. + */ + public SubResource expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set. + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withExpressRouteCircuitPeering( + SubResource expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of + * the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value. + */ + public SubResource peerExpressRouteCircuitPeering() { + return this.peerExpressRouteCircuitPeering; + } + + /** + * Set the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of + * the peered circuit. + * + * @param peerExpressRouteCircuitPeering the peerExpressRouteCircuitPeering value to set. + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withPeerExpressRouteCircuitPeering( + SubResource peerExpressRouteCircuitPeering) { + this.peerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + return this; + } + + /** + * Get the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. + * + * @param addressPrefix the addressPrefix value to set. + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Get the connectionName property: The name of the express route circuit connection resource. + * + * @return the connectionName value. + */ + public String connectionName() { + return this.connectionName; + } + + /** + * Set the connectionName property: The name of the express route circuit connection resource. + * + * @param connectionName the connectionName value to set. + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withConnectionName(String connectionName) { + this.connectionName = connectionName; + return this; + } + + /** + * Get the authResourceGuid property: The resource guid of the authorization used for the express route circuit + * connection. + * + * @return the authResourceGuid value. + */ + public String authResourceGuid() { + return this.authResourceGuid; + } + + /** + * Set the authResourceGuid property: The resource guid of the authorization used for the express route circuit + * connection. + * + * @param authResourceGuid the authResourceGuid value to set. + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withAuthResourceGuid(String authResourceGuid) { + this.authResourceGuid = authResourceGuid; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the peer express route circuit connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public PeerExpressRouteCircuitConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerRouteListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerRouteListInner.java new file mode 100644 index 0000000000000..b747686dac72c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerRouteListInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PeerRoute; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of virtual router peer routes. */ +@Fluent +public final class PeerRouteListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerRouteListInner.class); + + /* + * List of peer routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of peer routes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of peer routes. + * + * @param value the value value to set. + * @return the PeerRouteListInner object itself. + */ + public PeerRouteListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java new file mode 100644 index 0000000000000..3cc926bb2c622 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Private dns zone group resource. */ +@JsonFlatten +@Fluent +public class PrivateDnsZoneGroupInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZoneGroupInner.class); + + /* + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The provisioning state of the private dns zone group resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * A collection of private dns zone configurations of the private dns zone + * group. + */ + @JsonProperty(value = "properties.privateDnsZoneConfigs") + private List privateDnsZoneConfigs; + + /** + * Get the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the PrivateDnsZoneGroupInner object itself. + */ + public PrivateDnsZoneGroupInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioningState property: The provisioning state of the private dns zone group resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateDnsZoneConfigs property: A collection of private dns zone configurations of the private dns zone + * group. + * + * @return the privateDnsZoneConfigs value. + */ + public List privateDnsZoneConfigs() { + return this.privateDnsZoneConfigs; + } + + /** + * Set the privateDnsZoneConfigs property: A collection of private dns zone configurations of the private dns zone + * group. + * + * @param privateDnsZoneConfigs the privateDnsZoneConfigs value to set. + * @return the PrivateDnsZoneGroupInner object itself. + */ + public PrivateDnsZoneGroupInner withPrivateDnsZoneConfigs(List privateDnsZoneConfigs) { + this.privateDnsZoneConfigs = privateDnsZoneConfigs; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateDnsZoneGroupInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateDnsZoneConfigs() != null) { + privateDnsZoneConfigs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..8e309a0539001 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PrivateEndpointConnection resource. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The resource of private end point. + */ + @JsonProperty(value = "properties.privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointInner privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The consumer link id. + */ + @JsonProperty(value = "properties.linkIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String linkIdentifier; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointInner privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the linkIdentifier property: The consumer link id. + * + * @return the linkIdentifier value. + */ + public String linkIdentifier() { + return this.linkIdentifier; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointInner.java new file mode 100644 index 0000000000000..f705e061906be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointInner.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.CustomDnsConfigPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Private endpoint resource. */ +@JsonFlatten +@Fluent +public class PrivateEndpointInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointInner.class); + + /* + * The extended location of the load balancer. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The ID of the subnet from which the private IP will be allocated. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /* + * An array of references to the network interfaces created for this + * private endpoint. + */ + @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /* + * The provisioning state of the private endpoint resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * A grouping of information about the connection to the remote resource. + */ + @JsonProperty(value = "properties.privateLinkServiceConnections") + private List privateLinkServiceConnections; + + /* + * A grouping of information about the connection to the remote resource. + * Used when the network admin does not have access to approve connections + * to the remote resource. + */ + @JsonProperty(value = "properties.manualPrivateLinkServiceConnections") + private List manualPrivateLinkServiceConnections; + + /* + * An array of custom dns configurations. + */ + @JsonProperty(value = "properties.customDnsConfigs") + private List customDnsConfigs; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the extendedLocation property: The extended location of the load balancer. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the load balancer. + * + * @param extendedLocation the extendedLocation value to set. + * @return the PrivateEndpointInner object itself. + */ + public PrivateEndpointInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the subnet property: The ID of the subnet from which the private IP will be allocated. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The ID of the subnet from which the private IP will be allocated. + * + * @param subnet the subnet value to set. + * @return the PrivateEndpointInner object itself. + */ + public PrivateEndpointInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the networkInterfaces property: An array of references to the network interfaces created for this private + * endpoint. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateLinkServiceConnections property: A grouping of information about the connection to the remote + * resource. + * + * @return the privateLinkServiceConnections value. + */ + public List privateLinkServiceConnections() { + return this.privateLinkServiceConnections; + } + + /** + * Set the privateLinkServiceConnections property: A grouping of information about the connection to the remote + * resource. + * + * @param privateLinkServiceConnections the privateLinkServiceConnections value to set. + * @return the PrivateEndpointInner object itself. + */ + public PrivateEndpointInner withPrivateLinkServiceConnections( + List privateLinkServiceConnections) { + this.privateLinkServiceConnections = privateLinkServiceConnections; + return this; + } + + /** + * Get the manualPrivateLinkServiceConnections property: A grouping of information about the connection to the + * remote resource. Used when the network admin does not have access to approve connections to the remote resource. + * + * @return the manualPrivateLinkServiceConnections value. + */ + public List manualPrivateLinkServiceConnections() { + return this.manualPrivateLinkServiceConnections; + } + + /** + * Set the manualPrivateLinkServiceConnections property: A grouping of information about the connection to the + * remote resource. Used when the network admin does not have access to approve connections to the remote resource. + * + * @param manualPrivateLinkServiceConnections the manualPrivateLinkServiceConnections value to set. + * @return the PrivateEndpointInner object itself. + */ + public PrivateEndpointInner withManualPrivateLinkServiceConnections( + List manualPrivateLinkServiceConnections) { + this.manualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections; + return this; + } + + /** + * Get the customDnsConfigs property: An array of custom dns configurations. + * + * @return the customDnsConfigs value. + */ + public List customDnsConfigs() { + return this.customDnsConfigs; + } + + /** + * Set the customDnsConfigs property: An array of custom dns configurations. + * + * @param customDnsConfigs the customDnsConfigs value to set. + * @return the PrivateEndpointInner object itself. + */ + public PrivateEndpointInner withCustomDnsConfigs(List customDnsConfigs) { + this.customDnsConfigs = customDnsConfigs; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the PrivateEndpointInner object itself. + */ + public PrivateEndpointInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (subnet() != null) { + subnet().validate(); + } + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + if (privateLinkServiceConnections() != null) { + privateLinkServiceConnections().forEach(e -> e.validate()); + } + if (manualPrivateLinkServiceConnections() != null) { + manualPrivateLinkServiceConnections().forEach(e -> e.validate()); + } + if (customDnsConfigs() != null) { + customDnsConfigs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceInner.java new file mode 100644 index 0000000000000..ab49a670d15e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceInner.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesAutoApproval; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Private link service resource. */ +@JsonFlatten +@Fluent +public class PrivateLinkServiceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceInner.class); + + /* + * The extended location of the load balancer. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * An array of references to the load balancer IP configurations. + */ + @JsonProperty(value = "properties.loadBalancerFrontendIpConfigurations") + private List loadBalancerFrontendIpConfigurations; + + /* + * An array of private link service IP configurations. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * An array of references to the network interfaces created for this + * private link service. + */ + @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /* + * The provisioning state of the private link service resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * An array of list about connections to the private endpoint. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * The visibility list of the private link service. + */ + @JsonProperty(value = "properties.visibility") + private PrivateLinkServicePropertiesVisibility visibility; + + /* + * The auto-approval list of the private link service. + */ + @JsonProperty(value = "properties.autoApproval") + private PrivateLinkServicePropertiesAutoApproval autoApproval; + + /* + * The list of Fqdn. + */ + @JsonProperty(value = "properties.fqdns") + private List fqdns; + + /* + * The alias of the private link service. + */ + @JsonProperty(value = "properties.alias", access = JsonProperty.Access.WRITE_ONLY) + private String alias; + + /* + * Whether the private link service is enabled for proxy protocol or not. + */ + @JsonProperty(value = "properties.enableProxyProtocol") + private Boolean enableProxyProtocol; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the extendedLocation property: The extended location of the load balancer. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the load balancer. + * + * @param extendedLocation the extendedLocation value to set. + * @return the PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the loadBalancerFrontendIpConfigurations property: An array of references to the load balancer IP + * configurations. + * + * @return the loadBalancerFrontendIpConfigurations value. + */ + public List loadBalancerFrontendIpConfigurations() { + return this.loadBalancerFrontendIpConfigurations; + } + + /** + * Set the loadBalancerFrontendIpConfigurations property: An array of references to the load balancer IP + * configurations. + * + * @param loadBalancerFrontendIpConfigurations the loadBalancerFrontendIpConfigurations value to set. + * @return the PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withLoadBalancerFrontendIpConfigurations( + List loadBalancerFrontendIpConfigurations) { + this.loadBalancerFrontendIpConfigurations = loadBalancerFrontendIpConfigurations; + return this; + } + + /** + * Get the ipConfigurations property: An array of private link service IP configurations. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: An array of private link service IP configurations. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the networkInterfaces property: An array of references to the network interfaces created for this private + * link service. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get the provisioningState property: The provisioning state of the private link service resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpointConnections property: An array of list about connections to the private endpoint. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the visibility property: The visibility list of the private link service. + * + * @return the visibility value. + */ + public PrivateLinkServicePropertiesVisibility visibility() { + return this.visibility; + } + + /** + * Set the visibility property: The visibility list of the private link service. + * + * @param visibility the visibility value to set. + * @return the PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withVisibility(PrivateLinkServicePropertiesVisibility visibility) { + this.visibility = visibility; + return this; + } + + /** + * Get the autoApproval property: The auto-approval list of the private link service. + * + * @return the autoApproval value. + */ + public PrivateLinkServicePropertiesAutoApproval autoApproval() { + return this.autoApproval; + } + + /** + * Set the autoApproval property: The auto-approval list of the private link service. + * + * @param autoApproval the autoApproval value to set. + * @return the PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withAutoApproval(PrivateLinkServicePropertiesAutoApproval autoApproval) { + this.autoApproval = autoApproval; + return this; + } + + /** + * Get the fqdns property: The list of Fqdn. + * + * @return the fqdns value. + */ + public List fqdns() { + return this.fqdns; + } + + /** + * Set the fqdns property: The list of Fqdn. + * + * @param fqdns the fqdns value to set. + * @return the PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withFqdns(List fqdns) { + this.fqdns = fqdns; + return this; + } + + /** + * Get the alias property: The alias of the private link service. + * + * @return the alias value. + */ + public String alias() { + return this.alias; + } + + /** + * Get the enableProxyProtocol property: Whether the private link service is enabled for proxy protocol or not. + * + * @return the enableProxyProtocol value. + */ + public Boolean enableProxyProtocol() { + return this.enableProxyProtocol; + } + + /** + * Set the enableProxyProtocol property: Whether the private link service is enabled for proxy protocol or not. + * + * @param enableProxyProtocol the enableProxyProtocol value to set. + * @return the PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withEnableProxyProtocol(Boolean enableProxyProtocol) { + this.enableProxyProtocol = enableProxyProtocol; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (loadBalancerFrontendIpConfigurations() != null) { + loadBalancerFrontendIpConfigurations().forEach(e -> e.validate()); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (visibility() != null) { + visibility().validate(); + } + if (autoApproval() != null) { + autoApproval().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationInner.java new file mode 100644 index 0000000000000..04ce476db0f6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationInner.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The private link service ip configuration. */ +@JsonFlatten +@Fluent +public class PrivateLinkServiceIpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceIpConfigurationInner.class); + + /* + * The name of private link service ip configuration. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /* + * Whether the ip configuration is primary or not. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * The provisioning state of the private link service IP configuration + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IpVersion privateIpAddressVersion; + + /** + * Get the name property: The name of private link service ip configuration. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of private link service ip configuration. + * + * @param name the name value to set. + * @return the PrivateLinkServiceIpConfigurationInner object itself. + */ + public PrivateLinkServiceIpConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the PrivateLinkServiceIpConfigurationInner object itself. + */ + public PrivateLinkServiceIpConfigurationInner withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: The private IP address allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the PrivateLinkServiceIpConfigurationInner object itself. + */ + public PrivateLinkServiceIpConfigurationInner withPrivateIpAllocationMethod( + IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The reference to the subnet resource. + * + * @param subnet the subnet value to set. + * @return the PrivateLinkServiceIpConfigurationInner object itself. + */ + public PrivateLinkServiceIpConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the primary property: Whether the ip configuration is primary or not. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Whether the ip configuration is primary or not. + * + * @param primary the primary value to set. + * @return the PrivateLinkServiceIpConfigurationInner object itself. + */ + public PrivateLinkServiceIpConfigurationInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private link service IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + * + * @return the privateIpAddressVersion value. + */ + public IpVersion privateIpAddressVersion() { + return this.privateIpAddressVersion; + } + + /** + * Set the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the PrivateLinkServiceIpConfigurationInner object itself. + */ + public PrivateLinkServiceIpConfigurationInner withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { + this.privateIpAddressVersion = privateIpAddressVersion; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkServiceIpConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceVisibilityInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceVisibilityInner.java new file mode 100644 index 0000000000000..53d12d1957ab6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceVisibilityInner.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.network.generated.fluent.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; + +/** Response for the CheckPrivateLinkServiceVisibility API service call. */ +@Fluent +public final class PrivateLinkServiceVisibilityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceVisibilityInner.class); + + /* + * Private Link Service Visibility (True/False). + */ + @JsonProperty(value = "visible") + private Boolean visible; + + /** + * Get the visible property: Private Link Service Visibility (True/False). + * + * @return the visible value. + */ + public Boolean visible() { + return this.visible; + } + + /** + * Set the visible property: Private Link Service Visibility (True/False). + * + * @param visible the visible value to set. + * @return the PrivateLinkServiceVisibilityInner object itself. + */ + public PrivateLinkServiceVisibilityInner withVisible(Boolean visible) { + this.visible = visible; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbeInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbeInner.java new file mode 100644 index 0000000000000..56c32aa5e34f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbeInner.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A load balancer probe. */ +@JsonFlatten +@Fluent +public class ProbeInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProbeInner.class); + + /* + * The name of the resource that is unique within the set of probes used by + * the load balancer. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The load balancer rules that use this probe. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /* + * The protocol of the end point. If 'Tcp' is specified, a received ACK is + * required for the probe to be successful. If 'Http' or 'Https' is + * specified, a 200 OK response from the specifies URI is required for the + * probe to be successful. + */ + @JsonProperty(value = "properties.protocol") + private ProbeProtocol protocol; + + /* + * The port for communicating the probe. Possible values range from 1 to + * 65535, inclusive. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /* + * The interval, in seconds, for how frequently to probe the endpoint for + * health status. Typically, the interval is slightly less than half the + * allocated timeout period (in seconds) which allows two full probes + * before taking the instance out of rotation. The default value is 15, the + * minimum value is 5. + */ + @JsonProperty(value = "properties.intervalInSeconds") + private Integer intervalInSeconds; + + /* + * The number of probes where if no response, will result in stopping + * further traffic from being delivered to the endpoint. This values allows + * endpoints to be taken out of rotation faster or slower than the typical + * times used in Azure. + */ + @JsonProperty(value = "properties.numberOfProbes") + private Integer numberOfProbes; + + /* + * The URI used for requesting health status from the VM. Path is required + * if a protocol is set to http. Otherwise, it is not allowed. There is no + * default value. + */ + @JsonProperty(value = "properties.requestPath") + private String requestPath; + + /* + * The provisioning state of the probe resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within the set of probes used by the load + * balancer. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the set of probes used by the load + * balancer. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the ProbeInner object itself. + */ + public ProbeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the loadBalancingRules property: The load balancer rules that use this probe. + * + * @return the loadBalancingRules value. + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the protocol property: The protocol of the end point. If 'Tcp' is specified, a received ACK is required for + * the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is + * required for the probe to be successful. + * + * @return the protocol value. + */ + public ProbeProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol of the end point. If 'Tcp' is specified, a received ACK is required for + * the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is + * required for the probe to be successful. + * + * @param protocol the protocol value to set. + * @return the ProbeInner object itself. + */ + public ProbeInner withProtocol(ProbeProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port property: The port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @param port the port value to set. + * @return the ProbeInner object itself. + */ + public ProbeInner withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the intervalInSeconds property: The interval, in seconds, for how frequently to probe the endpoint for health + * status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows + * two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + * + * @return the intervalInSeconds value. + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the intervalInSeconds property: The interval, in seconds, for how frequently to probe the endpoint for health + * status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows + * two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + * + * @param intervalInSeconds the intervalInSeconds value to set. + * @return the ProbeInner object itself. + */ + public ProbeInner withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the numberOfProbes property: The number of probes where if no response, will result in stopping further + * traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or + * slower than the typical times used in Azure. + * + * @return the numberOfProbes value. + */ + public Integer numberOfProbes() { + return this.numberOfProbes; + } + + /** + * Set the numberOfProbes property: The number of probes where if no response, will result in stopping further + * traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or + * slower than the typical times used in Azure. + * + * @param numberOfProbes the numberOfProbes value to set. + * @return the ProbeInner object itself. + */ + public ProbeInner withNumberOfProbes(Integer numberOfProbes) { + this.numberOfProbes = numberOfProbes; + return this; + } + + /** + * Get the requestPath property: The URI used for requesting health status from the VM. Path is required if a + * protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @return the requestPath value. + */ + public String requestPath() { + return this.requestPath; + } + + /** + * Set the requestPath property: The URI used for requesting health status from the VM. Path is required if a + * protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @param requestPath the requestPath value to set. + * @return the ProbeInner object itself. + */ + public ProbeInner withRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the probe resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ProbeInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressInner.java new file mode 100644 index 0000000000000..23a6f85cbeceb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressInner.java @@ -0,0 +1,587 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.DdosSettings; +import com.azure.resourcemanager.network.generated.models.DeleteOptions; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettings; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressMigrationPhase; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Public IP address resource. */ +@JsonFlatten +@Fluent +public class PublicIpAddressInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressInner.class); + + /* + * The extended location of the public ip address. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The public IP address SKU. + */ + @JsonProperty(value = "sku") + private PublicIpAddressSku sku; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The public IP address allocation method. + */ + @JsonProperty(value = "properties.publicIPAllocationMethod") + private IpAllocationMethod publicIpAllocationMethod; + + /* + * The public IP address version. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IpVersion publicIpAddressVersion; + + /* + * The IP configuration associated with the public IP address. + */ + @JsonProperty(value = "properties.ipConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private IpConfigurationInner ipConfiguration; + + /* + * The FQDN of the DNS record associated with the public IP address. + */ + @JsonProperty(value = "properties.dnsSettings") + private PublicIpAddressDnsSettings dnsSettings; + + /* + * The DDoS protection custom policy associated with the public IP address. + */ + @JsonProperty(value = "properties.ddosSettings") + private DdosSettings ddosSettings; + + /* + * The list of tags associated with the public IP address. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /* + * The IP address associated with the public IP address resource. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /* + * The Public IP Prefix this Public IP Address should be allocated from. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIpPrefix; + + /* + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * The resource GUID property of the public IP address resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the public IP address resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The service public IP address of the public IP address resource. + */ + @JsonProperty(value = "properties.servicePublicIPAddress") + private PublicIpAddressInner servicePublicIpAddress; + + /* + * The NatGateway for the Public IP address. + */ + @JsonProperty(value = "properties.natGateway") + private NatGatewayInner natGateway; + + /* + * Migration phase of Public IP Address. + */ + @JsonProperty(value = "properties.migrationPhase") + private PublicIpAddressMigrationPhase migrationPhase; + + /* + * The linked public IP address of the public IP address resource. + */ + @JsonProperty(value = "properties.linkedPublicIPAddress") + private PublicIpAddressInner linkedPublicIpAddress; + + /* + * Specify what happens to the public IP address when the VM using it is + * deleted + */ + @JsonProperty(value = "properties.deleteOption") + private DeleteOptions deleteOption; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the extendedLocation property: The extended location of the public ip address. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the public ip address. + * + * @param extendedLocation the extendedLocation value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the sku property: The public IP address SKU. + * + * @return the sku value. + */ + public PublicIpAddressSku sku() { + return this.sku; + } + + /** + * Set the sku property: The public IP address SKU. + * + * @param sku the sku value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withSku(PublicIpAddressSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @param zones the zones value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the publicIpAllocationMethod property: The public IP address allocation method. + * + * @return the publicIpAllocationMethod value. + */ + public IpAllocationMethod publicIpAllocationMethod() { + return this.publicIpAllocationMethod; + } + + /** + * Set the publicIpAllocationMethod property: The public IP address allocation method. + * + * @param publicIpAllocationMethod the publicIpAllocationMethod value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withPublicIpAllocationMethod(IpAllocationMethod publicIpAllocationMethod) { + this.publicIpAllocationMethod = publicIpAllocationMethod; + return this; + } + + /** + * Get the publicIpAddressVersion property: The public IP address version. + * + * @return the publicIpAddressVersion value. + */ + public IpVersion publicIpAddressVersion() { + return this.publicIpAddressVersion; + } + + /** + * Set the publicIpAddressVersion property: The public IP address version. + * + * @param publicIpAddressVersion the publicIpAddressVersion value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { + this.publicIpAddressVersion = publicIpAddressVersion; + return this; + } + + /** + * Get the ipConfiguration property: The IP configuration associated with the public IP address. + * + * @return the ipConfiguration value. + */ + public IpConfigurationInner ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Get the dnsSettings property: The FQDN of the DNS record associated with the public IP address. + * + * @return the dnsSettings value. + */ + public PublicIpAddressDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The FQDN of the DNS record associated with the public IP address. + * + * @param dnsSettings the dnsSettings value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withDnsSettings(PublicIpAddressDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ddosSettings property: The DDoS protection custom policy associated with the public IP address. + * + * @return the ddosSettings value. + */ + public DdosSettings ddosSettings() { + return this.ddosSettings; + } + + /** + * Set the ddosSettings property: The DDoS protection custom policy associated with the public IP address. + * + * @param ddosSettings the ddosSettings value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withDdosSettings(DdosSettings ddosSettings) { + this.ddosSettings = ddosSettings; + return this; + } + + /** + * Get the ipTags property: The list of tags associated with the public IP address. + * + * @return the ipTags value. + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the ipTags property: The list of tags associated with the public IP address. + * + * @param ipTags the ipTags value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the ipAddress property: The IP address associated with the public IP address resource. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address associated with the public IP address resource. + * + * @param ipAddress the ipAddress value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated from. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.publicIpPrefix; + } + + /** + * Set the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated from. + * + * @param publicIpPrefix the publicIpPrefix value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withPublicIpPrefix(SubResource publicIpPrefix) { + this.publicIpPrefix = publicIpPrefix; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the resourceGuid property: The resource GUID property of the public IP address resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the public IP address resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the servicePublicIpAddress property: The service public IP address of the public IP address resource. + * + * @return the servicePublicIpAddress value. + */ + public PublicIpAddressInner servicePublicIpAddress() { + return this.servicePublicIpAddress; + } + + /** + * Set the servicePublicIpAddress property: The service public IP address of the public IP address resource. + * + * @param servicePublicIpAddress the servicePublicIpAddress value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withServicePublicIpAddress(PublicIpAddressInner servicePublicIpAddress) { + this.servicePublicIpAddress = servicePublicIpAddress; + return this; + } + + /** + * Get the natGateway property: The NatGateway for the Public IP address. + * + * @return the natGateway value. + */ + public NatGatewayInner natGateway() { + return this.natGateway; + } + + /** + * Set the natGateway property: The NatGateway for the Public IP address. + * + * @param natGateway the natGateway value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withNatGateway(NatGatewayInner natGateway) { + this.natGateway = natGateway; + return this; + } + + /** + * Get the migrationPhase property: Migration phase of Public IP Address. + * + * @return the migrationPhase value. + */ + public PublicIpAddressMigrationPhase migrationPhase() { + return this.migrationPhase; + } + + /** + * Set the migrationPhase property: Migration phase of Public IP Address. + * + * @param migrationPhase the migrationPhase value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withMigrationPhase(PublicIpAddressMigrationPhase migrationPhase) { + this.migrationPhase = migrationPhase; + return this; + } + + /** + * Get the linkedPublicIpAddress property: The linked public IP address of the public IP address resource. + * + * @return the linkedPublicIpAddress value. + */ + public PublicIpAddressInner linkedPublicIpAddress() { + return this.linkedPublicIpAddress; + } + + /** + * Set the linkedPublicIpAddress property: The linked public IP address of the public IP address resource. + * + * @param linkedPublicIpAddress the linkedPublicIpAddress value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withLinkedPublicIpAddress(PublicIpAddressInner linkedPublicIpAddress) { + this.linkedPublicIpAddress = linkedPublicIpAddress; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP address when the VM using it is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the public IP address when the VM using it is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the PublicIpAddressInner object itself. + */ + public PublicIpAddressInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public PublicIpAddressInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PublicIpAddressInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (ipConfiguration() != null) { + ipConfiguration().validate(); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ddosSettings() != null) { + ddosSettings().validate(); + } + if (ipTags() != null) { + ipTags().forEach(e -> e.validate()); + } + if (servicePublicIpAddress() != null) { + servicePublicIpAddress().validate(); + } + if (natGateway() != null) { + natGateway().validate(); + } + if (linkedPublicIpAddress() != null) { + linkedPublicIpAddress().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixInner.java new file mode 100644 index 0000000000000..afc6b7c51cd42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixInner.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSku; +import com.azure.resourcemanager.network.generated.models.ReferencedPublicIpAddress; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Public IP prefix resource. */ +@JsonFlatten +@Fluent +public class PublicIpPrefixInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixInner.class); + + /* + * The extended location of the public ip address. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The public IP prefix SKU. + */ + @JsonProperty(value = "sku") + private PublicIpPrefixSku sku; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The public IP address version. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IpVersion publicIpAddressVersion; + + /* + * The list of tags associated with the public IP prefix. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /* + * The Length of the Public IP Prefix. + */ + @JsonProperty(value = "properties.prefixLength") + private Integer prefixLength; + + /* + * The allocated Prefix. + */ + @JsonProperty(value = "properties.ipPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String ipPrefix; + + /* + * The list of all referenced PublicIPAddresses. + */ + @JsonProperty(value = "properties.publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpAddresses; + + /* + * The reference to load balancer frontend IP configuration associated with + * the public IP prefix. + */ + @JsonProperty(value = "properties.loadBalancerFrontendIpConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private SubResource loadBalancerFrontendIpConfiguration; + + /* + * The customIpPrefix that this prefix is associated with. + */ + @JsonProperty(value = "properties.customIPPrefix") + private SubResource customIpPrefix; + + /* + * The resource GUID property of the public IP prefix resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the public IP prefix resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * NatGateway of Public IP Prefix. + */ + @JsonProperty(value = "properties.natGateway") + private NatGatewayInner natGateway; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the extendedLocation property: The extended location of the public ip address. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the public ip address. + * + * @param extendedLocation the extendedLocation value to set. + * @return the PublicIpPrefixInner object itself. + */ + public PublicIpPrefixInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the sku property: The public IP prefix SKU. + * + * @return the sku value. + */ + public PublicIpPrefixSku sku() { + return this.sku; + } + + /** + * Set the sku property: The public IP prefix SKU. + * + * @param sku the sku value to set. + * @return the PublicIpPrefixInner object itself. + */ + public PublicIpPrefixInner withSku(PublicIpPrefixSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @param zones the zones value to set. + * @return the PublicIpPrefixInner object itself. + */ + public PublicIpPrefixInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the publicIpAddressVersion property: The public IP address version. + * + * @return the publicIpAddressVersion value. + */ + public IpVersion publicIpAddressVersion() { + return this.publicIpAddressVersion; + } + + /** + * Set the publicIpAddressVersion property: The public IP address version. + * + * @param publicIpAddressVersion the publicIpAddressVersion value to set. + * @return the PublicIpPrefixInner object itself. + */ + public PublicIpPrefixInner withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { + this.publicIpAddressVersion = publicIpAddressVersion; + return this; + } + + /** + * Get the ipTags property: The list of tags associated with the public IP prefix. + * + * @return the ipTags value. + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the ipTags property: The list of tags associated with the public IP prefix. + * + * @param ipTags the ipTags value to set. + * @return the PublicIpPrefixInner object itself. + */ + public PublicIpPrefixInner withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the prefixLength property: The Length of the Public IP Prefix. + * + * @return the prefixLength value. + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Set the prefixLength property: The Length of the Public IP Prefix. + * + * @param prefixLength the prefixLength value to set. + * @return the PublicIpPrefixInner object itself. + */ + public PublicIpPrefixInner withPrefixLength(Integer prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Get the ipPrefix property: The allocated Prefix. + * + * @return the ipPrefix value. + */ + public String ipPrefix() { + return this.ipPrefix; + } + + /** + * Get the publicIpAddresses property: The list of all referenced PublicIPAddresses. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Get the loadBalancerFrontendIpConfiguration property: The reference to load balancer frontend IP configuration + * associated with the public IP prefix. + * + * @return the loadBalancerFrontendIpConfiguration value. + */ + public SubResource loadBalancerFrontendIpConfiguration() { + return this.loadBalancerFrontendIpConfiguration; + } + + /** + * Get the customIpPrefix property: The customIpPrefix that this prefix is associated with. + * + * @return the customIpPrefix value. + */ + public SubResource customIpPrefix() { + return this.customIpPrefix; + } + + /** + * Set the customIpPrefix property: The customIpPrefix that this prefix is associated with. + * + * @param customIpPrefix the customIpPrefix value to set. + * @return the PublicIpPrefixInner object itself. + */ + public PublicIpPrefixInner withCustomIpPrefix(SubResource customIpPrefix) { + this.customIpPrefix = customIpPrefix; + return this; + } + + /** + * Get the resourceGuid property: The resource GUID property of the public IP prefix resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the public IP prefix resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the natGateway property: NatGateway of Public IP Prefix. + * + * @return the natGateway value. + */ + public NatGatewayInner natGateway() { + return this.natGateway; + } + + /** + * Set the natGateway property: NatGateway of Public IP Prefix. + * + * @param natGateway the natGateway value to set. + * @return the PublicIpPrefixInner object itself. + */ + public PublicIpPrefixInner withNatGateway(NatGatewayInner natGateway) { + this.natGateway = natGateway; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the PublicIpPrefixInner object itself. + */ + public PublicIpPrefixInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public PublicIpPrefixInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PublicIpPrefixInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (ipTags() != null) { + ipTags().forEach(e -> e.validate()); + } + if (publicIpAddresses() != null) { + publicIpAddresses().forEach(e -> e.validate()); + } + if (natGateway() != null) { + natGateway().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinksListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinksListResultInner.java new file mode 100644 index 0000000000000..7b0be6da8eeb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinksListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ResourceNavigationLinks_List operation. */ +@Fluent +public final class ResourceNavigationLinksListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNavigationLinksListResultInner.class); + + /* + * The resource navigation links in a subnet. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The resource navigation links in a subnet. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The resource navigation links in a subnet. + * + * @param value the value value to set. + * @return the ResourceNavigationLinksListResultInner object itself. + */ + public ResourceNavigationLinksListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterInner.java new file mode 100644 index 0000000000000..1d070cfab5adc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterInner.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Route Filter Resource. */ +@JsonFlatten +@Fluent +public class RouteFilterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /* + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "properties.peerings", access = JsonProperty.Access.WRITE_ONLY) + private List peerings; + + /* + * A collection of references to express route circuit ipv6 peerings. + */ + @JsonProperty(value = "properties.ipv6Peerings", access = JsonProperty.Access.WRITE_ONLY) + private List ipv6Peerings; + + /* + * The provisioning state of the route filter resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the rules property: Collection of RouteFilterRules contained within a route filter. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Collection of RouteFilterRules contained within a route filter. + * + * @param rules the rules value to set. + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the peerings property: A collection of references to express route circuit peerings. + * + * @return the peerings value. + */ + public List peerings() { + return this.peerings; + } + + /** + * Get the ipv6Peerings property: A collection of references to express route circuit ipv6 peerings. + * + * @return the ipv6Peerings value. + */ + public List ipv6Peerings() { + return this.ipv6Peerings; + } + + /** + * Get the provisioningState property: The provisioning state of the route filter resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteFilterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteFilterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + if (peerings() != null) { + peerings().forEach(e -> e.validate()); + } + if (ipv6Peerings() != null) { + ipv6Peerings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRuleInner.java new file mode 100644 index 0000000000000..316214fefca7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRuleInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route Filter Rule Resource. */ +@JsonFlatten +@Fluent +public class RouteFilterRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRuleInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The access type of the rule. + */ + @JsonProperty(value = "properties.access") + private Access access; + + /* + * The rule type of the rule. + */ + @JsonProperty(value = "properties.routeFilterRuleType") + private RouteFilterRuleType routeFilterRuleType; + + /* + * The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "properties.communities") + private List communities; + + /* + * The provisioning state of the route filter rule resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the access property: The access type of the rule. + * + * @return the access value. + */ + public Access access() { + return this.access; + } + + /** + * Set the access property: The access type of the rule. + * + * @param access the access value to set. + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the routeFilterRuleType property: The rule type of the rule. + * + * @return the routeFilterRuleType value. + */ + public RouteFilterRuleType routeFilterRuleType() { + return this.routeFilterRuleType; + } + + /** + * Set the routeFilterRuleType property: The rule type of the rule. + * + * @param routeFilterRuleType the routeFilterRuleType value to set. + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withRouteFilterRuleType(RouteFilterRuleType routeFilterRuleType) { + this.routeFilterRuleType = routeFilterRuleType; + return this; + } + + /** + * Get the communities property: The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + * + * @return the communities value. + */ + public List communities() { + return this.communities; + } + + /** + * Set the communities property: The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + * + * @param communities the communities value to set. + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the route filter rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public RouteFilterRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteInner.java new file mode 100644 index 0000000000000..e5ce82f717804 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteInner.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route resource. */ +@JsonFlatten +@Fluent +public class RouteInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The destination CIDR to which the route applies. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /* + * The type of Azure hop the packet should be sent to. + */ + @JsonProperty(value = "properties.nextHopType") + private RouteNextHopType nextHopType; + + /* + * The IP address packets should be forwarded to. Next hop values are only + * allowed in routes where the next hop type is VirtualAppliance. + */ + @JsonProperty(value = "properties.nextHopIpAddress") + private String nextHopIpAddress; + + /* + * The provisioning state of the route resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * A value indicating whether this route overrides overlapping BGP routes + * regardless of LPM. + */ + @JsonProperty(value = "properties.hasBgpOverride") + private Boolean hasBgpOverride; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the RouteInner object itself. + */ + public RouteInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the resource. + * + * @param type the type value to set. + * @return the RouteInner object itself. + */ + public RouteInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the addressPrefix property: The destination CIDR to which the route applies. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: The destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set. + * @return the RouteInner object itself. + */ + public RouteInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the nextHopType property: The type of Azure hop the packet should be sent to. + * + * @return the nextHopType value. + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: The type of Azure hop the packet should be sent to. + * + * @param nextHopType the nextHopType value to set. + * @return the RouteInner object itself. + */ + public RouteInner withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values are only + * allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values are only + * allowed in routes where the next hop type is VirtualAppliance. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the RouteInner object itself. + */ + public RouteInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the route resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP routes + * regardless of LPM. + * + * @return the hasBgpOverride value. + */ + public Boolean hasBgpOverride() { + return this.hasBgpOverride; + } + + /** + * Set the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP routes + * regardless of LPM. + * + * @param hasBgpOverride the hasBgpOverride value to set. + * @return the RouteInner object itself. + */ + public RouteInner withHasBgpOverride(Boolean hasBgpOverride) { + this.hasBgpOverride = hasBgpOverride; + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTableInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTableInner.java new file mode 100644 index 0000000000000..43d4996b53c90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTableInner.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.network.generated.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.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Route table resource. */ +@JsonFlatten +@Fluent +public class RouteTableInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTableInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Collection of routes contained within a route table. + */ + @JsonProperty(value = "properties.routes") + private List routes; + + /* + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /* + * Whether to disable the routes learned by BGP on that route table. True + * means disable. + */ + @JsonProperty(value = "properties.disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /* + * The provisioning state of the route table resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The resource GUID property of the route table. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the routes property: Collection of routes contained within a route table. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: Collection of routes contained within a route table. + * + * @param routes the routes value to set. + * @return the RouteTableInner object itself. + */ + public RouteTableInner withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Get the subnets property: A collection of references to subnets. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the disableBgpRoutePropagation property: Whether to disable the routes learned by BGP on that route table. + * True means disable. + * + * @return the disableBgpRoutePropagation value. + */ + public Boolean disableBgpRoutePropagation() { + return this.disableBgpRoutePropagation; + } + + /** + * Set the disableBgpRoutePropagation property: Whether to disable the routes learned by BGP on that route table. + * True means disable. + * + * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set. + * @return the RouteTableInner object itself. + */ + public RouteTableInner withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.disableBgpRoutePropagation = disableBgpRoutePropagation; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the route table resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: The resource GUID property of the route table. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the RouteTableInner object itself. + */ + public RouteTableInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteTableInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteTableInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + if (subnets() != null) { + subnets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityGroupViewResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityGroupViewResultInner.java new file mode 100644 index 0000000000000..2624627a15a8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityGroupViewResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.SecurityGroupNetworkInterface; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The information about security rules applied to the specified VM. */ +@Fluent +public final class SecurityGroupViewResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupViewResultInner.class); + + /* + * List of network interfaces on the specified VM. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get the networkInterfaces property: List of network interfaces on the specified VM. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: List of network interfaces on the specified VM. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the SecurityGroupViewResultInner object itself. + */ + public SecurityGroupViewResultInner withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderInner.java new file mode 100644 index 0000000000000..c2667a6b83e81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviderConnectionStatus; +import com.azure.resourcemanager.network.generated.models.SecurityProviderName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Security Partner Provider resource. */ +@JsonFlatten +@Fluent +public class SecurityPartnerProviderInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPartnerProviderInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The provisioning state of the Security Partner Provider resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The security provider name. + */ + @JsonProperty(value = "properties.securityProviderName") + private SecurityProviderName securityProviderName; + + /* + * The connection status with the Security Partner Provider. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private SecurityPartnerProviderConnectionStatus connectionStatus; + + /* + * The virtualHub to which the Security Partner Provider belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioningState property: The provisioning state of the Security Partner Provider resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the securityProviderName property: The security provider name. + * + * @return the securityProviderName value. + */ + public SecurityProviderName securityProviderName() { + return this.securityProviderName; + } + + /** + * Set the securityProviderName property: The security provider name. + * + * @param securityProviderName the securityProviderName value to set. + * @return the SecurityPartnerProviderInner object itself. + */ + public SecurityPartnerProviderInner withSecurityProviderName(SecurityProviderName securityProviderName) { + this.securityProviderName = securityProviderName; + return this; + } + + /** + * Get the connectionStatus property: The connection status with the Security Partner Provider. + * + * @return the connectionStatus value. + */ + public SecurityPartnerProviderConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the virtualHub property: The virtualHub to which the Security Partner Provider belongs. + * + * @return the virtualHub value. + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the virtualHub property: The virtualHub to which the Security Partner Provider belongs. + * + * @param virtualHub the virtualHub value to set. + * @return the SecurityPartnerProviderInner object itself. + */ + public SecurityPartnerProviderInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the SecurityPartnerProviderInner object itself. + */ + public SecurityPartnerProviderInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityPartnerProviderInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecurityPartnerProviderInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRuleInner.java new file mode 100644 index 0000000000000..e463c9a1d59c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRuleInner.java @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network security rule. */ +@JsonFlatten +@Fluent +public class SecurityRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRuleInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /* + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Network protocol this rule applies to. + */ + @JsonProperty(value = "properties.protocol") + private SecurityRuleProtocol protocol; + + /* + * The source port or range. Integer or range between 0 and 65535. Asterisk + * '*' can also be used to match all ports. + */ + @JsonProperty(value = "properties.sourcePortRange") + private String sourcePortRange; + + /* + * The destination port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports. + */ + @JsonProperty(value = "properties.destinationPortRange") + private String destinationPortRange; + + /* + * The CIDR or source IP range. Asterisk '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' + * and 'Internet' can also be used. If this is an ingress rule, specifies + * where network traffic originates from. + */ + @JsonProperty(value = "properties.sourceAddressPrefix") + private String sourceAddressPrefix; + + /* + * The CIDR or source IP ranges. + */ + @JsonProperty(value = "properties.sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /* + * The application security group specified as source. + */ + @JsonProperty(value = "properties.sourceApplicationSecurityGroups") + private List sourceApplicationSecurityGroups; + + /* + * The destination address prefix. CIDR or destination IP range. Asterisk + * '*' can also be used to match all source IPs. Default tags such as + * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + */ + @JsonProperty(value = "properties.destinationAddressPrefix") + private String destinationAddressPrefix; + + /* + * The destination address prefixes. CIDR or destination IP ranges. + */ + @JsonProperty(value = "properties.destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /* + * The application security group specified as destination. + */ + @JsonProperty(value = "properties.destinationApplicationSecurityGroups") + private List destinationApplicationSecurityGroups; + + /* + * The source port ranges. + */ + @JsonProperty(value = "properties.sourcePortRanges") + private List sourcePortRanges; + + /* + * The destination port ranges. + */ + @JsonProperty(value = "properties.destinationPortRanges") + private List destinationPortRanges; + + /* + * The network traffic is allowed or denied. + */ + @JsonProperty(value = "properties.access") + private SecurityRuleAccess access; + + /* + * The priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The + * lower the priority number, the higher the priority of the rule. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /* + * The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outgoing traffic. + */ + @JsonProperty(value = "properties.direction") + private SecurityRuleDirection direction; + + /* + * The provisioning state of the security rule resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the resource. + * + * @param type the type value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description for this rule. Restricted to 140 chars. + * + * @param description the description value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Network protocol this rule applies to. + * + * @param protocol the protocol value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withProtocol(SecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisk '*' + * can also be used to match all ports. + * + * @return the sourcePortRange value. + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisk '*' + * can also be used to match all ports. + * + * @param sourcePortRange the sourcePortRange value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports. + * + * @return the destinationPortRange value. + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports. + * + * @param destinationPortRange the destinationPortRange value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this + * is an ingress rule, specifies where network traffic originates from. + * + * @return the sourceAddressPrefix value. + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this + * is an ingress rule, specifies where network traffic originates from. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the sourceAddressPrefixes property: The CIDR or source IP ranges. + * + * @return the sourceAddressPrefixes value. + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the sourceAddressPrefixes property: The CIDR or source IP ranges. + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the sourceApplicationSecurityGroups property: The application security group specified as source. + * + * @return the sourceApplicationSecurityGroups value. + */ + public List sourceApplicationSecurityGroups() { + return this.sourceApplicationSecurityGroups; + } + + /** + * Set the sourceApplicationSecurityGroups property: The application security group specified as source. + * + * @param sourceApplicationSecurityGroups the sourceApplicationSecurityGroups value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceApplicationSecurityGroups( + List sourceApplicationSecurityGroups) { + this.sourceApplicationSecurityGroups = sourceApplicationSecurityGroups; + return this; + } + + /** + * Get the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. Asterisk + * '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + * 'Internet' can also be used. + * + * @return the destinationAddressPrefix value. + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. Asterisk + * '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + * 'Internet' can also be used. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinationAddressPrefixes value. + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges. + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the destinationApplicationSecurityGroups property: The application security group specified as destination. + * + * @return the destinationApplicationSecurityGroups value. + */ + public List destinationApplicationSecurityGroups() { + return this.destinationApplicationSecurityGroups; + } + + /** + * Set the destinationApplicationSecurityGroups property: The application security group specified as destination. + * + * @param destinationApplicationSecurityGroups the destinationApplicationSecurityGroups value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationApplicationSecurityGroups( + List destinationApplicationSecurityGroups) { + this.destinationApplicationSecurityGroups = destinationApplicationSecurityGroups; + return this; + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the sourcePortRanges property: The source port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destinationPortRanges property: The destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the access property: The network traffic is allowed or denied. + * + * @return the access value. + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set the access property: The network traffic is allowed or denied. + * + * @param access the access value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number + * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the + * rule. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number + * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the + * rule. + * + * @param priority the priority value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction property: The direction of the rule. The direction specifies if rule will be evaluated on + * incoming or outgoing traffic. + * + * @return the direction value. + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of the rule. The direction specifies if rule will be evaluated on + * incoming or outgoing traffic. + * + * @param direction the direction value to set. + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the security rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public SecurityRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceApplicationSecurityGroups() != null) { + sourceApplicationSecurityGroups().forEach(e -> e.validate()); + } + if (destinationApplicationSecurityGroups() != null) { + destinationApplicationSecurityGroups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinksListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinksListResultInner.java new file mode 100644 index 0000000000000..41b30c4f96ddc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinksListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ServiceAssociationLinks_List operation. */ +@Fluent +public final class ServiceAssociationLinksListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceAssociationLinksListResultInner.class); + + /* + * The service association links in a subnet. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The service association links in a subnet. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The service association links in a subnet. + * + * @param value the value value to set. + * @return the ServiceAssociationLinksListResultInner object itself. + */ + public ServiceAssociationLinksListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionInner.java new file mode 100644 index 0000000000000..6be59c118ebc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionInner.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Endpoint policy definitions. */ +@JsonFlatten +@Fluent +public class ServiceEndpointPolicyDefinitionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Service endpoint name. + */ + @JsonProperty(value = "properties.service") + private String service; + + /* + * A list of service resources. + */ + @JsonProperty(value = "properties.serviceResources") + private List serviceResources; + + /* + * The provisioning state of the service endpoint policy definition + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description for this rule. Restricted to 140 chars. + * + * @param description the description value to set. + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the service property: Service endpoint name. + * + * @return the service value. + */ + public String service() { + return this.service; + } + + /** + * Set the service property: Service endpoint name. + * + * @param service the service value to set. + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withService(String service) { + this.service = service; + return this; + } + + /** + * Get the serviceResources property: A list of service resources. + * + * @return the serviceResources value. + */ + public List serviceResources() { + return this.serviceResources; + } + + /** + * Set the serviceResources property: A list of service resources. + * + * @param serviceResources the serviceResources value to set. + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withServiceResources(List serviceResources) { + this.serviceResources = serviceResources; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the service endpoint policy definition resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ServiceEndpointPolicyDefinitionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyInner.java new file mode 100644 index 0000000000000..707e131894277 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyInner.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.network.generated.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.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Service End point policy resource. */ +@JsonFlatten +@Fluent +public class ServiceEndpointPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Kind of service endpoint policy. This is metadata used for the Azure + * portal experience. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * A collection of service endpoint policy definitions of the service + * endpoint policy. + */ + @JsonProperty(value = "properties.serviceEndpointPolicyDefinitions") + private List serviceEndpointPolicyDefinitions; + + /* + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /* + * The resource GUID property of the service endpoint policy resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the service endpoint policy resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the kind property: Kind of service endpoint policy. This is metadata used for the Azure portal experience. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the serviceEndpointPolicyDefinitions property: A collection of service endpoint policy definitions of the + * service endpoint policy. + * + * @return the serviceEndpointPolicyDefinitions value. + */ + public List serviceEndpointPolicyDefinitions() { + return this.serviceEndpointPolicyDefinitions; + } + + /** + * Set the serviceEndpointPolicyDefinitions property: A collection of service endpoint policy definitions of the + * service endpoint policy. + * + * @param serviceEndpointPolicyDefinitions the serviceEndpointPolicyDefinitions value to set. + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withServiceEndpointPolicyDefinitions( + List serviceEndpointPolicyDefinitions) { + this.serviceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; + return this; + } + + /** + * Get the subnets property: A collection of references to subnets. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the resourceGuid property: The resource GUID property of the service endpoint policy resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the service endpoint policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceEndpointPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceEndpointPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceEndpointPolicyDefinitions() != null) { + serviceEndpointPolicyDefinitions().forEach(e -> e.validate()); + } + if (subnets() != null) { + subnets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagsListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagsListResultInner.java new file mode 100644 index 0000000000000..e2ede8f250e9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagsListResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ServiceTagInformation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListServiceTags API service call. */ +@Immutable +public final class ServiceTagsListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTagsListResultInner.class); + + /* + * The name of the cloud. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The ID of the cloud. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The azure resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The iteration number. + */ + @JsonProperty(value = "changeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String changeNumber; + + /* + * The name of the cloud. + */ + @JsonProperty(value = "cloud", access = JsonProperty.Access.WRITE_ONLY) + private String cloud; + + /* + * The list of service tag information resources. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * The URL to get next page of service tag information resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the name property: The name of the cloud. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: The ID of the cloud. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: The azure resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the changeNumber property: The iteration number. + * + * @return the changeNumber value. + */ + public String changeNumber() { + return this.changeNumber; + } + + /** + * Get the cloud property: The name of the cloud. + * + * @return the cloud value. + */ + public String cloud() { + return this.cloud; + } + + /** + * Get the values property: The list of service tag information resources. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the nextLink property: The URL to get next page of service tag information resources. + * + * @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 (values() != null) { + values().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetInner.java new file mode 100644 index 0000000000000..e0e6759304ed0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetInner.java @@ -0,0 +1,578 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet in a virtual network resource. */ +@JsonFlatten +@Fluent +public class SubnetInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The address prefix for the subnet. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /* + * List of address prefixes for the subnet. + */ + @JsonProperty(value = "properties.addressPrefixes") + private List addressPrefixes; + + /* + * The reference to the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /* + * The reference to the RouteTable resource. + */ + @JsonProperty(value = "properties.routeTable") + private RouteTableInner routeTable; + + /* + * Nat gateway associated with this subnet. + */ + @JsonProperty(value = "properties.natGateway") + private SubResource natGateway; + + /* + * An array of service endpoints. + */ + @JsonProperty(value = "properties.serviceEndpoints") + private List serviceEndpoints; + + /* + * An array of service endpoint policies. + */ + @JsonProperty(value = "properties.serviceEndpointPolicies") + private List serviceEndpointPolicies; + + /* + * An array of references to private endpoints. + */ + @JsonProperty(value = "properties.privateEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpoints; + + /* + * An array of references to the network interface IP configurations using + * subnet. + */ + @JsonProperty(value = "properties.ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /* + * Array of IP configuration profiles which reference this subnet. + */ + @JsonProperty(value = "properties.ipConfigurationProfiles", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurationProfiles; + + /* + * Array of IpAllocation which reference this subnet. + */ + @JsonProperty(value = "properties.ipAllocations") + private List ipAllocations; + + /* + * An array of references to the external resources using subnet. + */ + @JsonProperty(value = "properties.resourceNavigationLinks", access = JsonProperty.Access.WRITE_ONLY) + private List resourceNavigationLinks; + + /* + * An array of references to services injecting into this subnet. + */ + @JsonProperty(value = "properties.serviceAssociationLinks", access = JsonProperty.Access.WRITE_ONLY) + private List serviceAssociationLinks; + + /* + * An array of references to the delegations on the subnet. + */ + @JsonProperty(value = "properties.delegations") + private List delegations; + + /* + * A read-only string identifying the intention of use for this subnet + * based on delegations and other user-defined properties. + */ + @JsonProperty(value = "properties.purpose", access = JsonProperty.Access.WRITE_ONLY) + private String purpose; + + /* + * The provisioning state of the subnet resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Enable or Disable apply network policies on private end point in the + * subnet. + */ + @JsonProperty(value = "properties.privateEndpointNetworkPolicies") + private VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies; + + /* + * Enable or Disable apply network policies on private link service in the + * subnet. + */ + @JsonProperty(value = "properties.privateLinkServiceNetworkPolicies") + private VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies; + + /* + * Application gateway IP configurations of virtual network resource. + */ + @JsonProperty(value = "properties.applicationGatewayIpConfigurations") + private List applicationGatewayIpConfigurations; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. + * + * @param type the type value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the addressPrefix property: The address prefix for the subnet. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: The address prefix for the subnet. + * + * @param addressPrefix the addressPrefix value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the addressPrefixes property: List of address prefixes for the subnet. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: List of address prefixes for the subnet. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value. + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the routeTable property: The reference to the RouteTable resource. + * + * @return the routeTable value. + */ + public RouteTableInner routeTable() { + return this.routeTable; + } + + /** + * Set the routeTable property: The reference to the RouteTable resource. + * + * @param routeTable the routeTable value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withRouteTable(RouteTableInner routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get the natGateway property: Nat gateway associated with this subnet. + * + * @return the natGateway value. + */ + public SubResource natGateway() { + return this.natGateway; + } + + /** + * Set the natGateway property: Nat gateway associated with this subnet. + * + * @param natGateway the natGateway value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withNatGateway(SubResource natGateway) { + this.natGateway = natGateway; + return this; + } + + /** + * Get the serviceEndpoints property: An array of service endpoints. + * + * @return the serviceEndpoints value. + */ + public List serviceEndpoints() { + return this.serviceEndpoints; + } + + /** + * Set the serviceEndpoints property: An array of service endpoints. + * + * @param serviceEndpoints the serviceEndpoints value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceEndpoints(List serviceEndpoints) { + this.serviceEndpoints = serviceEndpoints; + return this; + } + + /** + * Get the serviceEndpointPolicies property: An array of service endpoint policies. + * + * @return the serviceEndpointPolicies value. + */ + public List serviceEndpointPolicies() { + return this.serviceEndpointPolicies; + } + + /** + * Set the serviceEndpointPolicies property: An array of service endpoint policies. + * + * @param serviceEndpointPolicies the serviceEndpointPolicies value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.serviceEndpointPolicies = serviceEndpointPolicies; + return this; + } + + /** + * Get the privateEndpoints property: An array of references to private endpoints. + * + * @return the privateEndpoints value. + */ + public List privateEndpoints() { + return this.privateEndpoints; + } + + /** + * Get the ipConfigurations property: An array of references to the network interface IP configurations using + * subnet. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Get the ipConfigurationProfiles property: Array of IP configuration profiles which reference this subnet. + * + * @return the ipConfigurationProfiles value. + */ + public List ipConfigurationProfiles() { + return this.ipConfigurationProfiles; + } + + /** + * Get the ipAllocations property: Array of IpAllocation which reference this subnet. + * + * @return the ipAllocations value. + */ + public List ipAllocations() { + return this.ipAllocations; + } + + /** + * Set the ipAllocations property: Array of IpAllocation which reference this subnet. + * + * @param ipAllocations the ipAllocations value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withIpAllocations(List ipAllocations) { + this.ipAllocations = ipAllocations; + return this; + } + + /** + * Get the resourceNavigationLinks property: An array of references to the external resources using subnet. + * + * @return the resourceNavigationLinks value. + */ + public List resourceNavigationLinks() { + return this.resourceNavigationLinks; + } + + /** + * Get the serviceAssociationLinks property: An array of references to services injecting into this subnet. + * + * @return the serviceAssociationLinks value. + */ + public List serviceAssociationLinks() { + return this.serviceAssociationLinks; + } + + /** + * Get the delegations property: An array of references to the delegations on the subnet. + * + * @return the delegations value. + */ + public List delegations() { + return this.delegations; + } + + /** + * Set the delegations property: An array of references to the delegations on the subnet. + * + * @param delegations the delegations value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withDelegations(List delegations) { + this.delegations = delegations; + return this; + } + + /** + * Get the purpose property: A read-only string identifying the intention of use for this subnet based on + * delegations and other user-defined properties. + * + * @return the purpose value. + */ + public String purpose() { + return this.purpose; + } + + /** + * Get the provisioningState property: The provisioning state of the subnet resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on private end point in + * the subnet. + * + * @return the privateEndpointNetworkPolicies value. + */ + public VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies() { + return this.privateEndpointNetworkPolicies; + } + + /** + * Set the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on private end point in + * the subnet. + * + * @param privateEndpointNetworkPolicies the privateEndpointNetworkPolicies value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies) { + this.privateEndpointNetworkPolicies = privateEndpointNetworkPolicies; + return this; + } + + /** + * Get the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on private link + * service in the subnet. + * + * @return the privateLinkServiceNetworkPolicies value. + */ + public VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies() { + return this.privateLinkServiceNetworkPolicies; + } + + /** + * Set the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on private link + * service in the subnet. + * + * @param privateLinkServiceNetworkPolicies the privateLinkServiceNetworkPolicies value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies) { + this.privateLinkServiceNetworkPolicies = privateLinkServiceNetworkPolicies; + return this; + } + + /** + * Get the applicationGatewayIpConfigurations property: Application gateway IP configurations of virtual network + * resource. + * + * @return the applicationGatewayIpConfigurations value. + */ + public List applicationGatewayIpConfigurations() { + return this.applicationGatewayIpConfigurations; + } + + /** + * Set the applicationGatewayIpConfigurations property: Application gateway IP configurations of virtual network + * resource. + * + * @param applicationGatewayIpConfigurations the applicationGatewayIpConfigurations value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations) { + this.applicationGatewayIpConfigurations = applicationGatewayIpConfigurations; + return this; + } + + /** {@inheritDoc} */ + @Override + public SubnetInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkSecurityGroup() != null) { + networkSecurityGroup().validate(); + } + if (routeTable() != null) { + routeTable().validate(); + } + if (serviceEndpoints() != null) { + serviceEndpoints().forEach(e -> e.validate()); + } + if (serviceEndpointPolicies() != null) { + serviceEndpointPolicies().forEach(e -> e.validate()); + } + if (privateEndpoints() != null) { + privateEndpoints().forEach(e -> e.validate()); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (ipConfigurationProfiles() != null) { + ipConfigurationProfiles().forEach(e -> e.validate()); + } + if (resourceNavigationLinks() != null) { + resourceNavigationLinks().forEach(e -> e.validate()); + } + if (serviceAssociationLinks() != null) { + serviceAssociationLinks().forEach(e -> e.validate()); + } + if (delegations() != null) { + delegations().forEach(e -> e.validate()); + } + if (applicationGatewayIpConfigurations() != null) { + applicationGatewayIpConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TopologyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TopologyInner.java new file mode 100644 index 0000000000000..e238779d72487 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TopologyInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.TopologyResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Topology of the specified resource group. */ +@Fluent +public final class TopologyInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyInner.class); + + /* + * GUID representing the operation id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The datetime when the topology was initially created for the resource + * group. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * The datetime when the topology was last modified. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModified; + + /* + * A list of topology resources. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * Get the id property: GUID representing the operation id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the createdDateTime property: The datetime when the topology was initially created for the resource group. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastModified property: The datetime when the topology was last modified. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the resources property: A list of topology resources. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources property: A list of topology resources. + * + * @param resources the resources value to set. + * @return the TopologyInner object itself. + */ + public TopologyInner withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resources() != null) { + resources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingResultInner.java new file mode 100644 index 0000000000000..64364e1fabd6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.TroubleshootingDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Troubleshooting information gained from specified resource. */ +@Fluent +public final class TroubleshootingResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingResultInner.class); + + /* + * The start time of the troubleshooting. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the troubleshooting. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The result code of the troubleshooting. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Information from troubleshooting. + */ + @JsonProperty(value = "results") + private List results; + + /** + * Get the startTime property: The start time of the troubleshooting. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the troubleshooting. + * + * @param startTime the startTime value to set. + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the troubleshooting. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the troubleshooting. + * + * @param endTime the endTime value to set. + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the code property: The result code of the troubleshooting. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The result code of the troubleshooting. + * + * @param code the code value to set. + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the results property: Information from troubleshooting. + * + * @return the results value. + */ + public List results() { + return this.results; + } + + /** + * Set the results property: Information from troubleshooting. + * + * @param results the results value to set. + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withResults(List results) { + this.results = results; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (results() != null) { + results().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/UsageInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/UsageInner.java new file mode 100644 index 0000000000000..4f7049a01ce05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/UsageInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.UsageName; +import com.azure.resourcemanager.network.generated.models.UsageUnit; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The network resource usage. */ +@Fluent +public final class UsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); + + /* + * Resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * An enum describing the unit of measurement. + */ + @JsonProperty(value = "unit", required = true) + private UsageUnit unit; + + /* + * The current value of the usage. + */ + @JsonProperty(value = "currentValue", required = true) + private long currentValue; + + /* + * The limit of usage. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /* + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** + * Get the id property: Resource identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the unit property: An enum describing the unit of measurement. + * + * @return the unit value. + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Set the unit property: An enum describing the unit of measurement. + * + * @param unit the unit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withUnit(UsageUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + public long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: The current value of the usage. + * + * @param currentValue the currentValue value to set. + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit property: The limit of usage. + * + * @return the limit value. + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit property: The limit of usage. + * + * @param limit the limit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name property: The name of the type of usage. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name property: The name of the type of usage. + * + * @param name the name value to set. + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (unit() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property unit in model UsageInner")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model UsageInner")); + } else { + name().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VerificationIpFlowResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VerificationIpFlowResultInner.java new file mode 100644 index 0000000000000..877c967089594 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VerificationIpFlowResultInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.Access; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Results of IP flow verification on the target resource. */ +@Fluent +public final class VerificationIpFlowResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VerificationIpFlowResultInner.class); + + /* + * Indicates whether the traffic is allowed or denied. + */ + @JsonProperty(value = "access") + private Access access; + + /* + * Name of the rule. If input is not matched against any security rule, it + * is not displayed. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** + * Get the access property: Indicates whether the traffic is allowed or denied. + * + * @return the access value. + */ + public Access access() { + return this.access; + } + + /** + * Set the access property: Indicates whether the traffic is allowed or denied. + * + * @param access the access value to set. + * @return the VerificationIpFlowResultInner object itself. + */ + public VerificationIpFlowResultInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the ruleName property: Name of the rule. If input is not matched against any security rule, it is not + * displayed. + * + * @return the ruleName value. + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set the ruleName property: Name of the rule. If input is not matched against any security rule, it is not + * displayed. + * + * @param ruleName the ruleName value to set. + * @return the VerificationIpFlowResultInner object itself. + */ + public VerificationIpFlowResultInner withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteInner.java new file mode 100644 index 0000000000000..ef53e4b543658 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Appliance Site resource. */ +@JsonFlatten +@Fluent +public class VirtualApplianceSiteInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceSiteInner.class); + + /* + * Name of the virtual appliance site. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Site type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Address Prefix. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /* + * Office 365 Policy. + */ + @JsonProperty(value = "properties.o365Policy") + private Office365PolicyProperties o365Policy; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the virtual appliance site. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the virtual appliance site. + * + * @param name the name value to set. + * @return the VirtualApplianceSiteInner object itself. + */ + public VirtualApplianceSiteInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Site type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the addressPrefix property: Address Prefix. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: Address Prefix. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualApplianceSiteInner object itself. + */ + public VirtualApplianceSiteInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the o365Policy property: Office 365 Policy. + * + * @return the o365Policy value. + */ + public Office365PolicyProperties o365Policy() { + return this.o365Policy; + } + + /** + * Set the o365Policy property: Office 365 Policy. + * + * @param o365Policy the o365Policy value to set. + * @return the VirtualApplianceSiteInner object itself. + */ + public VirtualApplianceSiteInner withO365Policy(Office365PolicyProperties o365Policy) { + this.o365Policy = o365Policy; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public VirtualApplianceSiteInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (o365Policy() != null) { + o365Policy().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubInner.java new file mode 100644 index 0000000000000..e1c9168463174 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubInner.java @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PreferredRoutingGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualHub Resource. */ +@JsonFlatten +@Fluent +public class VirtualHubInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The VirtualWAN to which the VirtualHub belongs. + */ + @JsonProperty(value = "properties.virtualWan") + private SubResource virtualWan; + + /* + * The VpnGateway associated with this VirtualHub. + */ + @JsonProperty(value = "properties.vpnGateway") + private SubResource vpnGateway; + + /* + * The P2SVpnGateway associated with this VirtualHub. + */ + @JsonProperty(value = "properties.p2SVpnGateway") + private SubResource p2SVpnGateway; + + /* + * The expressRouteGateway associated with this VirtualHub. + */ + @JsonProperty(value = "properties.expressRouteGateway") + private SubResource expressRouteGateway; + + /* + * The azureFirewall associated with this VirtualHub. + */ + @JsonProperty(value = "properties.azureFirewall") + private SubResource azureFirewall; + + /* + * The securityPartnerProvider associated with this VirtualHub. + */ + @JsonProperty(value = "properties.securityPartnerProvider") + private SubResource securityPartnerProvider; + + /* + * Address-prefix for this VirtualHub. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /* + * The routeTable associated with this virtual hub. + */ + @JsonProperty(value = "properties.routeTable") + private VirtualHubRouteTable routeTable; + + /* + * The provisioning state of the virtual hub resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The Security Provider name. + */ + @JsonProperty(value = "properties.securityProviderName") + private String securityProviderName; + + /* + * List of all virtual hub route table v2s associated with this VirtualHub. + */ + @JsonProperty(value = "properties.virtualHubRouteTableV2s") + private List virtualHubRouteTableV2S; + + /* + * The sku of this VirtualHub. + */ + @JsonProperty(value = "properties.sku") + private String sku; + + /* + * The routing state. + */ + @JsonProperty(value = "properties.routingState", access = JsonProperty.Access.WRITE_ONLY) + private RoutingState routingState; + + /* + * List of references to Bgp Connections. + */ + @JsonProperty(value = "properties.bgpConnections", access = JsonProperty.Access.WRITE_ONLY) + private List bgpConnections; + + /* + * List of references to IpConfigurations. + */ + @JsonProperty(value = "properties.ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /* + * VirtualRouter ASN. + */ + @JsonProperty(value = "properties.virtualRouterAsn") + private Long virtualRouterAsn; + + /* + * VirtualRouter IPs. + */ + @JsonProperty(value = "properties.virtualRouterIps") + private List virtualRouterIps; + + /* + * Flag to control transit for VirtualRouter hub. + */ + @JsonProperty(value = "properties.allowBranchToBranchTraffic") + private Boolean allowBranchToBranchTraffic; + + /* + * The preferred gateway to route on-prem traffic + */ + @JsonProperty(value = "properties.preferredRoutingGateway") + private PreferredRoutingGateway preferredRoutingGateway; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the virtualWan property: The VirtualWAN to which the VirtualHub belongs. + * + * @return the virtualWan value. + */ + public SubResource virtualWan() { + return this.virtualWan; + } + + /** + * Set the virtualWan property: The VirtualWAN to which the VirtualHub belongs. + * + * @param virtualWan the virtualWan value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualWan(SubResource virtualWan) { + this.virtualWan = virtualWan; + return this; + } + + /** + * Get the vpnGateway property: The VpnGateway associated with this VirtualHub. + * + * @return the vpnGateway value. + */ + public SubResource vpnGateway() { + return this.vpnGateway; + } + + /** + * Set the vpnGateway property: The VpnGateway associated with this VirtualHub. + * + * @param vpnGateway the vpnGateway value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVpnGateway(SubResource vpnGateway) { + this.vpnGateway = vpnGateway; + return this; + } + + /** + * Get the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub. + * + * @return the p2SVpnGateway value. + */ + public SubResource p2SVpnGateway() { + return this.p2SVpnGateway; + } + + /** + * Set the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub. + * + * @param p2SVpnGateway the p2SVpnGateway value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withP2SVpnGateway(SubResource p2SVpnGateway) { + this.p2SVpnGateway = p2SVpnGateway; + return this; + } + + /** + * Get the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub. + * + * @return the expressRouteGateway value. + */ + public SubResource expressRouteGateway() { + return this.expressRouteGateway; + } + + /** + * Set the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub. + * + * @param expressRouteGateway the expressRouteGateway value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withExpressRouteGateway(SubResource expressRouteGateway) { + this.expressRouteGateway = expressRouteGateway; + return this; + } + + /** + * Get the azureFirewall property: The azureFirewall associated with this VirtualHub. + * + * @return the azureFirewall value. + */ + public SubResource azureFirewall() { + return this.azureFirewall; + } + + /** + * Set the azureFirewall property: The azureFirewall associated with this VirtualHub. + * + * @param azureFirewall the azureFirewall value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withAzureFirewall(SubResource azureFirewall) { + this.azureFirewall = azureFirewall; + return this; + } + + /** + * Get the securityPartnerProvider property: The securityPartnerProvider associated with this VirtualHub. + * + * @return the securityPartnerProvider value. + */ + public SubResource securityPartnerProvider() { + return this.securityPartnerProvider; + } + + /** + * Set the securityPartnerProvider property: The securityPartnerProvider associated with this VirtualHub. + * + * @param securityPartnerProvider the securityPartnerProvider value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withSecurityPartnerProvider(SubResource securityPartnerProvider) { + this.securityPartnerProvider = securityPartnerProvider; + return this; + } + + /** + * Get the addressPrefix property: Address-prefix for this VirtualHub. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: Address-prefix for this VirtualHub. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the routeTable property: The routeTable associated with this virtual hub. + * + * @return the routeTable value. + */ + public VirtualHubRouteTable routeTable() { + return this.routeTable; + } + + /** + * Set the routeTable property: The routeTable associated with this virtual hub. + * + * @param routeTable the routeTable value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withRouteTable(VirtualHubRouteTable routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual hub resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the securityProviderName property: The Security Provider name. + * + * @return the securityProviderName value. + */ + public String securityProviderName() { + return this.securityProviderName; + } + + /** + * Set the securityProviderName property: The Security Provider name. + * + * @param securityProviderName the securityProviderName value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withSecurityProviderName(String securityProviderName) { + this.securityProviderName = securityProviderName; + return this; + } + + /** + * Get the virtualHubRouteTableV2S property: List of all virtual hub route table v2s associated with this + * VirtualHub. + * + * @return the virtualHubRouteTableV2S value. + */ + public List virtualHubRouteTableV2S() { + return this.virtualHubRouteTableV2S; + } + + /** + * Set the virtualHubRouteTableV2S property: List of all virtual hub route table v2s associated with this + * VirtualHub. + * + * @param virtualHubRouteTableV2S the virtualHubRouteTableV2S value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualHubRouteTableV2S(List virtualHubRouteTableV2S) { + this.virtualHubRouteTableV2S = virtualHubRouteTableV2S; + return this; + } + + /** + * Get the sku property: The sku of this VirtualHub. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The sku of this VirtualHub. + * + * @param sku the sku value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the routingState property: The routing state. + * + * @return the routingState value. + */ + public RoutingState routingState() { + return this.routingState; + } + + /** + * Get the bgpConnections property: List of references to Bgp Connections. + * + * @return the bgpConnections value. + */ + public List bgpConnections() { + return this.bgpConnections; + } + + /** + * Get the ipConfigurations property: List of references to IpConfigurations. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Get the virtualRouterAsn property: VirtualRouter ASN. + * + * @return the virtualRouterAsn value. + */ + public Long virtualRouterAsn() { + return this.virtualRouterAsn; + } + + /** + * Set the virtualRouterAsn property: VirtualRouter ASN. + * + * @param virtualRouterAsn the virtualRouterAsn value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualRouterAsn(Long virtualRouterAsn) { + this.virtualRouterAsn = virtualRouterAsn; + return this; + } + + /** + * Get the virtualRouterIps property: VirtualRouter IPs. + * + * @return the virtualRouterIps value. + */ + public List virtualRouterIps() { + return this.virtualRouterIps; + } + + /** + * Set the virtualRouterIps property: VirtualRouter IPs. + * + * @param virtualRouterIps the virtualRouterIps value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualRouterIps(List virtualRouterIps) { + this.virtualRouterIps = virtualRouterIps; + return this; + } + + /** + * Get the allowBranchToBranchTraffic property: Flag to control transit for VirtualRouter hub. + * + * @return the allowBranchToBranchTraffic value. + */ + public Boolean allowBranchToBranchTraffic() { + return this.allowBranchToBranchTraffic; + } + + /** + * Set the allowBranchToBranchTraffic property: Flag to control transit for VirtualRouter hub. + * + * @param allowBranchToBranchTraffic the allowBranchToBranchTraffic value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.allowBranchToBranchTraffic = allowBranchToBranchTraffic; + return this; + } + + /** + * Get the preferredRoutingGateway property: The preferred gateway to route on-prem traffic. + * + * @return the preferredRoutingGateway value. + */ + public PreferredRoutingGateway preferredRoutingGateway() { + return this.preferredRoutingGateway; + } + + /** + * Set the preferredRoutingGateway property: The preferred gateway to route on-prem traffic. + * + * @param preferredRoutingGateway the preferredRoutingGateway value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withPreferredRoutingGateway(PreferredRoutingGateway preferredRoutingGateway) { + this.preferredRoutingGateway = preferredRoutingGateway; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualHubInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualHubInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routeTable() != null) { + routeTable().validate(); + } + if (virtualHubRouteTableV2S() != null) { + virtualHubRouteTableV2S().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Inner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Inner.java new file mode 100644 index 0000000000000..b1682f0868160 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Inner.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubRouteTableV2 Resource. */ +@JsonFlatten +@Fluent +public class VirtualHubRouteTableV2Inner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteTableV2Inner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * List of all routes. + */ + @JsonProperty(value = "properties.routes") + private List routes; + + /* + * List of all connections attached to this route table v2. + */ + @JsonProperty(value = "properties.attachedConnections") + private List attachedConnections; + + /* + * The provisioning state of the virtual hub route table v2 resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VirtualHubRouteTableV2Inner object itself. + */ + public VirtualHubRouteTableV2Inner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the routes property: List of all routes. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: List of all routes. + * + * @param routes the routes value to set. + * @return the VirtualHubRouteTableV2Inner object itself. + */ + public VirtualHubRouteTableV2Inner withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Get the attachedConnections property: List of all connections attached to this route table v2. + * + * @return the attachedConnections value. + */ + public List attachedConnections() { + return this.attachedConnections; + } + + /** + * Set the attachedConnections property: List of all connections attached to this route table v2. + * + * @param attachedConnections the attachedConnections value to set. + * @return the VirtualHubRouteTableV2Inner object itself. + */ + public VirtualHubRouteTableV2Inner withAttachedConnections(List attachedConnections) { + this.attachedConnections = attachedConnections; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual hub route table v2 resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public VirtualHubRouteTableV2Inner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionInner.java new file mode 100644 index 0000000000000..3e6477cd19794 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionInner.java @@ -0,0 +1,715 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A common class for general resource information. */ +@JsonFlatten +@Fluent +public class VirtualNetworkGatewayConnectionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /* + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkGatewayInner virtualNetworkGateway1; + + /* + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkGatewayInner virtualNetworkGateway2; + + /* + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private LocalNetworkGatewayInner localNetworkGateway2; + + /* + * List of ingress NatRules. + */ + @JsonProperty(value = "properties.ingressNatRules") + private List ingressNatRules; + + /* + * List of egress NatRules. + */ + @JsonProperty(value = "properties.egressNatRules") + private List egressNatRules; + + /* + * Gateway connection type. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /* + * Connection protocol used for this connection. + */ + @JsonProperty(value = "properties.connectionProtocol") + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /* + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /* + * The dead peer detection timeout of this connection in seconds. + */ + @JsonProperty(value = "properties.dpdTimeoutSeconds") + private Integer dpdTimeoutSeconds; + + /* + * The connection mode for this connection. + */ + @JsonProperty(value = "properties.connectionMode") + private VirtualNetworkGatewayConnectionMode connectionMode; + + /* + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /* + * Virtual Network Gateway connection status. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /* + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /* + * Use private local Azure IP for the connection. + */ + @JsonProperty(value = "properties.useLocalAzureIpAddress") + private Boolean useLocalAzureIpAddress; + + /* + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /* + * The Traffic Selector Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.trafficSelectorPolicies") + private List trafficSelectorPolicies; + + /* + * The resource GUID property of the virtual network gateway connection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network gateway connection + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "properties.expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the authorizationKey property: The authorizationKey. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey property: The authorizationKey. + * + * @param authorizationKey the authorizationKey value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the virtualNetworkGateway1 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value. + */ + public VirtualNetworkGatewayInner virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the virtualNetworkGateway1 property: The reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway1( + VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the virtualNetworkGateway2 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value. + */ + public VirtualNetworkGatewayInner virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the virtualNetworkGateway2 property: The reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway2( + VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the localNetworkGateway2 property: The reference to local network gateway resource. + * + * @return the localNetworkGateway2 value. + */ + public LocalNetworkGatewayInner localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the localNetworkGateway2 property: The reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withLocalNetworkGateway2( + LocalNetworkGatewayInner localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get the ingressNatRules property: List of ingress NatRules. + * + * @return the ingressNatRules value. + */ + public List ingressNatRules() { + return this.ingressNatRules; + } + + /** + * Set the ingressNatRules property: List of ingress NatRules. + * + * @param ingressNatRules the ingressNatRules value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withIngressNatRules(List ingressNatRules) { + this.ingressNatRules = ingressNatRules; + return this; + } + + /** + * Get the egressNatRules property: List of egress NatRules. + * + * @return the egressNatRules value. + */ + public List egressNatRules() { + return this.egressNatRules; + } + + /** + * Set the egressNatRules property: List of egress NatRules. + * + * @param egressNatRules the egressNatRules value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEgressNatRules(List egressNatRules) { + this.egressNatRules = egressNatRules; + return this; + } + + /** + * Get the connectionType property: Gateway connection type. + * + * @return the connectionType value. + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set the connectionType property: Gateway connection type. + * + * @param connectionType the connectionType value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get the connectionProtocol property: Connection protocol used for this connection. + * + * @return the connectionProtocol value. + */ + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.connectionProtocol; + } + + /** + * Set the connectionProtocol property: Connection protocol used for this connection. + * + * @param connectionProtocol the connectionProtocol value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withConnectionProtocol( + VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.connectionProtocol = connectionProtocol; + return this; + } + + /** + * Get the routingWeight property: The routing weight. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routingWeight property: The routing weight. + * + * @param routingWeight the routingWeight value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the dpdTimeoutSeconds property: The dead peer detection timeout of this connection in seconds. + * + * @return the dpdTimeoutSeconds value. + */ + public Integer dpdTimeoutSeconds() { + return this.dpdTimeoutSeconds; + } + + /** + * Set the dpdTimeoutSeconds property: The dead peer detection timeout of this connection in seconds. + * + * @param dpdTimeoutSeconds the dpdTimeoutSeconds value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withDpdTimeoutSeconds(Integer dpdTimeoutSeconds) { + this.dpdTimeoutSeconds = dpdTimeoutSeconds; + return this; + } + + /** + * Get the connectionMode property: The connection mode for this connection. + * + * @return the connectionMode value. + */ + public VirtualNetworkGatewayConnectionMode connectionMode() { + return this.connectionMode; + } + + /** + * Set the connectionMode property: The connection mode for this connection. + * + * @param connectionMode the connectionMode value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withConnectionMode(VirtualNetworkGatewayConnectionMode connectionMode) { + this.connectionMode = connectionMode; + return this; + } + + /** + * Get the sharedKey property: The IPSec shared key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the sharedKey property: The IPSec shared key. + * + * @param sharedKey the sharedKey value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the connectionStatus property: Virtual Network Gateway connection status. + * + * @return the connectionStatus value. + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the tunnelConnectionStatus property: Collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value. + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egressBytesTransferred property: The egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingressBytesTransferred property: The ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the peer property: The reference to peerings resource. + * + * @return the peer value. + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the peer property: The reference to peerings resource. + * + * @param peer the peer value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set the enableBgp property: EnableBgp flag. + * + * @param enableBgp the enableBgp value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the useLocalAzureIpAddress property: Use private local Azure IP for the connection. + * + * @return the useLocalAzureIpAddress value. + */ + public Boolean useLocalAzureIpAddress() { + return this.useLocalAzureIpAddress; + } + + /** + * Set the useLocalAzureIpAddress property: Use private local Azure IP for the connection. + * + * @param useLocalAzureIpAddress the useLocalAzureIpAddress value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress) { + this.useLocalAzureIpAddress = useLocalAzureIpAddress; + return this; + } + + /** + * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withUsePolicyBasedTrafficSelectors( + Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @return the trafficSelectorPolicies value. + */ + public List trafficSelectorPolicies() { + return this.trafficSelectorPolicies; + } + + /** + * Set the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @param trafficSelectorPolicies the trafficSelectorPolicies value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withTrafficSelectorPolicies( + List trafficSelectorPolicies) { + this.trafficSelectorPolicies = trafficSelectorPolicies; + return this; + } + + /** + * Get the resourceGuid property: The resource GUID property of the virtual network gateway connection resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network gateway connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value. + */ + public Boolean expressRouteGatewayBypass() { + return this.expressRouteGatewayBypass; + } + + /** + * Set the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. + * + * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayConnectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayConnectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkGateway1() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkGateway1 in model" + + " VirtualNetworkGatewayConnectionInner")); + } else { + virtualNetworkGateway1().validate(); + } + if (virtualNetworkGateway2() != null) { + virtualNetworkGateway2().validate(); + } + if (localNetworkGateway2() != null) { + localNetworkGateway2().validate(); + } + if (connectionType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionType in model VirtualNetworkGatewayConnectionInner")); + } + if (tunnelConnectionStatus() != null) { + tunnelConnectionStatus().forEach(e -> e.validate()); + } + if (ipsecPolicies() != null) { + ipsecPolicies().forEach(e -> e.validate()); + } + if (trafficSelectorPolicies() != null) { + trafficSelectorPolicies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java new file mode 100644 index 0000000000000..031180712f0ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkConnectionGatewayReference; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A common class for general resource information. */ +@JsonFlatten +@Fluent +public class VirtualNetworkGatewayConnectionListEntityInner extends Resource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionListEntityInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /* + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway1; + + /* + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway2; + + /* + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private VirtualNetworkConnectionGatewayReference localNetworkGateway2; + + /* + * Gateway connection type. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /* + * Connection protocol used for this connection. + */ + @JsonProperty(value = "properties.connectionProtocol") + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /* + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /* + * The connection mode for this connection. + */ + @JsonProperty(value = "properties.connectionMode") + private VirtualNetworkGatewayConnectionMode connectionMode; + + /* + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /* + * Virtual Network Gateway connection status. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /* + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /* + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /* + * The Traffic Selector Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.trafficSelectorPolicies") + private List trafficSelectorPolicies; + + /* + * The resource GUID property of the virtual network gateway connection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network gateway connection + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "properties.expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the authorizationKey property: The authorizationKey. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey property: The authorizationKey. + * + * @param authorizationKey the authorizationKey value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the virtualNetworkGateway1 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value. + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the virtualNetworkGateway1 property: The reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway1( + VirtualNetworkConnectionGatewayReference virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the virtualNetworkGateway2 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value. + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the virtualNetworkGateway2 property: The reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway2( + VirtualNetworkConnectionGatewayReference virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the localNetworkGateway2 property: The reference to local network gateway resource. + * + * @return the localNetworkGateway2 value. + */ + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the localNetworkGateway2 property: The reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withLocalNetworkGateway2( + VirtualNetworkConnectionGatewayReference localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get the connectionType property: Gateway connection type. + * + * @return the connectionType value. + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set the connectionType property: Gateway connection type. + * + * @param connectionType the connectionType value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withConnectionType( + VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get the connectionProtocol property: Connection protocol used for this connection. + * + * @return the connectionProtocol value. + */ + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.connectionProtocol; + } + + /** + * Set the connectionProtocol property: Connection protocol used for this connection. + * + * @param connectionProtocol the connectionProtocol value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withConnectionProtocol( + VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.connectionProtocol = connectionProtocol; + return this; + } + + /** + * Get the routingWeight property: The routing weight. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routingWeight property: The routing weight. + * + * @param routingWeight the routingWeight value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the connectionMode property: The connection mode for this connection. + * + * @return the connectionMode value. + */ + public VirtualNetworkGatewayConnectionMode connectionMode() { + return this.connectionMode; + } + + /** + * Set the connectionMode property: The connection mode for this connection. + * + * @param connectionMode the connectionMode value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withConnectionMode( + VirtualNetworkGatewayConnectionMode connectionMode) { + this.connectionMode = connectionMode; + return this; + } + + /** + * Get the sharedKey property: The IPSec shared key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the sharedKey property: The IPSec shared key. + * + * @param sharedKey the sharedKey value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the connectionStatus property: Virtual Network Gateway connection status. + * + * @return the connectionStatus value. + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the tunnelConnectionStatus property: Collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value. + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egressBytesTransferred property: The egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingressBytesTransferred property: The ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the peer property: The reference to peerings resource. + * + * @return the peer value. + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the peer property: The reference to peerings resource. + * + * @param peer the peer value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set the enableBgp property: EnableBgp flag. + * + * @param enableBgp the enableBgp value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withUsePolicyBasedTrafficSelectors( + Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @return the trafficSelectorPolicies value. + */ + public List trafficSelectorPolicies() { + return this.trafficSelectorPolicies; + } + + /** + * Set the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @param trafficSelectorPolicies the trafficSelectorPolicies value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withTrafficSelectorPolicies( + List trafficSelectorPolicies) { + this.trafficSelectorPolicies = trafficSelectorPolicies; + return this; + } + + /** + * Get the resourceGuid property: The resource GUID property of the virtual network gateway connection resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network gateway connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value. + */ + public Boolean expressRouteGatewayBypass() { + return this.expressRouteGatewayBypass; + } + + /** + * Set the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. + * + * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withExpressRouteGatewayBypass( + Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayConnectionListEntityInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayConnectionListEntityInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkGateway1() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkGateway1 in model" + + " VirtualNetworkGatewayConnectionListEntityInner")); + } else { + virtualNetworkGateway1().validate(); + } + if (virtualNetworkGateway2() != null) { + virtualNetworkGateway2().validate(); + } + if (localNetworkGateway2() != null) { + localNetworkGateway2().validate(); + } + if (connectionType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionType in model" + + " VirtualNetworkGatewayConnectionListEntityInner")); + } + if (tunnelConnectionStatus() != null) { + tunnelConnectionStatus().forEach(e -> e.validate()); + } + if (ipsecPolicies() != null) { + ipsecPolicies().forEach(e -> e.validate()); + } + if (trafficSelectorPolicies() != null) { + trafficSelectorPolicies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayInner.java new file mode 100644 index 0000000000000..1df54b640c39d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayInner.java @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType; +import com.azure.resourcemanager.network.generated.models.VpnClientConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnGatewayGeneration; +import com.azure.resourcemanager.network.generated.models.VpnType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A common class for general resource information. */ +@JsonFlatten +@Fluent +public class VirtualNetworkGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayInner.class); + + /* + * The extended location of type local virtual network gateway. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * IP configurations for virtual network gateway. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * The type of this virtual network gateway. + */ + @JsonProperty(value = "properties.gatewayType") + private VirtualNetworkGatewayType gatewayType; + + /* + * The type of this virtual network gateway. + */ + @JsonProperty(value = "properties.vpnType") + private VpnType vpnType; + + /* + * The generation for this VirtualNetworkGateway. Must be None if + * gatewayType is not VPN. + */ + @JsonProperty(value = "properties.vpnGatewayGeneration") + private VpnGatewayGeneration vpnGatewayGeneration; + + /* + * Whether BGP is enabled for this virtual network gateway or not. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /* + * Whether private IP needs to be enabled on this gateway for connections + * or not. + */ + @JsonProperty(value = "properties.enablePrivateIpAddress") + private Boolean enablePrivateIpAddress; + + /* + * ActiveActive flag. + */ + @JsonProperty(value = "properties.activeActive") + private Boolean active; + + /* + * The reference to the LocalNetworkGateway resource which represents local + * network site having default routes. Assign Null value in case of + * removing existing default site setting. + */ + @JsonProperty(value = "properties.gatewayDefaultSite") + private SubResource gatewayDefaultSite; + + /* + * The reference to the VirtualNetworkGatewaySku resource which represents + * the SKU selected for Virtual network gateway. + */ + @JsonProperty(value = "properties.sku") + private VirtualNetworkGatewaySku sku; + + /* + * The reference to the VpnClientConfiguration resource which represents + * the P2S VpnClient configurations. + */ + @JsonProperty(value = "properties.vpnClientConfiguration") + private VpnClientConfiguration vpnClientConfiguration; + + /* + * Virtual network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /* + * The reference to the address space resource which represents the custom + * routes address space specified by the customer for virtual network + * gateway and VpnClient. + */ + @JsonProperty(value = "properties.customRoutes") + private AddressSpace customRoutes; + + /* + * The resource GUID property of the virtual network gateway resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network gateway resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Whether dns forwarding is enabled or not. + */ + @JsonProperty(value = "properties.enableDnsForwarding") + private Boolean enableDnsForwarding; + + /* + * The IP address allocated by the gateway to which dns requests can be + * sent. + */ + @JsonProperty(value = "properties.inboundDnsForwardingEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String inboundDnsForwardingEndpoint; + + /* + * Customer vnet resource id. VirtualNetworkGateway of type local gateway + * is associated with the customer vnet. + */ + @JsonProperty(value = "properties.vNetExtendedLocationResourceId") + private String vNetExtendedLocationResourceId; + + /* + * NatRules for virtual network gateway. + */ + @JsonProperty(value = "properties.natRules") + private List natRules; + + /* + * EnableBgpRouteTranslationForNat flag. + */ + @JsonProperty(value = "properties.enableBgpRouteTranslationForNat") + private Boolean enableBgpRouteTranslationForNat; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the extendedLocation property: The extended location of type local virtual network gateway. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of type local virtual network gateway. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the ipConfigurations property: IP configurations for virtual network gateway. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: IP configurations for virtual network gateway. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withIpConfigurations( + List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the gatewayType property: The type of this virtual network gateway. + * + * @return the gatewayType value. + */ + public VirtualNetworkGatewayType gatewayType() { + return this.gatewayType; + } + + /** + * Set the gatewayType property: The type of this virtual network gateway. + * + * @param gatewayType the gatewayType value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.gatewayType = gatewayType; + return this; + } + + /** + * Get the vpnType property: The type of this virtual network gateway. + * + * @return the vpnType value. + */ + public VpnType vpnType() { + return this.vpnType; + } + + /** + * Set the vpnType property: The type of this virtual network gateway. + * + * @param vpnType the vpnType value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnType(VpnType vpnType) { + this.vpnType = vpnType; + return this; + } + + /** + * Get the vpnGatewayGeneration property: The generation for this VirtualNetworkGateway. Must be None if gatewayType + * is not VPN. + * + * @return the vpnGatewayGeneration value. + */ + public VpnGatewayGeneration vpnGatewayGeneration() { + return this.vpnGatewayGeneration; + } + + /** + * Set the vpnGatewayGeneration property: The generation for this VirtualNetworkGateway. Must be None if gatewayType + * is not VPN. + * + * @param vpnGatewayGeneration the vpnGatewayGeneration value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnGatewayGeneration(VpnGatewayGeneration vpnGatewayGeneration) { + this.vpnGatewayGeneration = vpnGatewayGeneration; + return this; + } + + /** + * Get the enableBgp property: Whether BGP is enabled for this virtual network gateway or not. + * + * @return the enableBgp value. + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set the enableBgp property: Whether BGP is enabled for this virtual network gateway or not. + * + * @param enableBgp the enableBgp value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the enablePrivateIpAddress property: Whether private IP needs to be enabled on this gateway for connections + * or not. + * + * @return the enablePrivateIpAddress value. + */ + public Boolean enablePrivateIpAddress() { + return this.enablePrivateIpAddress; + } + + /** + * Set the enablePrivateIpAddress property: Whether private IP needs to be enabled on this gateway for connections + * or not. + * + * @param enablePrivateIpAddress the enablePrivateIpAddress value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEnablePrivateIpAddress(Boolean enablePrivateIpAddress) { + this.enablePrivateIpAddress = enablePrivateIpAddress; + return this; + } + + /** + * Get the active property: ActiveActive flag. + * + * @return the active value. + */ + public Boolean active() { + return this.active; + } + + /** + * Set the active property: ActiveActive flag. + * + * @param active the active value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withActive(Boolean active) { + this.active = active; + return this; + } + + /** + * Get the gatewayDefaultSite property: The reference to the LocalNetworkGateway resource which represents local + * network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @return the gatewayDefaultSite value. + */ + public SubResource gatewayDefaultSite() { + return this.gatewayDefaultSite; + } + + /** + * Set the gatewayDefaultSite property: The reference to the LocalNetworkGateway resource which represents local + * network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @param gatewayDefaultSite the gatewayDefaultSite value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.gatewayDefaultSite = gatewayDefaultSite; + return this; + } + + /** + * Get the sku property: The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected + * for Virtual network gateway. + * + * @return the sku value. + */ + public VirtualNetworkGatewaySku sku() { + return this.sku; + } + + /** + * Set the sku property: The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected + * for Virtual network gateway. + * + * @param sku the sku value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withSku(VirtualNetworkGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get the vpnClientConfiguration property: The reference to the VpnClientConfiguration resource which represents + * the P2S VpnClient configurations. + * + * @return the vpnClientConfiguration value. + */ + public VpnClientConfiguration vpnClientConfiguration() { + return this.vpnClientConfiguration; + } + + /** + * Set the vpnClientConfiguration property: The reference to the VpnClientConfiguration resource which represents + * the P2S VpnClient configurations. + * + * @param vpnClientConfiguration the vpnClientConfiguration value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.vpnClientConfiguration = vpnClientConfiguration; + return this; + } + + /** + * Get the bgpSettings property: Virtual network gateway's BGP speaker settings. + * + * @return the bgpSettings value. + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set the bgpSettings property: Virtual network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the customRoutes property: The reference to the address space resource which represents the custom routes + * address space specified by the customer for virtual network gateway and VpnClient. + * + * @return the customRoutes value. + */ + public AddressSpace customRoutes() { + return this.customRoutes; + } + + /** + * Set the customRoutes property: The reference to the address space resource which represents the custom routes + * address space specified by the customer for virtual network gateway and VpnClient. + * + * @param customRoutes the customRoutes value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withCustomRoutes(AddressSpace customRoutes) { + this.customRoutes = customRoutes; + return this; + } + + /** + * Get the resourceGuid property: The resource GUID property of the virtual network gateway resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the enableDnsForwarding property: Whether dns forwarding is enabled or not. + * + * @return the enableDnsForwarding value. + */ + public Boolean enableDnsForwarding() { + return this.enableDnsForwarding; + } + + /** + * Set the enableDnsForwarding property: Whether dns forwarding is enabled or not. + * + * @param enableDnsForwarding the enableDnsForwarding value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEnableDnsForwarding(Boolean enableDnsForwarding) { + this.enableDnsForwarding = enableDnsForwarding; + return this; + } + + /** + * Get the inboundDnsForwardingEndpoint property: The IP address allocated by the gateway to which dns requests can + * be sent. + * + * @return the inboundDnsForwardingEndpoint value. + */ + public String inboundDnsForwardingEndpoint() { + return this.inboundDnsForwardingEndpoint; + } + + /** + * Get the vNetExtendedLocationResourceId property: Customer vnet resource id. VirtualNetworkGateway of type local + * gateway is associated with the customer vnet. + * + * @return the vNetExtendedLocationResourceId value. + */ + public String vNetExtendedLocationResourceId() { + return this.vNetExtendedLocationResourceId; + } + + /** + * Set the vNetExtendedLocationResourceId property: Customer vnet resource id. VirtualNetworkGateway of type local + * gateway is associated with the customer vnet. + * + * @param vNetExtendedLocationResourceId the vNetExtendedLocationResourceId value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVNetExtendedLocationResourceId(String vNetExtendedLocationResourceId) { + this.vNetExtendedLocationResourceId = vNetExtendedLocationResourceId; + return this; + } + + /** + * Get the natRules property: NatRules for virtual network gateway. + * + * @return the natRules value. + */ + public List natRules() { + return this.natRules; + } + + /** + * Set the natRules property: NatRules for virtual network gateway. + * + * @param natRules the natRules value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withNatRules(List natRules) { + this.natRules = natRules; + return this; + } + + /** + * Get the enableBgpRouteTranslationForNat property: EnableBgpRouteTranslationForNat flag. + * + * @return the enableBgpRouteTranslationForNat value. + */ + public Boolean enableBgpRouteTranslationForNat() { + return this.enableBgpRouteTranslationForNat; + } + + /** + * Set the enableBgpRouteTranslationForNat property: EnableBgpRouteTranslationForNat flag. + * + * @param enableBgpRouteTranslationForNat the enableBgpRouteTranslationForNat value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat) { + this.enableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (sku() != null) { + sku().validate(); + } + if (vpnClientConfiguration() != null) { + vpnClientConfiguration().validate(); + } + if (bgpSettings() != null) { + bgpSettings().validate(); + } + if (customRoutes() != null) { + customRoutes().validate(); + } + if (natRules() != null) { + natRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleInner.java new file mode 100644 index 0000000000000..0ac8dfc5cecad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleInner.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualNetworkGatewayNatRule Resource. */ +@JsonFlatten +@Fluent +public class VirtualNetworkGatewayNatRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayNatRuleInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The provisioning state of the NAT Rule resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The type of NAT rule for VPN NAT. + */ + @JsonProperty(value = "properties.type") + private VpnNatRuleType typePropertiesType; + + /* + * The Source NAT direction of a VPN NAT. + */ + @JsonProperty(value = "properties.mode") + private VpnNatRuleMode mode; + + /* + * The private IP address internal mapping for NAT. + */ + @JsonProperty(value = "properties.internalMappings") + private List internalMappings; + + /* + * The private IP address external mapping for NAT. + */ + @JsonProperty(value = "properties.externalMappings") + private List externalMappings; + + /* + * The IP Configuration ID this NAT rule applies to. + */ + @JsonProperty(value = "properties.ipConfigurationId") + private String ipConfigurationId; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VirtualNetworkGatewayNatRuleInner object itself. + */ + public VirtualNetworkGatewayNatRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the typePropertiesType property: The type of NAT rule for VPN NAT. + * + * @return the typePropertiesType value. + */ + public VpnNatRuleType typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: The type of NAT rule for VPN NAT. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the VirtualNetworkGatewayNatRuleInner object itself. + */ + public VirtualNetworkGatewayNatRuleInner withTypePropertiesType(VpnNatRuleType typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the mode property: The Source NAT direction of a VPN NAT. + * + * @return the mode value. + */ + public VpnNatRuleMode mode() { + return this.mode; + } + + /** + * Set the mode property: The Source NAT direction of a VPN NAT. + * + * @param mode the mode value to set. + * @return the VirtualNetworkGatewayNatRuleInner object itself. + */ + public VirtualNetworkGatewayNatRuleInner withMode(VpnNatRuleMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the internalMappings property: The private IP address internal mapping for NAT. + * + * @return the internalMappings value. + */ + public List internalMappings() { + return this.internalMappings; + } + + /** + * Set the internalMappings property: The private IP address internal mapping for NAT. + * + * @param internalMappings the internalMappings value to set. + * @return the VirtualNetworkGatewayNatRuleInner object itself. + */ + public VirtualNetworkGatewayNatRuleInner withInternalMappings(List internalMappings) { + this.internalMappings = internalMappings; + return this; + } + + /** + * Get the externalMappings property: The private IP address external mapping for NAT. + * + * @return the externalMappings value. + */ + public List externalMappings() { + return this.externalMappings; + } + + /** + * Set the externalMappings property: The private IP address external mapping for NAT. + * + * @param externalMappings the externalMappings value to set. + * @return the VirtualNetworkGatewayNatRuleInner object itself. + */ + public VirtualNetworkGatewayNatRuleInner withExternalMappings(List externalMappings) { + this.externalMappings = externalMappings; + return this; + } + + /** + * Get the ipConfigurationId property: The IP Configuration ID this NAT rule applies to. + * + * @return the ipConfigurationId value. + */ + public String ipConfigurationId() { + return this.ipConfigurationId; + } + + /** + * Set the ipConfigurationId property: The IP Configuration ID this NAT rule applies to. + * + * @param ipConfigurationId the ipConfigurationId value to set. + * @return the VirtualNetworkGatewayNatRuleInner object itself. + */ + public VirtualNetworkGatewayNatRuleInner withIpConfigurationId(String ipConfigurationId) { + this.ipConfigurationId = ipConfigurationId; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayNatRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (internalMappings() != null) { + internalMappings().forEach(e -> e.validate()); + } + if (externalMappings() != null) { + externalMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkInner.java new file mode 100644 index 0000000000000..13950b49c0fb5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkInner.java @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.DhcpOptions; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Virtual Network resource. */ +@JsonFlatten +@Fluent +public class VirtualNetworkInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkInner.class); + + /* + * The extended location of the virtual network. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The AddressSpace that contains an array of IP address ranges that can be + * used by subnets. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /* + * The dhcpOptions that contains an array of DNS servers available to VMs + * deployed in the virtual network. + */ + @JsonProperty(value = "properties.dhcpOptions") + private DhcpOptions dhcpOptions; + + /* + * The FlowTimeout value (in minutes) for the Virtual Network + */ + @JsonProperty(value = "properties.flowTimeoutInMinutes") + private Integer flowTimeoutInMinutes; + + /* + * A list of subnets in a Virtual Network. + */ + @JsonProperty(value = "properties.subnets") + private List subnets; + + /* + * A list of peerings in a Virtual Network. + */ + @JsonProperty(value = "properties.virtualNetworkPeerings") + private List virtualNetworkPeerings; + + /* + * The resourceGuid property of the Virtual Network resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Indicates if DDoS protection is enabled for all the protected resources + * in the virtual network. It requires a DDoS protection plan associated + * with the resource. + */ + @JsonProperty(value = "properties.enableDdosProtection") + private Boolean enableDdosProtection; + + /* + * Indicates if VM protection is enabled for all the subnets in the virtual + * network. + */ + @JsonProperty(value = "properties.enableVmProtection") + private Boolean enableVmProtection; + + /* + * The DDoS protection plan associated with the virtual network. + */ + @JsonProperty(value = "properties.ddosProtectionPlan") + private SubResource ddosProtectionPlan; + + /* + * Bgp Communities sent over ExpressRoute with each route corresponding to + * a prefix in this VNET. + */ + @JsonProperty(value = "properties.bgpCommunities") + private VirtualNetworkBgpCommunities bgpCommunities; + + /* + * Array of IpAllocation which reference this VNET. + */ + @JsonProperty(value = "properties.ipAllocations") + private List ipAllocations; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the extendedLocation property: The extended location of the virtual network. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the virtual network. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the addressSpace property: The AddressSpace that contains an array of IP address ranges that can be used by + * subnets. + * + * @return the addressSpace value. + */ + public AddressSpace addressSpace() { + return this.addressSpace; + } + + /** + * Set the addressSpace property: The AddressSpace that contains an array of IP address ranges that can be used by + * subnets. + * + * @param addressSpace the addressSpace value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the dhcpOptions property: The dhcpOptions that contains an array of DNS servers available to VMs deployed in + * the virtual network. + * + * @return the dhcpOptions value. + */ + public DhcpOptions dhcpOptions() { + return this.dhcpOptions; + } + + /** + * Set the dhcpOptions property: The dhcpOptions that contains an array of DNS servers available to VMs deployed in + * the virtual network. + * + * @param dhcpOptions the dhcpOptions value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDhcpOptions(DhcpOptions dhcpOptions) { + this.dhcpOptions = dhcpOptions; + return this; + } + + /** + * Get the flowTimeoutInMinutes property: The FlowTimeout value (in minutes) for the Virtual Network. + * + * @return the flowTimeoutInMinutes value. + */ + public Integer flowTimeoutInMinutes() { + return this.flowTimeoutInMinutes; + } + + /** + * Set the flowTimeoutInMinutes property: The FlowTimeout value (in minutes) for the Virtual Network. + * + * @param flowTimeoutInMinutes the flowTimeoutInMinutes value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withFlowTimeoutInMinutes(Integer flowTimeoutInMinutes) { + this.flowTimeoutInMinutes = flowTimeoutInMinutes; + return this; + } + + /** + * Get the subnets property: A list of subnets in a Virtual Network. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: A list of subnets in a Virtual Network. + * + * @param subnets the subnets value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get the virtualNetworkPeerings property: A list of peerings in a Virtual Network. + * + * @return the virtualNetworkPeerings value. + */ + public List virtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** + * Set the virtualNetworkPeerings property: A list of peerings in a Virtual Network. + * + * @param virtualNetworkPeerings the virtualNetworkPeerings value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.virtualNetworkPeerings = virtualNetworkPeerings; + return this; + } + + /** + * Get the resourceGuid property: The resourceGuid property of the Virtual Network resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the enableDdosProtection property: Indicates if DDoS protection is enabled for all the protected resources in + * the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @return the enableDdosProtection value. + */ + public Boolean enableDdosProtection() { + return this.enableDdosProtection; + } + + /** + * Set the enableDdosProtection property: Indicates if DDoS protection is enabled for all the protected resources in + * the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @param enableDdosProtection the enableDdosProtection value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableDdosProtection(Boolean enableDdosProtection) { + this.enableDdosProtection = enableDdosProtection; + return this; + } + + /** + * Get the enableVmProtection property: Indicates if VM protection is enabled for all the subnets in the virtual + * network. + * + * @return the enableVmProtection value. + */ + public Boolean enableVmProtection() { + return this.enableVmProtection; + } + + /** + * Set the enableVmProtection property: Indicates if VM protection is enabled for all the subnets in the virtual + * network. + * + * @param enableVmProtection the enableVmProtection value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableVmProtection(Boolean enableVmProtection) { + this.enableVmProtection = enableVmProtection; + return this; + } + + /** + * Get the ddosProtectionPlan property: The DDoS protection plan associated with the virtual network. + * + * @return the ddosProtectionPlan value. + */ + public SubResource ddosProtectionPlan() { + return this.ddosProtectionPlan; + } + + /** + * Set the ddosProtectionPlan property: The DDoS protection plan associated with the virtual network. + * + * @param ddosProtectionPlan the ddosProtectionPlan value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.ddosProtectionPlan = ddosProtectionPlan; + return this; + } + + /** + * Get the bgpCommunities property: Bgp Communities sent over ExpressRoute with each route corresponding to a prefix + * in this VNET. + * + * @return the bgpCommunities value. + */ + public VirtualNetworkBgpCommunities bgpCommunities() { + return this.bgpCommunities; + } + + /** + * Set the bgpCommunities property: Bgp Communities sent over ExpressRoute with each route corresponding to a prefix + * in this VNET. + * + * @param bgpCommunities the bgpCommunities value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withBgpCommunities(VirtualNetworkBgpCommunities bgpCommunities) { + this.bgpCommunities = bgpCommunities; + return this; + } + + /** + * Get the ipAllocations property: Array of IpAllocation which reference this VNET. + * + * @return the ipAllocations value. + */ + public List ipAllocations() { + return this.ipAllocations; + } + + /** + * Set the ipAllocations property: Array of IpAllocation which reference this VNET. + * + * @param ipAllocations the ipAllocations value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withIpAllocations(List ipAllocations) { + this.ipAllocations = ipAllocations; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (addressSpace() != null) { + addressSpace().validate(); + } + if (dhcpOptions() != null) { + dhcpOptions().validate(); + } + if (subnets() != null) { + subnets().forEach(e -> e.validate()); + } + if (virtualNetworkPeerings() != null) { + virtualNetworkPeerings().forEach(e -> e.validate()); + } + if (bgpCommunities() != null) { + bgpCommunities().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringInner.java new file mode 100644 index 0000000000000..4e079e9b003a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringInner.java @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringLevel; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peerings in a virtual network resource. */ +@JsonFlatten +@Fluent +public class VirtualNetworkPeeringInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + */ + @JsonProperty(value = "properties.allowVirtualNetworkAccess") + private Boolean allowVirtualNetworkAccess; + + /* + * Whether the forwarded traffic from the VMs in the local virtual network + * will be allowed/disallowed in remote virtual network. + */ + @JsonProperty(value = "properties.allowForwardedTraffic") + private Boolean allowForwardedTraffic; + + /* + * If gateway links can be used in remote virtual networking to link to + * this virtual network. + */ + @JsonProperty(value = "properties.allowGatewayTransit") + private Boolean allowGatewayTransit; + + /* + * If remote gateways can be used on this virtual network. If the flag is + * set to true, and allowGatewayTransit on remote peering is also true, + * virtual network will use gateways of remote virtual network for transit. + * Only one peering can have this flag set to true. This flag cannot be set + * if virtual network already has a gateway. + */ + @JsonProperty(value = "properties.useRemoteGateways") + private Boolean useRemoteGateways; + + /* + * The reference to the remote virtual network. The remote virtual network + * can be in the same or different region (preview). See here to register + * for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /* + * The reference to the address space peered with the remote virtual + * network. + */ + @JsonProperty(value = "properties.remoteAddressSpace") + private AddressSpace remoteAddressSpace; + + /* + * The reference to the current address space of the remote virtual + * network. + */ + @JsonProperty(value = "properties.remoteVirtualNetworkAddressSpace") + private AddressSpace remoteVirtualNetworkAddressSpace; + + /* + * The reference to the remote virtual network's Bgp Communities. + */ + @JsonProperty(value = "properties.remoteBgpCommunities") + private VirtualNetworkBgpCommunities remoteBgpCommunities; + + /* + * The status of the virtual network peering. + */ + @JsonProperty(value = "properties.peeringState") + private VirtualNetworkPeeringState peeringState; + + /* + * The peering sync status of the virtual network peering. + */ + @JsonProperty(value = "properties.peeringSyncLevel") + private VirtualNetworkPeeringLevel peeringSyncLevel; + + /* + * The provisioning state of the virtual network peering resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * If we need to verify the provisioning state of the remote gateway. + */ + @JsonProperty(value = "properties.doNotVerifyRemoteGateways") + private Boolean doNotVerifyRemoteGateways; + + /* + * The resourceGuid property of the Virtual Network peering resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. + * + * @param type the type value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * + * @return the allowVirtualNetworkAccess value. + */ + public Boolean allowVirtualNetworkAccess() { + return this.allowVirtualNetworkAccess; + } + + /** + * Set the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * + * @param allowVirtualNetworkAccess the allowVirtualNetworkAccess value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.allowVirtualNetworkAccess = allowVirtualNetworkAccess; + return this; + } + + /** + * Get the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local virtual network + * will be allowed/disallowed in remote virtual network. + * + * @return the allowForwardedTraffic value. + */ + public Boolean allowForwardedTraffic() { + return this.allowForwardedTraffic; + } + + /** + * Set the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local virtual network + * will be allowed/disallowed in remote virtual network. + * + * @param allowForwardedTraffic the allowForwardedTraffic value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.allowForwardedTraffic = allowForwardedTraffic; + return this; + } + + /** + * Get the allowGatewayTransit property: If gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @return the allowGatewayTransit value. + */ + public Boolean allowGatewayTransit() { + return this.allowGatewayTransit; + } + + /** + * Set the allowGatewayTransit property: If gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @param allowGatewayTransit the allowGatewayTransit value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.allowGatewayTransit = allowGatewayTransit; + return this; + } + + /** + * Get the useRemoteGateways property: If remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual + * network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network + * already has a gateway. + * + * @return the useRemoteGateways value. + */ + public Boolean useRemoteGateways() { + return this.useRemoteGateways; + } + + /** + * Set the useRemoteGateways property: If remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual + * network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network + * already has a gateway. + * + * @param useRemoteGateways the useRemoteGateways value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withUseRemoteGateways(Boolean useRemoteGateways) { + this.useRemoteGateways = useRemoteGateways; + return this; + } + + /** + * Get the remoteVirtualNetwork property: The reference to the remote virtual network. The remote virtual network + * can be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @return the remoteVirtualNetwork value. + */ + public SubResource remoteVirtualNetwork() { + return this.remoteVirtualNetwork; + } + + /** + * Set the remoteVirtualNetwork property: The reference to the remote virtual network. The remote virtual network + * can be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get the remoteAddressSpace property: The reference to the address space peered with the remote virtual network. + * + * @return the remoteAddressSpace value. + */ + public AddressSpace remoteAddressSpace() { + return this.remoteAddressSpace; + } + + /** + * Set the remoteAddressSpace property: The reference to the address space peered with the remote virtual network. + * + * @param remoteAddressSpace the remoteAddressSpace value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.remoteAddressSpace = remoteAddressSpace; + return this; + } + + /** + * Get the remoteVirtualNetworkAddressSpace property: The reference to the current address space of the remote + * virtual network. + * + * @return the remoteVirtualNetworkAddressSpace value. + */ + public AddressSpace remoteVirtualNetworkAddressSpace() { + return this.remoteVirtualNetworkAddressSpace; + } + + /** + * Set the remoteVirtualNetworkAddressSpace property: The reference to the current address space of the remote + * virtual network. + * + * @param remoteVirtualNetworkAddressSpace the remoteVirtualNetworkAddressSpace value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteVirtualNetworkAddressSpace( + AddressSpace remoteVirtualNetworkAddressSpace) { + this.remoteVirtualNetworkAddressSpace = remoteVirtualNetworkAddressSpace; + return this; + } + + /** + * Get the remoteBgpCommunities property: The reference to the remote virtual network's Bgp Communities. + * + * @return the remoteBgpCommunities value. + */ + public VirtualNetworkBgpCommunities remoteBgpCommunities() { + return this.remoteBgpCommunities; + } + + /** + * Set the remoteBgpCommunities property: The reference to the remote virtual network's Bgp Communities. + * + * @param remoteBgpCommunities the remoteBgpCommunities value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities) { + this.remoteBgpCommunities = remoteBgpCommunities; + return this; + } + + /** + * Get the peeringState property: The status of the virtual network peering. + * + * @return the peeringState value. + */ + public VirtualNetworkPeeringState peeringState() { + return this.peeringState; + } + + /** + * Set the peeringState property: The status of the virtual network peering. + * + * @param peeringState the peeringState value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withPeeringState(VirtualNetworkPeeringState peeringState) { + this.peeringState = peeringState; + return this; + } + + /** + * Get the peeringSyncLevel property: The peering sync status of the virtual network peering. + * + * @return the peeringSyncLevel value. + */ + public VirtualNetworkPeeringLevel peeringSyncLevel() { + return this.peeringSyncLevel; + } + + /** + * Set the peeringSyncLevel property: The peering sync status of the virtual network peering. + * + * @param peeringSyncLevel the peeringSyncLevel value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withPeeringSyncLevel(VirtualNetworkPeeringLevel peeringSyncLevel) { + this.peeringSyncLevel = peeringSyncLevel; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network peering resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the doNotVerifyRemoteGateways property: If we need to verify the provisioning state of the remote gateway. + * + * @return the doNotVerifyRemoteGateways value. + */ + public Boolean doNotVerifyRemoteGateways() { + return this.doNotVerifyRemoteGateways; + } + + /** + * Set the doNotVerifyRemoteGateways property: If we need to verify the provisioning state of the remote gateway. + * + * @param doNotVerifyRemoteGateways the doNotVerifyRemoteGateways value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withDoNotVerifyRemoteGateways(Boolean doNotVerifyRemoteGateways) { + this.doNotVerifyRemoteGateways = doNotVerifyRemoteGateways; + return this; + } + + /** + * Get the resourceGuid property: The resourceGuid property of the Virtual Network peering resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkPeeringInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (remoteAddressSpace() != null) { + remoteAddressSpace().validate(); + } + if (remoteVirtualNetworkAddressSpace() != null) { + remoteVirtualNetworkAddressSpace().validate(); + } + if (remoteBgpCommunities() != null) { + remoteBgpCommunities().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapInner.java new file mode 100644 index 0000000000000..c2869382edc55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapInner.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.network.generated.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.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Virtual Network Tap resource. */ +@JsonFlatten +@Fluent +public class VirtualNetworkTapInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Specifies the list of resource IDs for the network interface IP + * configuration that needs to be tapped. + */ + @JsonProperty(value = "properties.networkInterfaceTapConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaceTapConfigurations; + + /* + * The resource GUID property of the virtual network tap resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network tap resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The reference to the private IP Address of the collector nic that will + * receive the tap. + */ + @JsonProperty(value = "properties.destinationNetworkInterfaceIPConfiguration") + private NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration; + + /* + * The reference to the private IP address on the internal Load Balancer + * that will receive the tap. + */ + @JsonProperty(value = "properties.destinationLoadBalancerFrontEndIPConfiguration") + private FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration; + + /* + * The VXLAN destination port that will receive the tapped traffic. + */ + @JsonProperty(value = "properties.destinationPort") + private Integer destinationPort; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the networkInterfaceTapConfigurations property: Specifies the list of resource IDs for the network interface + * IP configuration that needs to be tapped. + * + * @return the networkInterfaceTapConfigurations value. + */ + public List networkInterfaceTapConfigurations() { + return this.networkInterfaceTapConfigurations; + } + + /** + * Get the resourceGuid property: The resource GUID property of the virtual network tap resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network tap resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the destinationNetworkInterfaceIpConfiguration property: The reference to the private IP Address of the + * collector nic that will receive the tap. + * + * @return the destinationNetworkInterfaceIpConfiguration value. + */ + public NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration() { + return this.destinationNetworkInterfaceIpConfiguration; + } + + /** + * Set the destinationNetworkInterfaceIpConfiguration property: The reference to the private IP Address of the + * collector nic that will receive the tap. + * + * @param destinationNetworkInterfaceIpConfiguration the destinationNetworkInterfaceIpConfiguration value to set. + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withDestinationNetworkInterfaceIpConfiguration( + NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration) { + this.destinationNetworkInterfaceIpConfiguration = destinationNetworkInterfaceIpConfiguration; + return this; + } + + /** + * Get the destinationLoadBalancerFrontEndIpConfiguration property: The reference to the private IP address on the + * internal Load Balancer that will receive the tap. + * + * @return the destinationLoadBalancerFrontEndIpConfiguration value. + */ + public FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration() { + return this.destinationLoadBalancerFrontEndIpConfiguration; + } + + /** + * Set the destinationLoadBalancerFrontEndIpConfiguration property: The reference to the private IP address on the + * internal Load Balancer that will receive the tap. + * + * @param destinationLoadBalancerFrontEndIpConfiguration the destinationLoadBalancerFrontEndIpConfiguration value to + * set. + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withDestinationLoadBalancerFrontEndIpConfiguration( + FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration) { + this.destinationLoadBalancerFrontEndIpConfiguration = destinationLoadBalancerFrontEndIpConfiguration; + return this; + } + + /** + * Get the destinationPort property: The VXLAN destination port that will receive the tapped traffic. + * + * @return the destinationPort value. + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destinationPort property: The VXLAN destination port that will receive the tapped traffic. + * + * @param destinationPort the destinationPort value to set. + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkTapInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkTapInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaceTapConfigurations() != null) { + networkInterfaceTapConfigurations().forEach(e -> e.validate()); + } + if (destinationNetworkInterfaceIpConfiguration() != null) { + destinationNetworkInterfaceIpConfiguration().validate(); + } + if (destinationLoadBalancerFrontEndIpConfiguration() != null) { + destinationLoadBalancerFrontEndIpConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkUsageInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkUsageInner.java new file mode 100644 index 0000000000000..45bfb812237a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkUsageInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsageName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Usage details for subnet. */ +@Immutable +public final class VirtualNetworkUsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkUsageInner.class); + + /* + * Indicates number of IPs used from the Subnet. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /* + * Subnet identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Indicates the size of the subnet. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /* + * The name containing common and localized value for usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkUsageName name; + + /* + * Usage units. Returns 'Count'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * Get the currentValue property: Indicates number of IPs used from the Subnet. + * + * @return the currentValue value. + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get the id property: Subnet identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the limit property: Indicates the size of the subnet. + * + * @return the limit value. + */ + public Double limit() { + return this.limit; + } + + /** + * Get the name property: The name containing common and localized value for usage. + * + * @return the name value. + */ + public VirtualNetworkUsageName name() { + return this.name; + } + + /** + * Get the unit property: Usage units. Returns 'Count'. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterInner.java new file mode 100644 index 0000000000000..c092ee54ef5f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterInner.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualRouter Resource. */ +@JsonFlatten +@Fluent +public class VirtualRouterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * VirtualRouter ASN. + */ + @JsonProperty(value = "properties.virtualRouterAsn") + private Long virtualRouterAsn; + + /* + * VirtualRouter IPs. + */ + @JsonProperty(value = "properties.virtualRouterIps") + private List virtualRouterIps; + + /* + * The Subnet on which VirtualRouter is hosted. + */ + @JsonProperty(value = "properties.hostedSubnet") + private SubResource hostedSubnet; + + /* + * The Gateway on which VirtualRouter is hosted. + */ + @JsonProperty(value = "properties.hostedGateway") + private SubResource hostedGateway; + + /* + * List of references to VirtualRouterPeerings. + */ + @JsonProperty(value = "properties.peerings", access = JsonProperty.Access.WRITE_ONLY) + private List peerings; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the virtualRouterAsn property: VirtualRouter ASN. + * + * @return the virtualRouterAsn value. + */ + public Long virtualRouterAsn() { + return this.virtualRouterAsn; + } + + /** + * Set the virtualRouterAsn property: VirtualRouter ASN. + * + * @param virtualRouterAsn the virtualRouterAsn value to set. + * @return the VirtualRouterInner object itself. + */ + public VirtualRouterInner withVirtualRouterAsn(Long virtualRouterAsn) { + this.virtualRouterAsn = virtualRouterAsn; + return this; + } + + /** + * Get the virtualRouterIps property: VirtualRouter IPs. + * + * @return the virtualRouterIps value. + */ + public List virtualRouterIps() { + return this.virtualRouterIps; + } + + /** + * Set the virtualRouterIps property: VirtualRouter IPs. + * + * @param virtualRouterIps the virtualRouterIps value to set. + * @return the VirtualRouterInner object itself. + */ + public VirtualRouterInner withVirtualRouterIps(List virtualRouterIps) { + this.virtualRouterIps = virtualRouterIps; + return this; + } + + /** + * Get the hostedSubnet property: The Subnet on which VirtualRouter is hosted. + * + * @return the hostedSubnet value. + */ + public SubResource hostedSubnet() { + return this.hostedSubnet; + } + + /** + * Set the hostedSubnet property: The Subnet on which VirtualRouter is hosted. + * + * @param hostedSubnet the hostedSubnet value to set. + * @return the VirtualRouterInner object itself. + */ + public VirtualRouterInner withHostedSubnet(SubResource hostedSubnet) { + this.hostedSubnet = hostedSubnet; + return this; + } + + /** + * Get the hostedGateway property: The Gateway on which VirtualRouter is hosted. + * + * @return the hostedGateway value. + */ + public SubResource hostedGateway() { + return this.hostedGateway; + } + + /** + * Set the hostedGateway property: The Gateway on which VirtualRouter is hosted. + * + * @param hostedGateway the hostedGateway value to set. + * @return the VirtualRouterInner object itself. + */ + public VirtualRouterInner withHostedGateway(SubResource hostedGateway) { + this.hostedGateway = hostedGateway; + return this; + } + + /** + * Get the peerings property: List of references to VirtualRouterPeerings. + * + * @return the peerings value. + */ + public List peerings() { + return this.peerings; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VirtualRouterInner object itself. + */ + public VirtualRouterInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualRouterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualRouterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringInner.java new file mode 100644 index 0000000000000..0eb1377f69fe2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Router Peering resource. */ +@JsonFlatten +@Fluent +public class VirtualRouterPeeringInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterPeeringInner.class); + + /* + * Name of the virtual router peering that is unique within a virtual + * router. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Peering type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Peer ASN. + */ + @JsonProperty(value = "properties.peerAsn") + private Long peerAsn; + + /* + * Peer IP. + */ + @JsonProperty(value = "properties.peerIp") + private String peerIp; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the virtual router peering that is unique within a virtual router. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the virtual router peering that is unique within a virtual router. + * + * @param name the name value to set. + * @return the VirtualRouterPeeringInner object itself. + */ + public VirtualRouterPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Peering type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the peerAsn property: Peer ASN. + * + * @return the peerAsn value. + */ + public Long peerAsn() { + return this.peerAsn; + } + + /** + * Set the peerAsn property: Peer ASN. + * + * @param peerAsn the peerAsn value to set. + * @return the VirtualRouterPeeringInner object itself. + */ + public VirtualRouterPeeringInner withPeerAsn(Long peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + /** + * Get the peerIp property: Peer IP. + * + * @return the peerIp value. + */ + public String peerIp() { + return this.peerIp; + } + + /** + * Set the peerIp property: Peer IP. + * + * @param peerIp the peerIp value to set. + * @return the VirtualRouterPeeringInner object itself. + */ + public VirtualRouterPeeringInner withPeerIp(String peerIp) { + this.peerIp = peerIp; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public VirtualRouterPeeringInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanInner.java new file mode 100644 index 0000000000000..66ee55598074a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanInner.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.OfficeTrafficCategory; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualWAN Resource. */ +@JsonFlatten +@Fluent +public class VirtualWanInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Vpn encryption to be disabled or not. + */ + @JsonProperty(value = "properties.disableVpnEncryption") + private Boolean disableVpnEncryption; + + /* + * List of VirtualHubs in the VirtualWAN. + */ + @JsonProperty(value = "properties.virtualHubs", access = JsonProperty.Access.WRITE_ONLY) + private List virtualHubs; + + /* + * List of VpnSites in the VirtualWAN. + */ + @JsonProperty(value = "properties.vpnSites", access = JsonProperty.Access.WRITE_ONLY) + private List vpnSites; + + /* + * True if branch to branch traffic is allowed. + */ + @JsonProperty(value = "properties.allowBranchToBranchTraffic") + private Boolean allowBranchToBranchTraffic; + + /* + * True if Vnet to Vnet traffic is allowed. + */ + @JsonProperty(value = "properties.allowVnetToVnetTraffic") + private Boolean allowVnetToVnetTraffic; + + /* + * The office local breakout category. + */ + @JsonProperty(value = "properties.office365LocalBreakoutCategory", access = JsonProperty.Access.WRITE_ONLY) + private OfficeTrafficCategory office365LocalBreakoutCategory; + + /* + * The provisioning state of the virtual WAN resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The type of the VirtualWAN. + */ + @JsonProperty(value = "properties.type") + private String typePropertiesType; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the disableVpnEncryption property: Vpn encryption to be disabled or not. + * + * @return the disableVpnEncryption value. + */ + public Boolean disableVpnEncryption() { + return this.disableVpnEncryption; + } + + /** + * Set the disableVpnEncryption property: Vpn encryption to be disabled or not. + * + * @param disableVpnEncryption the disableVpnEncryption value to set. + * @return the VirtualWanInner object itself. + */ + public VirtualWanInner withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.disableVpnEncryption = disableVpnEncryption; + return this; + } + + /** + * Get the virtualHubs property: List of VirtualHubs in the VirtualWAN. + * + * @return the virtualHubs value. + */ + public List virtualHubs() { + return this.virtualHubs; + } + + /** + * Get the vpnSites property: List of VpnSites in the VirtualWAN. + * + * @return the vpnSites value. + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Get the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed. + * + * @return the allowBranchToBranchTraffic value. + */ + public Boolean allowBranchToBranchTraffic() { + return this.allowBranchToBranchTraffic; + } + + /** + * Set the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed. + * + * @param allowBranchToBranchTraffic the allowBranchToBranchTraffic value to set. + * @return the VirtualWanInner object itself. + */ + public VirtualWanInner withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.allowBranchToBranchTraffic = allowBranchToBranchTraffic; + return this; + } + + /** + * Get the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed. + * + * @return the allowVnetToVnetTraffic value. + */ + public Boolean allowVnetToVnetTraffic() { + return this.allowVnetToVnetTraffic; + } + + /** + * Set the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed. + * + * @param allowVnetToVnetTraffic the allowVnetToVnetTraffic value to set. + * @return the VirtualWanInner object itself. + */ + public VirtualWanInner withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { + this.allowVnetToVnetTraffic = allowVnetToVnetTraffic; + return this; + } + + /** + * Get the office365LocalBreakoutCategory property: The office local breakout category. + * + * @return the office365LocalBreakoutCategory value. + */ + public OfficeTrafficCategory office365LocalBreakoutCategory() { + return this.office365LocalBreakoutCategory; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual WAN resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the typePropertiesType property: The type of the VirtualWAN. + * + * @return the typePropertiesType value. + */ + public String typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: The type of the VirtualWAN. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the VirtualWanInner object itself. + */ + public VirtualWanInner withTypePropertiesType(String typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VirtualWanInner object itself. + */ + public VirtualWanInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualWanInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualWanInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanSecurityProvidersInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanSecurityProvidersInner.java new file mode 100644 index 0000000000000..a9e0d37949582 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanSecurityProvidersInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProvider; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of SecurityProviders. */ +@Fluent +public final class VirtualWanSecurityProvidersInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanSecurityProvidersInner.class); + + /* + * List of VirtualWAN security providers. + */ + @JsonProperty(value = "supportedProviders") + private List supportedProviders; + + /** + * Get the supportedProviders property: List of VirtualWAN security providers. + * + * @return the supportedProviders value. + */ + public List supportedProviders() { + return this.supportedProviders; + } + + /** + * Set the supportedProviders property: List of VirtualWAN security providers. + * + * @param supportedProviders the supportedProviders value to set. + * @return the VirtualWanSecurityProvidersInner object itself. + */ + public VirtualWanSecurityProvidersInner withSupportedProviders( + List supportedProviders) { + this.supportedProviders = supportedProviders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedProviders() != null) { + supportedProviders().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientConnectionHealthDetailListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientConnectionHealthDetailListResultInner.java new file mode 100644 index 0000000000000..57d9bc777b2ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientConnectionHealthDetailListResultInner.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.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetail; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of virtual network gateway vpn client connection health. */ +@Fluent +public final class VpnClientConnectionHealthDetailListResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VpnClientConnectionHealthDetailListResultInner.class); + + /* + * List of vpn client connection health. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of vpn client connection health. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of vpn client connection health. + * + * @param value the value value to set. + * @return the VpnClientConnectionHealthDetailListResultInner object itself. + */ + public VpnClientConnectionHealthDetailListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientIPsecParametersInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientIPsecParametersInner.java new file mode 100644 index 0000000000000..0424a27575b8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientIPsecParametersInner.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.DhGroup; +import com.azure.resourcemanager.network.generated.models.IkeEncryption; +import com.azure.resourcemanager.network.generated.models.IkeIntegrity; +import com.azure.resourcemanager.network.generated.models.IpsecEncryption; +import com.azure.resourcemanager.network.generated.models.IpsecIntegrity; +import com.azure.resourcemanager.network.generated.models.PfsGroup; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An IPSec parameters for a virtual network gateway P2S connection. */ +@Fluent +public final class VpnClientIPsecParametersInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientIPsecParametersInner.class); + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /* + * The IPSec encryption algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /* + * The IPSec integrity algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /* + * The IKE encryption algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /* + * The IKE integrity algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /* + * The DH Group used in IKE Phase 1 for initial SA. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /* + * The Pfs Group used in IKE Phase 2 for new child SA. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + * + * @return the saLifeTimeSeconds value. + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + * + * @return the saDataSizeKilobytes value. + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @return the ipsecEncryption value. + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @param ipsecEncryption the ipsecEncryption value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @return the ipsecIntegrity value. + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @param ipsecIntegrity the ipsecIntegrity value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @return the ikeEncryption value. + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @param ikeEncryption the ikeEncryption value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @return the ikeIntegrity value. + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @param ikeIntegrity the ikeIntegrity value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @return the dhGroup value. + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @param dhGroup the dhGroup value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @return the pfsGroup value. + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @param pfsGroup the pfsGroup value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipsecEncryption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipsecEncryption in model VpnClientIPsecParametersInner")); + } + if (ipsecIntegrity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipsecIntegrity in model VpnClientIPsecParametersInner")); + } + if (ikeEncryption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ikeEncryption in model VpnClientIPsecParametersInner")); + } + if (ikeIntegrity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ikeIntegrity in model VpnClientIPsecParametersInner")); + } + if (dhGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dhGroup in model VpnClientIPsecParametersInner")); + } + if (pfsGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property pfsGroup in model VpnClientIPsecParametersInner")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionInner.java new file mode 100644 index 0000000000000..c142de26e4653 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionInner.java @@ -0,0 +1,551 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnConnection Resource. */ +@JsonFlatten +@Fluent +public class VpnConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Id of the connected vpn site. + */ + @JsonProperty(value = "properties.remoteVpnSite") + private SubResource remoteVpnSite; + + /* + * Routing weight for vpn connection. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /* + * DPD timeout in seconds for vpn connection. + */ + @JsonProperty(value = "properties.dpdTimeoutSeconds") + private Integer dpdTimeoutSeconds; + + /* + * The connection status. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VpnConnectionStatus connectionStatus; + + /* + * Connection protocol used for this connection. + */ + @JsonProperty(value = "properties.vpnConnectionProtocolType") + private VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType; + + /* + * Ingress bytes transferred. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * Egress bytes transferred. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * Expected bandwidth in MBPS. + */ + @JsonProperty(value = "properties.connectionBandwidth") + private Integer connectionBandwidth; + + /* + * SharedKey for the vpn connection. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /* + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /* + * The Traffic Selector Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.trafficSelectorPolicies") + private List trafficSelectorPolicies; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableRateLimiting") + private Boolean enableRateLimiting; + + /* + * Enable internet security. + */ + @JsonProperty(value = "properties.enableInternetSecurity") + private Boolean enableInternetSecurity; + + /* + * Use local azure ip to initiate connection. + */ + @JsonProperty(value = "properties.useLocalAzureIpAddress") + private Boolean useLocalAzureIpAddress; + + /* + * The provisioning state of the VPN connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * List of all vpn site link connections to the gateway. + */ + @JsonProperty(value = "properties.vpnLinkConnections") + private List vpnLinkConnections; + + /* + * The Routing Configuration indicating the associated and propagated route + * tables on this connection. + */ + @JsonProperty(value = "properties.routingConfiguration") + private RoutingConfiguration routingConfiguration; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the remoteVpnSite property: Id of the connected vpn site. + * + * @return the remoteVpnSite value. + */ + public SubResource remoteVpnSite() { + return this.remoteVpnSite; + } + + /** + * Set the remoteVpnSite property: Id of the connected vpn site. + * + * @param remoteVpnSite the remoteVpnSite value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRemoteVpnSite(SubResource remoteVpnSite) { + this.remoteVpnSite = remoteVpnSite; + return this; + } + + /** + * Get the routingWeight property: Routing weight for vpn connection. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routingWeight property: Routing weight for vpn connection. + * + * @param routingWeight the routingWeight value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the dpdTimeoutSeconds property: DPD timeout in seconds for vpn connection. + * + * @return the dpdTimeoutSeconds value. + */ + public Integer dpdTimeoutSeconds() { + return this.dpdTimeoutSeconds; + } + + /** + * Set the dpdTimeoutSeconds property: DPD timeout in seconds for vpn connection. + * + * @param dpdTimeoutSeconds the dpdTimeoutSeconds value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withDpdTimeoutSeconds(Integer dpdTimeoutSeconds) { + this.dpdTimeoutSeconds = dpdTimeoutSeconds; + return this; + } + + /** + * Get the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + public VpnConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @return the vpnConnectionProtocolType value. + */ + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.vpnConnectionProtocolType; + } + + /** + * Set the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @param vpnConnectionProtocolType the vpnConnectionProtocolType value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withVpnConnectionProtocolType( + VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType) { + this.vpnConnectionProtocolType = vpnConnectionProtocolType; + return this; + } + + /** + * Get the ingressBytesTransferred property: Ingress bytes transferred. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the egressBytesTransferred property: Egress bytes transferred. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @return the connectionBandwidth value. + */ + public Integer connectionBandwidth() { + return this.connectionBandwidth; + } + + /** + * Set the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @param connectionBandwidth the connectionBandwidth value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withConnectionBandwidth(Integer connectionBandwidth) { + this.connectionBandwidth = connectionBandwidth; + return this; + } + + /** + * Get the sharedKey property: SharedKey for the vpn connection. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the sharedKey property: SharedKey for the vpn connection. + * + * @param sharedKey the sharedKey value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set the enableBgp property: EnableBgp flag. + * + * @param enableBgp the enableBgp value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @return the trafficSelectorPolicies value. + */ + public List trafficSelectorPolicies() { + return this.trafficSelectorPolicies; + } + + /** + * Set the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @param trafficSelectorPolicies the trafficSelectorPolicies value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withTrafficSelectorPolicies(List trafficSelectorPolicies) { + this.trafficSelectorPolicies = trafficSelectorPolicies; + return this; + } + + /** + * Get the enableRateLimiting property: EnableBgp flag. + * + * @return the enableRateLimiting value. + */ + public Boolean enableRateLimiting() { + return this.enableRateLimiting; + } + + /** + * Set the enableRateLimiting property: EnableBgp flag. + * + * @param enableRateLimiting the enableRateLimiting value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableRateLimiting(Boolean enableRateLimiting) { + this.enableRateLimiting = enableRateLimiting; + return this; + } + + /** + * Get the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + public Boolean enableInternetSecurity() { + return this.enableInternetSecurity; + } + + /** + * Set the enableInternetSecurity property: Enable internet security. + * + * @param enableInternetSecurity the enableInternetSecurity value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.enableInternetSecurity = enableInternetSecurity; + return this; + } + + /** + * Get the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value. + */ + public Boolean useLocalAzureIpAddress() { + return this.useLocalAzureIpAddress; + } + + /** + * Set the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @param useLocalAzureIpAddress the useLocalAzureIpAddress value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress) { + this.useLocalAzureIpAddress = useLocalAzureIpAddress; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the vpnLinkConnections property: List of all vpn site link connections to the gateway. + * + * @return the vpnLinkConnections value. + */ + public List vpnLinkConnections() { + return this.vpnLinkConnections; + } + + /** + * Set the vpnLinkConnections property: List of all vpn site link connections to the gateway. + * + * @param vpnLinkConnections the vpnLinkConnections value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withVpnLinkConnections(List vpnLinkConnections) { + this.vpnLinkConnections = vpnLinkConnections; + return this; + } + + /** + * Get the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + public RoutingConfiguration routingConfiguration() { + return this.routingConfiguration; + } + + /** + * Set the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @param routingConfiguration the routingConfiguration value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRoutingConfiguration(RoutingConfiguration routingConfiguration) { + this.routingConfiguration = routingConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public VpnConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipsecPolicies() != null) { + ipsecPolicies().forEach(e -> e.validate()); + } + if (trafficSelectorPolicies() != null) { + trafficSelectorPolicies().forEach(e -> e.validate()); + } + if (vpnLinkConnections() != null) { + vpnLinkConnections().forEach(e -> e.validate()); + } + if (routingConfiguration() != null) { + routingConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayInner.java new file mode 100644 index 0000000000000..eb10c8bbdc30a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayInner.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnGatewayIpConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VpnGateway Resource. */ +@JsonFlatten +@Fluent +public class VpnGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /* + * List of all vpn connections to the gateway. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /* + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /* + * The provisioning state of the VPN gateway resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The scale unit for this vpn gateway. + */ + @JsonProperty(value = "properties.vpnGatewayScaleUnit") + private Integer vpnGatewayScaleUnit; + + /* + * List of all IPs configured on the gateway. + */ + @JsonProperty(value = "properties.ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /* + * Enable Routing Preference property for the Public IP Interface of the + * VpnGateway. + */ + @JsonProperty(value = "properties.isRoutingPreferenceInternet") + private Boolean isRoutingPreferenceInternet; + + /* + * List of all the nat Rules associated with the gateway. + */ + @JsonProperty(value = "properties.natRules") + private List natRules; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the virtualHub property: The VirtualHub to which the gateway belongs. + * + * @return the virtualHub value. + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the virtualHub property: The VirtualHub to which the gateway belongs. + * + * @param virtualHub the virtualHub value to set. + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get the connections property: List of all vpn connections to the gateway. + * + * @return the connections value. + */ + public List connections() { + return this.connections; + } + + /** + * Set the connections property: List of all vpn connections to the gateway. + * + * @param connections the connections value to set. + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get the bgpSettings property: Local network gateway's BGP speaker settings. + * + * @return the bgpSettings value. + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set the bgpSettings property: Local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set. + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the vpnGatewayScaleUnit property: The scale unit for this vpn gateway. + * + * @return the vpnGatewayScaleUnit value. + */ + public Integer vpnGatewayScaleUnit() { + return this.vpnGatewayScaleUnit; + } + + /** + * Set the vpnGatewayScaleUnit property: The scale unit for this vpn gateway. + * + * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set. + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.vpnGatewayScaleUnit = vpnGatewayScaleUnit; + return this; + } + + /** + * Get the ipConfigurations property: List of all IPs configured on the gateway. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Get the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP Interface of + * the VpnGateway. + * + * @return the isRoutingPreferenceInternet value. + */ + public Boolean isRoutingPreferenceInternet() { + return this.isRoutingPreferenceInternet; + } + + /** + * Set the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP Interface of + * the VpnGateway. + * + * @param isRoutingPreferenceInternet the isRoutingPreferenceInternet value to set. + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withIsRoutingPreferenceInternet(Boolean isRoutingPreferenceInternet) { + this.isRoutingPreferenceInternet = isRoutingPreferenceInternet; + return this; + } + + /** + * Get the natRules property: List of all the nat Rules associated with the gateway. + * + * @return the natRules value. + */ + public List natRules() { + return this.natRules; + } + + /** + * Set the natRules property: List of all the nat Rules associated with the gateway. + * + * @param natRules the natRules value to set. + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withNatRules(List natRules) { + this.natRules = natRules; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VpnGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VpnGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connections() != null) { + connections().forEach(e -> e.validate()); + } + if (bgpSettings() != null) { + bgpSettings().validate(); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (natRules() != null) { + natRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleInner.java new file mode 100644 index 0000000000000..57e61975d4144 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleInner.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnGatewayNatRule Resource. */ +@JsonFlatten +@Fluent +public class VpnGatewayNatRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayNatRuleInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The provisioning state of the NAT Rule resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The type of NAT rule for VPN NAT. + */ + @JsonProperty(value = "properties.type") + private VpnNatRuleType typePropertiesType; + + /* + * The Source NAT direction of a VPN NAT. + */ + @JsonProperty(value = "properties.mode") + private VpnNatRuleMode mode; + + /* + * The private IP address internal mapping for NAT. + */ + @JsonProperty(value = "properties.internalMappings") + private List internalMappings; + + /* + * The private IP address external mapping for NAT. + */ + @JsonProperty(value = "properties.externalMappings") + private List externalMappings; + + /* + * The IP Configuration ID this NAT rule applies to. + */ + @JsonProperty(value = "properties.ipConfigurationId") + private String ipConfigurationId; + + /* + * List of egress VpnSiteLinkConnections. + */ + @JsonProperty(value = "properties.egressVpnSiteLinkConnections", access = JsonProperty.Access.WRITE_ONLY) + private List egressVpnSiteLinkConnections; + + /* + * List of ingress VpnSiteLinkConnections. + */ + @JsonProperty(value = "properties.ingressVpnSiteLinkConnections", access = JsonProperty.Access.WRITE_ONLY) + private List ingressVpnSiteLinkConnections; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VpnGatewayNatRuleInner object itself. + */ + public VpnGatewayNatRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the typePropertiesType property: The type of NAT rule for VPN NAT. + * + * @return the typePropertiesType value. + */ + public VpnNatRuleType typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: The type of NAT rule for VPN NAT. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the VpnGatewayNatRuleInner object itself. + */ + public VpnGatewayNatRuleInner withTypePropertiesType(VpnNatRuleType typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the mode property: The Source NAT direction of a VPN NAT. + * + * @return the mode value. + */ + public VpnNatRuleMode mode() { + return this.mode; + } + + /** + * Set the mode property: The Source NAT direction of a VPN NAT. + * + * @param mode the mode value to set. + * @return the VpnGatewayNatRuleInner object itself. + */ + public VpnGatewayNatRuleInner withMode(VpnNatRuleMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the internalMappings property: The private IP address internal mapping for NAT. + * + * @return the internalMappings value. + */ + public List internalMappings() { + return this.internalMappings; + } + + /** + * Set the internalMappings property: The private IP address internal mapping for NAT. + * + * @param internalMappings the internalMappings value to set. + * @return the VpnGatewayNatRuleInner object itself. + */ + public VpnGatewayNatRuleInner withInternalMappings(List internalMappings) { + this.internalMappings = internalMappings; + return this; + } + + /** + * Get the externalMappings property: The private IP address external mapping for NAT. + * + * @return the externalMappings value. + */ + public List externalMappings() { + return this.externalMappings; + } + + /** + * Set the externalMappings property: The private IP address external mapping for NAT. + * + * @param externalMappings the externalMappings value to set. + * @return the VpnGatewayNatRuleInner object itself. + */ + public VpnGatewayNatRuleInner withExternalMappings(List externalMappings) { + this.externalMappings = externalMappings; + return this; + } + + /** + * Get the ipConfigurationId property: The IP Configuration ID this NAT rule applies to. + * + * @return the ipConfigurationId value. + */ + public String ipConfigurationId() { + return this.ipConfigurationId; + } + + /** + * Set the ipConfigurationId property: The IP Configuration ID this NAT rule applies to. + * + * @param ipConfigurationId the ipConfigurationId value to set. + * @return the VpnGatewayNatRuleInner object itself. + */ + public VpnGatewayNatRuleInner withIpConfigurationId(String ipConfigurationId) { + this.ipConfigurationId = ipConfigurationId; + return this; + } + + /** + * Get the egressVpnSiteLinkConnections property: List of egress VpnSiteLinkConnections. + * + * @return the egressVpnSiteLinkConnections value. + */ + public List egressVpnSiteLinkConnections() { + return this.egressVpnSiteLinkConnections; + } + + /** + * Get the ingressVpnSiteLinkConnections property: List of ingress VpnSiteLinkConnections. + * + * @return the ingressVpnSiteLinkConnections value. + */ + public List ingressVpnSiteLinkConnections() { + return this.ingressVpnSiteLinkConnections; + } + + /** {@inheritDoc} */ + @Override + public VpnGatewayNatRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (internalMappings() != null) { + internalMappings().forEach(e -> e.validate()); + } + if (externalMappings() != null) { + externalMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnProfileResponseInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnProfileResponseInner.java new file mode 100644 index 0000000000000..870cc0035b8fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnProfileResponseInner.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.network.generated.fluent.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; + +/** Vpn Profile Response for package generation. */ +@Fluent +public final class VpnProfileResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnProfileResponseInner.class); + + /* + * URL to the VPN profile. + */ + @JsonProperty(value = "profileUrl") + private String profileUrl; + + /** + * Get the profileUrl property: URL to the VPN profile. + * + * @return the profileUrl value. + */ + public String profileUrl() { + return this.profileUrl; + } + + /** + * Set the profileUrl property: URL to the VPN profile. + * + * @param profileUrl the profileUrl value to set. + * @return the VpnProfileResponseInner object itself. + */ + public VpnProfileResponseInner withProfileUrl(String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationInner.java new file mode 100644 index 0000000000000..bd58aa49b6587 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationInner.java @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.models.AadAuthenticationParameters; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.VpnAuthenticationType; +import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VpnServerConfiguration Resource. */ +@JsonFlatten +@Fluent +public class VpnServerConfigurationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigurationInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The name of the VpnServerConfiguration that is unique within a resource + * group. + */ + @JsonProperty(value = "properties.name") + private String namePropertiesName; + + /* + * VPN protocols for the VpnServerConfiguration. + */ + @JsonProperty(value = "properties.vpnProtocols") + private List vpnProtocols; + + /* + * VPN authentication types for the VpnServerConfiguration. + */ + @JsonProperty(value = "properties.vpnAuthenticationTypes") + private List vpnAuthenticationTypes; + + /* + * VPN client root certificate of VpnServerConfiguration. + */ + @JsonProperty(value = "properties.vpnClientRootCertificates") + private List vpnClientRootCertificates; + + /* + * VPN client revoked certificate of VpnServerConfiguration. + */ + @JsonProperty(value = "properties.vpnClientRevokedCertificates") + private List vpnClientRevokedCertificates; + + /* + * Radius Server root certificate of VpnServerConfiguration. + */ + @JsonProperty(value = "properties.radiusServerRootCertificates") + private List radiusServerRootCertificates; + + /* + * Radius client root certificate of VpnServerConfiguration. + */ + @JsonProperty(value = "properties.radiusClientRootCertificates") + private List radiusClientRootCertificates; + + /* + * VpnClientIpsecPolicies for VpnServerConfiguration. + */ + @JsonProperty(value = "properties.vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /* + * The radius server address property of the VpnServerConfiguration + * resource for point to site client connection. + */ + @JsonProperty(value = "properties.radiusServerAddress") + private String radiusServerAddress; + + /* + * The radius secret property of the VpnServerConfiguration resource for + * point to site client connection. + */ + @JsonProperty(value = "properties.radiusServerSecret") + private String radiusServerSecret; + + /* + * Multiple Radius Server configuration for VpnServerConfiguration. + */ + @JsonProperty(value = "properties.radiusServers") + private List radiusServers; + + /* + * The set of aad vpn authentication parameters. + */ + @JsonProperty(value = "properties.aadAuthenticationParameters") + private AadAuthenticationParameters aadAuthenticationParameters; + + /* + * The provisioning state of the VpnServerConfiguration resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * List of references to P2SVpnGateways. + */ + @JsonProperty(value = "properties.p2SVpnGateways", access = JsonProperty.Access.WRITE_ONLY) + private List p2SVpnGateways; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "properties.etag", access = JsonProperty.Access.WRITE_ONLY) + private String etagPropertiesEtag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the namePropertiesName property: The name of the VpnServerConfiguration that is unique within a resource + * group. + * + * @return the namePropertiesName value. + */ + public String namePropertiesName() { + return this.namePropertiesName; + } + + /** + * Set the namePropertiesName property: The name of the VpnServerConfiguration that is unique within a resource + * group. + * + * @param namePropertiesName the namePropertiesName value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withNamePropertiesName(String namePropertiesName) { + this.namePropertiesName = namePropertiesName; + return this; + } + + /** + * Get the vpnProtocols property: VPN protocols for the VpnServerConfiguration. + * + * @return the vpnProtocols value. + */ + public List vpnProtocols() { + return this.vpnProtocols; + } + + /** + * Set the vpnProtocols property: VPN protocols for the VpnServerConfiguration. + * + * @param vpnProtocols the vpnProtocols value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withVpnProtocols(List vpnProtocols) { + this.vpnProtocols = vpnProtocols; + return this; + } + + /** + * Get the vpnAuthenticationTypes property: VPN authentication types for the VpnServerConfiguration. + * + * @return the vpnAuthenticationTypes value. + */ + public List vpnAuthenticationTypes() { + return this.vpnAuthenticationTypes; + } + + /** + * Set the vpnAuthenticationTypes property: VPN authentication types for the VpnServerConfiguration. + * + * @param vpnAuthenticationTypes the vpnAuthenticationTypes value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withVpnAuthenticationTypes(List vpnAuthenticationTypes) { + this.vpnAuthenticationTypes = vpnAuthenticationTypes; + return this; + } + + /** + * Get the vpnClientRootCertificates property: VPN client root certificate of VpnServerConfiguration. + * + * @return the vpnClientRootCertificates value. + */ + public List vpnClientRootCertificates() { + return this.vpnClientRootCertificates; + } + + /** + * Set the vpnClientRootCertificates property: VPN client root certificate of VpnServerConfiguration. + * + * @param vpnClientRootCertificates the vpnClientRootCertificates value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withVpnClientRootCertificates( + List vpnClientRootCertificates) { + this.vpnClientRootCertificates = vpnClientRootCertificates; + return this; + } + + /** + * Get the vpnClientRevokedCertificates property: VPN client revoked certificate of VpnServerConfiguration. + * + * @return the vpnClientRevokedCertificates value. + */ + public List vpnClientRevokedCertificates() { + return this.vpnClientRevokedCertificates; + } + + /** + * Set the vpnClientRevokedCertificates property: VPN client revoked certificate of VpnServerConfiguration. + * + * @param vpnClientRevokedCertificates the vpnClientRevokedCertificates value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withVpnClientRevokedCertificates( + List vpnClientRevokedCertificates) { + this.vpnClientRevokedCertificates = vpnClientRevokedCertificates; + return this; + } + + /** + * Get the radiusServerRootCertificates property: Radius Server root certificate of VpnServerConfiguration. + * + * @return the radiusServerRootCertificates value. + */ + public List radiusServerRootCertificates() { + return this.radiusServerRootCertificates; + } + + /** + * Set the radiusServerRootCertificates property: Radius Server root certificate of VpnServerConfiguration. + * + * @param radiusServerRootCertificates the radiusServerRootCertificates value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withRadiusServerRootCertificates( + List radiusServerRootCertificates) { + this.radiusServerRootCertificates = radiusServerRootCertificates; + return this; + } + + /** + * Get the radiusClientRootCertificates property: Radius client root certificate of VpnServerConfiguration. + * + * @return the radiusClientRootCertificates value. + */ + public List radiusClientRootCertificates() { + return this.radiusClientRootCertificates; + } + + /** + * Set the radiusClientRootCertificates property: Radius client root certificate of VpnServerConfiguration. + * + * @param radiusClientRootCertificates the radiusClientRootCertificates value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withRadiusClientRootCertificates( + List radiusClientRootCertificates) { + this.radiusClientRootCertificates = radiusClientRootCertificates; + return this; + } + + /** + * Get the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for VpnServerConfiguration. + * + * @return the vpnClientIpsecPolicies value. + */ + public List vpnClientIpsecPolicies() { + return this.vpnClientIpsecPolicies; + } + + /** + * Set the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for VpnServerConfiguration. + * + * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + return this; + } + + /** + * Get the radiusServerAddress property: The radius server address property of the VpnServerConfiguration resource + * for point to site client connection. + * + * @return the radiusServerAddress value. + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radiusServerAddress property: The radius server address property of the VpnServerConfiguration resource + * for point to site client connection. + * + * @param radiusServerAddress the radiusServerAddress value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radiusServerSecret property: The radius secret property of the VpnServerConfiguration resource for point + * to site client connection. + * + * @return the radiusServerSecret value. + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radiusServerSecret property: The radius secret property of the VpnServerConfiguration resource for point + * to site client connection. + * + * @param radiusServerSecret the radiusServerSecret value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + + /** + * Get the radiusServers property: Multiple Radius Server configuration for VpnServerConfiguration. + * + * @return the radiusServers value. + */ + public List radiusServers() { + return this.radiusServers; + } + + /** + * Set the radiusServers property: Multiple Radius Server configuration for VpnServerConfiguration. + * + * @param radiusServers the radiusServers value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withRadiusServers(List radiusServers) { + this.radiusServers = radiusServers; + return this; + } + + /** + * Get the aadAuthenticationParameters property: The set of aad vpn authentication parameters. + * + * @return the aadAuthenticationParameters value. + */ + public AadAuthenticationParameters aadAuthenticationParameters() { + return this.aadAuthenticationParameters; + } + + /** + * Set the aadAuthenticationParameters property: The set of aad vpn authentication parameters. + * + * @param aadAuthenticationParameters the aadAuthenticationParameters value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withAadAuthenticationParameters( + AadAuthenticationParameters aadAuthenticationParameters) { + this.aadAuthenticationParameters = aadAuthenticationParameters; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VpnServerConfiguration resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the p2SVpnGateways property: List of references to P2SVpnGateways. + * + * @return the p2SVpnGateways value. + */ + public List p2SVpnGateways() { + return this.p2SVpnGateways; + } + + /** + * Get the etagPropertiesEtag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etagPropertiesEtag value. + */ + public String etagPropertiesEtag() { + return this.etagPropertiesEtag; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VpnServerConfigurationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VpnServerConfigurationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vpnClientRootCertificates() != null) { + vpnClientRootCertificates().forEach(e -> e.validate()); + } + if (vpnClientRevokedCertificates() != null) { + vpnClientRevokedCertificates().forEach(e -> e.validate()); + } + if (radiusServerRootCertificates() != null) { + radiusServerRootCertificates().forEach(e -> e.validate()); + } + if (radiusClientRootCertificates() != null) { + radiusClientRootCertificates().forEach(e -> e.validate()); + } + if (vpnClientIpsecPolicies() != null) { + vpnClientIpsecPolicies().forEach(e -> e.validate()); + } + if (radiusServers() != null) { + radiusServers().forEach(e -> e.validate()); + } + if (aadAuthenticationParameters() != null) { + aadAuthenticationParameters().validate(); + } + if (p2SVpnGateways() != null) { + p2SVpnGateways().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationsResponseInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationsResponseInner.java new file mode 100644 index 0000000000000..685b9ac2aff38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationsResponseInner.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.network.generated.fluent.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; + +/** VpnServerConfigurations list associated with VirtualWan Response. */ +@Fluent +public final class VpnServerConfigurationsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigurationsResponseInner.class); + + /* + * List of VpnServerConfigurations associated with VirtualWan. + */ + @JsonProperty(value = "vpnServerConfigurationResourceIds") + private List vpnServerConfigurationResourceIds; + + /** + * Get the vpnServerConfigurationResourceIds property: List of VpnServerConfigurations associated with VirtualWan. + * + * @return the vpnServerConfigurationResourceIds value. + */ + public List vpnServerConfigurationResourceIds() { + return this.vpnServerConfigurationResourceIds; + } + + /** + * Set the vpnServerConfigurationResourceIds property: List of VpnServerConfigurations associated with VirtualWan. + * + * @param vpnServerConfigurationResourceIds the vpnServerConfigurationResourceIds value to set. + * @return the VpnServerConfigurationsResponseInner object itself. + */ + public VpnServerConfigurationsResponseInner withVpnServerConfigurationResourceIds( + List vpnServerConfigurationResourceIds) { + this.vpnServerConfigurationResourceIds = vpnServerConfigurationResourceIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteInner.java new file mode 100644 index 0000000000000..f4014bc973dcf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteInner.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.DeviceProperties; +import com.azure.resourcemanager.network.generated.models.O365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VpnSite Resource. */ +@JsonFlatten +@Fluent +public class VpnSiteInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The VirtualWAN to which the vpnSite belongs. + */ + @JsonProperty(value = "properties.virtualWan") + private SubResource virtualWan; + + /* + * The device properties. + */ + @JsonProperty(value = "properties.deviceProperties") + private DeviceProperties deviceProperties; + + /* + * The ip-address for the vpn-site. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /* + * The key for vpn-site that can be used for connections. + */ + @JsonProperty(value = "properties.siteKey") + private String siteKey; + + /* + * The AddressSpace that contains an array of IP address ranges. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /* + * The set of bgp properties. + */ + @JsonProperty(value = "properties.bgpProperties") + private BgpSettings bgpProperties; + + /* + * The provisioning state of the VPN site resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * IsSecuritySite flag. + */ + @JsonProperty(value = "properties.isSecuritySite") + private Boolean isSecuritySite; + + /* + * List of all vpn site links. + */ + @JsonProperty(value = "properties.vpnSiteLinks") + private List vpnSiteLinks; + + /* + * Office365 Policy. + */ + @JsonProperty(value = "properties.o365Policy") + private O365PolicyProperties o365Policy; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the virtualWan property: The VirtualWAN to which the vpnSite belongs. + * + * @return the virtualWan value. + */ + public SubResource virtualWan() { + return this.virtualWan; + } + + /** + * Set the virtualWan property: The VirtualWAN to which the vpnSite belongs. + * + * @param virtualWan the virtualWan value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withVirtualWan(SubResource virtualWan) { + this.virtualWan = virtualWan; + return this; + } + + /** + * Get the deviceProperties property: The device properties. + * + * @return the deviceProperties value. + */ + public DeviceProperties deviceProperties() { + return this.deviceProperties; + } + + /** + * Set the deviceProperties property: The device properties. + * + * @param deviceProperties the deviceProperties value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withDeviceProperties(DeviceProperties deviceProperties) { + this.deviceProperties = deviceProperties; + return this; + } + + /** + * Get the ipAddress property: The ip-address for the vpn-site. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The ip-address for the vpn-site. + * + * @param ipAddress the ipAddress value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the siteKey property: The key for vpn-site that can be used for connections. + * + * @return the siteKey value. + */ + public String siteKey() { + return this.siteKey; + } + + /** + * Set the siteKey property: The key for vpn-site that can be used for connections. + * + * @param siteKey the siteKey value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withSiteKey(String siteKey) { + this.siteKey = siteKey; + return this; + } + + /** + * Get the addressSpace property: The AddressSpace that contains an array of IP address ranges. + * + * @return the addressSpace value. + */ + public AddressSpace addressSpace() { + return this.addressSpace; + } + + /** + * Set the addressSpace property: The AddressSpace that contains an array of IP address ranges. + * + * @param addressSpace the addressSpace value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the bgpProperties property: The set of bgp properties. + * + * @return the bgpProperties value. + */ + public BgpSettings bgpProperties() { + return this.bgpProperties; + } + + /** + * Set the bgpProperties property: The set of bgp properties. + * + * @param bgpProperties the bgpProperties value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withBgpProperties(BgpSettings bgpProperties) { + this.bgpProperties = bgpProperties; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN site resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the isSecuritySite property: IsSecuritySite flag. + * + * @return the isSecuritySite value. + */ + public Boolean isSecuritySite() { + return this.isSecuritySite; + } + + /** + * Set the isSecuritySite property: IsSecuritySite flag. + * + * @param isSecuritySite the isSecuritySite value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withIsSecuritySite(Boolean isSecuritySite) { + this.isSecuritySite = isSecuritySite; + return this; + } + + /** + * Get the vpnSiteLinks property: List of all vpn site links. + * + * @return the vpnSiteLinks value. + */ + public List vpnSiteLinks() { + return this.vpnSiteLinks; + } + + /** + * Set the vpnSiteLinks property: List of all vpn site links. + * + * @param vpnSiteLinks the vpnSiteLinks value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withVpnSiteLinks(List vpnSiteLinks) { + this.vpnSiteLinks = vpnSiteLinks; + return this; + } + + /** + * Get the o365Policy property: Office365 Policy. + * + * @return the o365Policy value. + */ + public O365PolicyProperties o365Policy() { + return this.o365Policy; + } + + /** + * Set the o365Policy property: Office365 Policy. + * + * @param o365Policy the o365Policy value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withO365Policy(O365PolicyProperties o365Policy) { + this.o365Policy = o365Policy; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VpnSiteInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VpnSiteInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deviceProperties() != null) { + deviceProperties().validate(); + } + if (addressSpace() != null) { + addressSpace().validate(); + } + if (bgpProperties() != null) { + bgpProperties().validate(); + } + if (vpnSiteLinks() != null) { + vpnSiteLinks().forEach(e -> e.validate()); + } + if (o365Policy() != null) { + o365Policy().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionInner.java new file mode 100644 index 0000000000000..d7c15dc742c15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionInner.java @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnectionMode; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnSiteLinkConnection Resource. */ +@JsonFlatten +@Fluent +public class VpnSiteLinkConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinkConnectionInner.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Id of the connected vpn site link. + */ + @JsonProperty(value = "properties.vpnSiteLink") + private SubResource vpnSiteLink; + + /* + * Routing weight for vpn connection. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /* + * Vpn link connection mode. + */ + @JsonProperty(value = "properties.vpnLinkConnectionMode") + private VpnLinkConnectionMode vpnLinkConnectionMode; + + /* + * The connection status. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VpnConnectionStatus connectionStatus; + + /* + * Connection protocol used for this connection. + */ + @JsonProperty(value = "properties.vpnConnectionProtocolType") + private VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType; + + /* + * Ingress bytes transferred. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * Egress bytes transferred. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * Expected bandwidth in MBPS. + */ + @JsonProperty(value = "properties.connectionBandwidth") + private Integer connectionBandwidth; + + /* + * SharedKey for the vpn connection. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /* + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableRateLimiting") + private Boolean enableRateLimiting; + + /* + * Use local azure ip to initiate connection. + */ + @JsonProperty(value = "properties.useLocalAzureIpAddress") + private Boolean useLocalAzureIpAddress; + + /* + * The provisioning state of the VPN site link connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * List of ingress NatRules. + */ + @JsonProperty(value = "properties.ingressNatRules") + private List ingressNatRules; + + /* + * List of egress NatRules. + */ + @JsonProperty(value = "properties.egressNatRules") + private List egressNatRules; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the vpnSiteLink property: Id of the connected vpn site link. + * + * @return the vpnSiteLink value. + */ + public SubResource vpnSiteLink() { + return this.vpnSiteLink; + } + + /** + * Set the vpnSiteLink property: Id of the connected vpn site link. + * + * @param vpnSiteLink the vpnSiteLink value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withVpnSiteLink(SubResource vpnSiteLink) { + this.vpnSiteLink = vpnSiteLink; + return this; + } + + /** + * Get the routingWeight property: Routing weight for vpn connection. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routingWeight property: Routing weight for vpn connection. + * + * @param routingWeight the routingWeight value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the vpnLinkConnectionMode property: Vpn link connection mode. + * + * @return the vpnLinkConnectionMode value. + */ + public VpnLinkConnectionMode vpnLinkConnectionMode() { + return this.vpnLinkConnectionMode; + } + + /** + * Set the vpnLinkConnectionMode property: Vpn link connection mode. + * + * @param vpnLinkConnectionMode the vpnLinkConnectionMode value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withVpnLinkConnectionMode(VpnLinkConnectionMode vpnLinkConnectionMode) { + this.vpnLinkConnectionMode = vpnLinkConnectionMode; + return this; + } + + /** + * Get the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + public VpnConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @return the vpnConnectionProtocolType value. + */ + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.vpnConnectionProtocolType; + } + + /** + * Set the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @param vpnConnectionProtocolType the vpnConnectionProtocolType value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withVpnConnectionProtocolType( + VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType) { + this.vpnConnectionProtocolType = vpnConnectionProtocolType; + return this; + } + + /** + * Get the ingressBytesTransferred property: Ingress bytes transferred. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the egressBytesTransferred property: Egress bytes transferred. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @return the connectionBandwidth value. + */ + public Integer connectionBandwidth() { + return this.connectionBandwidth; + } + + /** + * Set the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @param connectionBandwidth the connectionBandwidth value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withConnectionBandwidth(Integer connectionBandwidth) { + this.connectionBandwidth = connectionBandwidth; + return this; + } + + /** + * Get the sharedKey property: SharedKey for the vpn connection. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the sharedKey property: SharedKey for the vpn connection. + * + * @param sharedKey the sharedKey value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set the enableBgp property: EnableBgp flag. + * + * @param enableBgp the enableBgp value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the enableRateLimiting property: EnableBgp flag. + * + * @return the enableRateLimiting value. + */ + public Boolean enableRateLimiting() { + return this.enableRateLimiting; + } + + /** + * Set the enableRateLimiting property: EnableBgp flag. + * + * @param enableRateLimiting the enableRateLimiting value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withEnableRateLimiting(Boolean enableRateLimiting) { + this.enableRateLimiting = enableRateLimiting; + return this; + } + + /** + * Get the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value. + */ + public Boolean useLocalAzureIpAddress() { + return this.useLocalAzureIpAddress; + } + + /** + * Set the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @param useLocalAzureIpAddress the useLocalAzureIpAddress value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress) { + this.useLocalAzureIpAddress = useLocalAzureIpAddress; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN site link connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ingressNatRules property: List of ingress NatRules. + * + * @return the ingressNatRules value. + */ + public List ingressNatRules() { + return this.ingressNatRules; + } + + /** + * Set the ingressNatRules property: List of ingress NatRules. + * + * @param ingressNatRules the ingressNatRules value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withIngressNatRules(List ingressNatRules) { + this.ingressNatRules = ingressNatRules; + return this; + } + + /** + * Get the egressNatRules property: List of egress NatRules. + * + * @return the egressNatRules value. + */ + public List egressNatRules() { + return this.egressNatRules; + } + + /** + * Set the egressNatRules property: List of egress NatRules. + * + * @param egressNatRules the egressNatRules value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withEgressNatRules(List egressNatRules) { + this.egressNatRules = egressNatRules; + return this; + } + + /** {@inheritDoc} */ + @Override + public VpnSiteLinkConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipsecPolicies() != null) { + ipsecPolicies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkInner.java new file mode 100644 index 0000000000000..d24f3ee74a4ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkInner.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VpnSiteLink Resource. */ +@JsonFlatten +@Fluent +public class VpnSiteLinkInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinkInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The link provider properties. + */ + @JsonProperty(value = "properties.linkProperties") + private VpnLinkProviderProperties linkProperties; + + /* + * The ip-address for the vpn-site-link. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /* + * FQDN of vpn-site-link. + */ + @JsonProperty(value = "properties.fqdn") + private String fqdn; + + /* + * The set of bgp properties. + */ + @JsonProperty(value = "properties.bgpProperties") + private VpnLinkBgpSettings bgpProperties; + + /* + * The provisioning state of the VPN site link resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VpnSiteLinkInner object itself. + */ + public VpnSiteLinkInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the linkProperties property: The link provider properties. + * + * @return the linkProperties value. + */ + public VpnLinkProviderProperties linkProperties() { + return this.linkProperties; + } + + /** + * Set the linkProperties property: The link provider properties. + * + * @param linkProperties the linkProperties value to set. + * @return the VpnSiteLinkInner object itself. + */ + public VpnSiteLinkInner withLinkProperties(VpnLinkProviderProperties linkProperties) { + this.linkProperties = linkProperties; + return this; + } + + /** + * Get the ipAddress property: The ip-address for the vpn-site-link. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The ip-address for the vpn-site-link. + * + * @param ipAddress the ipAddress value to set. + * @return the VpnSiteLinkInner object itself. + */ + public VpnSiteLinkInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the fqdn property: FQDN of vpn-site-link. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: FQDN of vpn-site-link. + * + * @param fqdn the fqdn value to set. + * @return the VpnSiteLinkInner object itself. + */ + public VpnSiteLinkInner withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the bgpProperties property: The set of bgp properties. + * + * @return the bgpProperties value. + */ + public VpnLinkBgpSettings bgpProperties() { + return this.bgpProperties; + } + + /** + * Set the bgpProperties property: The set of bgp properties. + * + * @param bgpProperties the bgpProperties value to set. + * @return the VpnSiteLinkInner object itself. + */ + public VpnSiteLinkInner withBgpProperties(VpnLinkBgpSettings bgpProperties) { + this.bgpProperties = bgpProperties; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN site link resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public VpnSiteLinkInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linkProperties() != null) { + linkProperties().validate(); + } + if (bgpProperties() != null) { + bgpProperties().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyInner.java new file mode 100644 index 0000000000000..81d90fcf58458 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyInner.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyResourceState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Defines web application firewall policy. */ +@JsonFlatten +@Fluent +public class WebApplicationFirewallPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPolicyInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The PolicySettings for policy. + */ + @JsonProperty(value = "properties.policySettings") + private PolicySettings policySettings; + + /* + * The custom rules inside the policy. + */ + @JsonProperty(value = "properties.customRules") + private List customRules; + + /* + * A collection of references to application gateways. + */ + @JsonProperty(value = "properties.applicationGateways", access = JsonProperty.Access.WRITE_ONLY) + private List applicationGateways; + + /* + * The provisioning state of the web application firewall policy resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource status of the policy. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private WebApplicationFirewallPolicyResourceState resourceState; + + /* + * Describes the managedRules structure. + */ + @JsonProperty(value = "properties.managedRules") + private ManagedRulesDefinition managedRules; + + /* + * A collection of references to application gateway http listeners. + */ + @JsonProperty(value = "properties.httpListeners", access = JsonProperty.Access.WRITE_ONLY) + private List httpListeners; + + /* + * A collection of references to application gateway path rules. + */ + @JsonProperty(value = "properties.pathBasedRules", access = JsonProperty.Access.WRITE_ONLY) + private List pathBasedRules; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the policySettings property: The PolicySettings for policy. + * + * @return the policySettings value. + */ + public PolicySettings policySettings() { + return this.policySettings; + } + + /** + * Set the policySettings property: The PolicySettings for policy. + * + * @param policySettings the policySettings value to set. + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withPolicySettings(PolicySettings policySettings) { + this.policySettings = policySettings; + return this; + } + + /** + * Get the customRules property: The custom rules inside the policy. + * + * @return the customRules value. + */ + public List customRules() { + return this.customRules; + } + + /** + * Set the customRules property: The custom rules inside the policy. + * + * @param customRules the customRules value to set. + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withCustomRules(List customRules) { + this.customRules = customRules; + return this; + } + + /** + * Get the applicationGateways property: A collection of references to application gateways. + * + * @return the applicationGateways value. + */ + public List applicationGateways() { + return this.applicationGateways; + } + + /** + * Get the provisioningState property: The provisioning state of the web application firewall policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + public WebApplicationFirewallPolicyResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the managedRules property: Describes the managedRules structure. + * + * @return the managedRules value. + */ + public ManagedRulesDefinition managedRules() { + return this.managedRules; + } + + /** + * Set the managedRules property: Describes the managedRules structure. + * + * @param managedRules the managedRules value to set. + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withManagedRules(ManagedRulesDefinition managedRules) { + this.managedRules = managedRules; + return this; + } + + /** + * Get the httpListeners property: A collection of references to application gateway http listeners. + * + * @return the httpListeners value. + */ + public List httpListeners() { + return this.httpListeners; + } + + /** + * Get the pathBasedRules property: A collection of references to application gateway path rules. + * + * @return the pathBasedRules value. + */ + public List pathBasedRules() { + return this.pathBasedRules; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public WebApplicationFirewallPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WebApplicationFirewallPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policySettings() != null) { + policySettings().validate(); + } + if (customRules() != null) { + customRules().forEach(e -> e.validate()); + } + if (applicationGateways() != null) { + applicationGateways().forEach(e -> e.validate()); + } + if (managedRules() != null) { + managedRules().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..00c2078cc0bd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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 NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.fluent.models; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java new file mode 100644 index 0000000000000..441007dd96a3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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 NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.fluent; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableSslOptionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableSslOptionsImpl.java new file mode 100644 index 0000000000000..8917692fe802b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableSslOptionsImpl.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableSslOptions; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyName; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ApplicationGatewayAvailableSslOptionsImpl implements ApplicationGatewayAvailableSslOptions { + private ApplicationGatewayAvailableSslOptionsInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayAvailableSslOptionsImpl( + ApplicationGatewayAvailableSslOptionsInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 List predefinedPolicies() { + List inner = this.innerModel().predefinedPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.innerModel().defaultPolicy(); + } + + public List availableCipherSuites() { + List inner = this.innerModel().availableCipherSuites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List availableProtocols() { + List inner = this.innerModel().availableProtocols(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public ApplicationGatewayAvailableSslOptionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java new file mode 100644 index 0000000000000..7ccfa21572cee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableWafRuleSetsResult; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRuleSet; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewayAvailableWafRuleSetsResultImpl + implements ApplicationGatewayAvailableWafRuleSetsResult { + private ApplicationGatewayAvailableWafRuleSetsResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayAvailableWafRuleSetsResultImpl( + ApplicationGatewayAvailableWafRuleSetsResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayAvailableWafRuleSetsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthImpl.java new file mode 100644 index 0000000000000..e4779cdefe8e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealth; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthPool; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewayBackendHealthImpl implements ApplicationGatewayBackendHealth { + private ApplicationGatewayBackendHealthInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayBackendHealthImpl( + ApplicationGatewayBackendHealthInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List backendAddressPools() { + List inner = this.innerModel().backendAddressPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayBackendHealthInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java new file mode 100644 index 0000000000000..c06d88bf7a63c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthHttpSettings; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthOnDemand; + +public final class ApplicationGatewayBackendHealthOnDemandImpl implements ApplicationGatewayBackendHealthOnDemand { + private ApplicationGatewayBackendHealthOnDemandInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayBackendHealthOnDemandImpl( + ApplicationGatewayBackendHealthOnDemandInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.innerModel().backendAddressPool(); + } + + public ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings() { + return this.innerModel().backendHealthHttpSettings(); + } + + public ApplicationGatewayBackendHealthOnDemandInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthServerImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthServerImpl.java new file mode 100644 index 0000000000000..14d7cb4b0411b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthServerImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthServer; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthServerHealth; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; + +public final class ApplicationGatewayBackendHealthServerImpl implements ApplicationGatewayBackendHealthServer { + private ApplicationGatewayBackendHealthServerInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayBackendHealthServerImpl( + ApplicationGatewayBackendHealthServerInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String address() { + return this.innerModel().address(); + } + + public NetworkInterfaceIpConfiguration ipConfiguration() { + NetworkInterfaceIpConfigurationInner inner = this.innerModel().ipConfiguration(); + if (inner != null) { + return new NetworkInterfaceIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealthServerHealth health() { + return this.innerModel().health(); + } + + public String healthProbeLog() { + return this.innerModel().healthProbeLog(); + } + + public ApplicationGatewayBackendHealthServerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayImpl.java new file mode 100644 index 0000000000000..e2f3168a7ed35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayImpl.java @@ -0,0 +1,647 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGateway; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAuthenticationCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAutoscaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealth; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthOnDemand; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHttpSettings; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCustomError; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendPort; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOperationalState; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProbe; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRedirectConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRule; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleSet; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySku; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProfile; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedClientCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedRootCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayUrlPathMap; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ApplicationGatewayImpl + implements ApplicationGateway, ApplicationGateway.Definition, ApplicationGateway.Update { + private ApplicationGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public ApplicationGatewaySku sku() { + return this.innerModel().sku(); + } + + public ApplicationGatewaySslPolicy sslPolicy() { + return this.innerModel().sslPolicy(); + } + + public ApplicationGatewayOperationalState operationalState() { + return this.innerModel().operationalState(); + } + + public List gatewayIpConfigurations() { + List inner = this.innerModel().gatewayIpConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List authenticationCertificates() { + List inner = this.innerModel().authenticationCertificates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List trustedRootCertificates() { + List inner = this.innerModel().trustedRootCertificates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List trustedClientCertificates() { + List inner = this.innerModel().trustedClientCertificates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List sslCertificates() { + List inner = this.innerModel().sslCertificates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List frontendIpConfigurations() { + List inner = this.innerModel().frontendIpConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List frontendPorts() { + List inner = this.innerModel().frontendPorts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List probes() { + List inner = this.innerModel().probes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List backendAddressPools() { + List inner = this.innerModel().backendAddressPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List backendHttpSettingsCollection() { + List inner = this.innerModel().backendHttpSettingsCollection(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List httpListeners() { + List inner = this.innerModel().httpListeners(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List sslProfiles() { + List inner = this.innerModel().sslProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List urlPathMaps() { + List inner = this.innerModel().urlPathMaps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requestRoutingRules() { + List inner = this.innerModel().requestRoutingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List rewriteRuleSets() { + List inner = this.innerModel().rewriteRuleSets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List redirectConfigurations() { + List inner = this.innerModel().redirectConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.innerModel().webApplicationFirewallConfiguration(); + } + + public SubResource firewallPolicy() { + return this.innerModel().firewallPolicy(); + } + + public Boolean enableHttp2() { + return this.innerModel().enableHttp2(); + } + + public Boolean enableFips() { + return this.innerModel().enableFips(); + } + + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.innerModel().autoscaleConfiguration(); + } + + public List privateLinkConfigurations() { + List inner = this.innerModel().privateLinkConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationGatewayPrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List customErrorConfigurations() { + List inner = this.innerModel().customErrorConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean forceFirewallPolicyAssociation() { + return this.innerModel().forceFirewallPolicyAssociation(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ApplicationGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String applicationGatewayName; + + private TagsObject updateParameters; + + public ApplicationGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ApplicationGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .createOrUpdate(resourceGroupName, applicationGatewayName, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .createOrUpdate(resourceGroupName, applicationGatewayName, this.innerModel(), context); + return this; + } + + ApplicationGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ApplicationGatewayInner(); + this.serviceManager = serviceManager; + this.applicationGatewayName = name; + } + + public ApplicationGatewayImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ApplicationGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .updateTagsWithResponse(resourceGroupName, applicationGatewayName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ApplicationGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .updateTagsWithResponse(resourceGroupName, applicationGatewayName, updateParameters, context) + .getValue(); + return this; + } + + ApplicationGatewayImpl( + ApplicationGatewayInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationGatewayName = Utils.getValueFromIdByName(innerObject.id(), "applicationGateways"); + } + + public ApplicationGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.applicationGateways().start(resourceGroupName, applicationGatewayName); + } + + public void start(Context context) { + serviceManager.applicationGateways().start(resourceGroupName, applicationGatewayName, context); + } + + public void stop() { + serviceManager.applicationGateways().stop(resourceGroupName, applicationGatewayName); + } + + public void stop(Context context) { + serviceManager.applicationGateways().stop(resourceGroupName, applicationGatewayName, context); + } + + public ApplicationGatewayBackendHealth backendHealth(String expand) { + return serviceManager.applicationGateways().backendHealth(resourceGroupName, applicationGatewayName, expand); + } + + public ApplicationGatewayBackendHealth backendHealth() { + return serviceManager.applicationGateways().backendHealth(resourceGroupName, applicationGatewayName); + } + + public ApplicationGatewayBackendHealth backendHealth(String expand, Context context) { + return serviceManager + .applicationGateways() + .backendHealth(resourceGroupName, applicationGatewayName, expand, context); + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + ApplicationGatewayOnDemandProbe probeRequest, String expand) { + return serviceManager + .applicationGateways() + .backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, expand); + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand(ApplicationGatewayOnDemandProbe probeRequest) { + return serviceManager + .applicationGateways() + .backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest); + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context) { + return serviceManager + .applicationGateways() + .backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, expand, context); + } + + public ApplicationGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ApplicationGatewayImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public ApplicationGatewayImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ApplicationGatewayImpl withSku(ApplicationGatewaySku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ApplicationGatewayImpl withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.innerModel().withSslPolicy(sslPolicy); + return this; + } + + public ApplicationGatewayImpl withGatewayIpConfigurations( + List gatewayIpConfigurations) { + this.innerModel().withGatewayIpConfigurations(gatewayIpConfigurations); + return this; + } + + public ApplicationGatewayImpl withAuthenticationCertificates( + List authenticationCertificates) { + this.innerModel().withAuthenticationCertificates(authenticationCertificates); + return this; + } + + public ApplicationGatewayImpl withTrustedRootCertificates( + List trustedRootCertificates) { + this.innerModel().withTrustedRootCertificates(trustedRootCertificates); + return this; + } + + public ApplicationGatewayImpl withTrustedClientCertificates( + List trustedClientCertificates) { + this.innerModel().withTrustedClientCertificates(trustedClientCertificates); + return this; + } + + public ApplicationGatewayImpl withSslCertificates(List sslCertificates) { + this.innerModel().withSslCertificates(sslCertificates); + return this; + } + + public ApplicationGatewayImpl withFrontendIpConfigurations( + List frontendIpConfigurations) { + this.innerModel().withFrontendIpConfigurations(frontendIpConfigurations); + return this; + } + + public ApplicationGatewayImpl withFrontendPorts(List frontendPorts) { + this.innerModel().withFrontendPorts(frontendPorts); + return this; + } + + public ApplicationGatewayImpl withProbes(List probes) { + this.innerModel().withProbes(probes); + return this; + } + + public ApplicationGatewayImpl withBackendAddressPools( + List backendAddressPools) { + this.innerModel().withBackendAddressPools(backendAddressPools); + return this; + } + + public ApplicationGatewayImpl withBackendHttpSettingsCollection( + List backendHttpSettingsCollection) { + this.innerModel().withBackendHttpSettingsCollection(backendHttpSettingsCollection); + return this; + } + + public ApplicationGatewayImpl withHttpListeners(List httpListeners) { + this.innerModel().withHttpListeners(httpListeners); + return this; + } + + public ApplicationGatewayImpl withSslProfiles(List sslProfiles) { + this.innerModel().withSslProfiles(sslProfiles); + return this; + } + + public ApplicationGatewayImpl withUrlPathMaps(List urlPathMaps) { + this.innerModel().withUrlPathMaps(urlPathMaps); + return this; + } + + public ApplicationGatewayImpl withRequestRoutingRules( + List requestRoutingRules) { + this.innerModel().withRequestRoutingRules(requestRoutingRules); + return this; + } + + public ApplicationGatewayImpl withRewriteRuleSets(List rewriteRuleSets) { + this.innerModel().withRewriteRuleSets(rewriteRuleSets); + return this; + } + + public ApplicationGatewayImpl withRedirectConfigurations( + List redirectConfigurations) { + this.innerModel().withRedirectConfigurations(redirectConfigurations); + return this; + } + + public ApplicationGatewayImpl withWebApplicationFirewallConfiguration( + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.innerModel().withWebApplicationFirewallConfiguration(webApplicationFirewallConfiguration); + return this; + } + + public ApplicationGatewayImpl withFirewallPolicy(SubResource firewallPolicy) { + this.innerModel().withFirewallPolicy(firewallPolicy); + return this; + } + + public ApplicationGatewayImpl withEnableHttp2(Boolean enableHttp2) { + this.innerModel().withEnableHttp2(enableHttp2); + return this; + } + + public ApplicationGatewayImpl withEnableFips(Boolean enableFips) { + this.innerModel().withEnableFips(enableFips); + return this; + } + + public ApplicationGatewayImpl withAutoscaleConfiguration( + ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.innerModel().withAutoscaleConfiguration(autoscaleConfiguration); + return this; + } + + public ApplicationGatewayImpl withPrivateLinkConfigurations( + List privateLinkConfigurations) { + this.innerModel().withPrivateLinkConfigurations(privateLinkConfigurations); + return this; + } + + public ApplicationGatewayImpl withCustomErrorConfigurations( + List customErrorConfigurations) { + this.innerModel().withCustomErrorConfigurations(customErrorConfigurations); + return this; + } + + public ApplicationGatewayImpl withForceFirewallPolicyAssociation(Boolean forceFirewallPolicyAssociation) { + this.innerModel().withForceFirewallPolicyAssociation(forceFirewallPolicyAssociation); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..ba93047e686c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ApplicationGatewayPrivateEndpointConnectionImpl + implements ApplicationGatewayPrivateEndpointConnection { + private ApplicationGatewayPrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayPrivateEndpointConnectionImpl( + ApplicationGatewayPrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpoint privateEndpoint() { + PrivateEndpointInner inner = this.innerModel().privateEndpoint(); + if (inner != null) { + return new PrivateEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String linkIdentifier() { + return this.innerModel().linkIdentifier(); + } + + public ApplicationGatewayPrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..bb63ae9096cd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ApplicationGatewayPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnectionListResult; +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 + * ApplicationGatewayPrivateEndpointConnectionsClient. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsClientImpl + implements ApplicationGatewayPrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationGatewayPrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewayPrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationGatewayPrivateEndpointConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ApplicationGatewayPrivateEndpointConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationGatewayPrivateEndpointConnections + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ApplicationGatewayPrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApplicationGatewayPrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, String connectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, String connectionName) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName, connectionName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, String connectionName) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName, connectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName, connectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 applicationGatewayName, String connectionName) { + deleteAsync(resourceGroupName, applicationGatewayName, connectionName).block(); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 applicationGatewayName, String connectionName, Context context) { + deleteAsync(resourceGroupName, applicationGatewayName, connectionName, context).block(); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdateAsync( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName, parameters); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayPrivateEndpointConnectionInner.class, + ApplicationGatewayPrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdateAsync( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayPrivateEndpointConnectionInner.class, + ApplicationGatewayPrivateEndpointConnectionInner.class, + context); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + return beginUpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters).getSyncPoller(); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + return beginUpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayPrivateEndpointConnectionInner update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + return updateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters).block(); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayPrivateEndpointConnectionInner update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context) { + return updateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, context).block(); + } + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String applicationGatewayName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String applicationGatewayName, String connectionName) { + return getWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayPrivateEndpointConnectionInner get( + String resourceGroupName, String applicationGatewayName, String connectionName) { + return getAsync(resourceGroupName, applicationGatewayName, connectionName).block(); + } + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName, context).block(); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String applicationGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationGatewayName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGatewayName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGatewayName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationGatewayName) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationGatewayName)); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationGatewayName, 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 response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @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 response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..28887d77c84ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsImpl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ApplicationGatewayPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationGatewayPrivateEndpointConnectionsImpl + implements ApplicationGatewayPrivateEndpointConnections { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateEndpointConnectionsImpl.class); + + private final ApplicationGatewayPrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationGatewayPrivateEndpointConnectionsImpl( + ApplicationGatewayPrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String applicationGatewayName, String connectionName) { + this.serviceClient().delete(resourceGroupName, applicationGatewayName, connectionName); + } + + public void delete( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, applicationGatewayName, connectionName, context); + } + + public ApplicationGatewayPrivateEndpointConnection update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + ApplicationGatewayPrivateEndpointConnectionInner inner = + this.serviceClient().update(resourceGroupName, applicationGatewayName, connectionName, parameters); + if (inner != null) { + return new ApplicationGatewayPrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayPrivateEndpointConnection update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context) { + ApplicationGatewayPrivateEndpointConnectionInner inner = + this.serviceClient().update(resourceGroupName, applicationGatewayName, connectionName, parameters, context); + if (inner != null) { + return new ApplicationGatewayPrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayPrivateEndpointConnection get( + String resourceGroupName, String applicationGatewayName, String connectionName) { + ApplicationGatewayPrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, applicationGatewayName, connectionName); + if (inner != null) { + return new ApplicationGatewayPrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, applicationGatewayName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewayPrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName); + return Utils + .mapPage(inner, inner1 -> new ApplicationGatewayPrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName, context); + return Utils + .mapPage(inner, inner1 -> new ApplicationGatewayPrivateEndpointConnectionImpl(inner1, this.manager())); + } + + private ApplicationGatewayPrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..e1c4e71149df5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewayPrivateLinkResourceImpl implements ApplicationGatewayPrivateLinkResource { + private ApplicationGatewayPrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayPrivateLinkResourceImpl( + ApplicationGatewayPrivateLinkResourceInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayPrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..38c48679da86b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ApplicationGatewayPrivateLinkResourcesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayPrivateLinkResourcesClient. + */ +public final class ApplicationGatewayPrivateLinkResourcesClientImpl + implements ApplicationGatewayPrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationGatewayPrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewayPrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationGatewayPrivateLinkResourcesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ApplicationGatewayPrivateLinkResourcesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationGatewayPrivateLinkResources to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ApplicationGatewayPrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String applicationGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationGatewayName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGatewayName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGatewayName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationGatewayName) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationGatewayName)); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationGatewayName, 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 response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @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 response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..eba00c968004d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ApplicationGatewayPrivateLinkResourcesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationGatewayPrivateLinkResourcesImpl implements ApplicationGatewayPrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkResourcesImpl.class); + + private final ApplicationGatewayPrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationGatewayPrivateLinkResourcesImpl( + ApplicationGatewayPrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayPrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayPrivateLinkResourceImpl(inner1, this.manager())); + } + + private ApplicationGatewayPrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java new file mode 100644 index 0000000000000..a68017909ed0e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPredefinedPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewaySslPredefinedPolicyImpl implements ApplicationGatewaySslPredefinedPolicy { + private ApplicationGatewaySslPredefinedPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewaySslPredefinedPolicyImpl( + ApplicationGatewaySslPredefinedPolicyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public List cipherSuites() { + List inner = this.innerModel().cipherSuites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.innerModel().minProtocolVersion(); + } + + public ApplicationGatewaySslPredefinedPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysClientImpl.java new file mode 100644 index 0000000000000..e7aecd8f401f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysClientImpl.java @@ -0,0 +1,3705 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ApplicationGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableSslPredefinedPolicies; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayListResult; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApplicationGatewaysClient. */ +public final class ApplicationGatewaysClientImpl implements ApplicationGatewaysClient { + private final ClientLogger logger = new ClientLogger(ApplicationGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ApplicationGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationGateways to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ApplicationGatewaysService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApplicationGatewayInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/backendhealth") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> backendHealth( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> backendHealthOnDemand( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @BodyParam("application/json") ApplicationGatewayOnDemandProbe probeRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> listAvailableServerVariables( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> listAvailableRequestHeaders( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> listAvailableResponseHeaders( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableWafRuleSets( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableSslOptions( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default" + + "/predefinedPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableSslPredefinedPolicies( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default" + + "/predefinedPolicies/{predefinedPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSslPredefinedPolicy( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("predefinedPolicyName") String predefinedPolicyName, + @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> listAllNext( + @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> listAvailableSslPredefinedPoliciesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, applicationGatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, applicationGatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 applicationGatewayName) { + deleteAsync(resourceGroupName, applicationGatewayName).block(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 applicationGatewayName, Context context) { + deleteAsync(resourceGroupName, applicationGatewayName, context).block(); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGatewayName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupAsync(resourceGroupName, applicationGatewayName).block(); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGatewayName, context).block(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, applicationGatewayName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayInner.class, + ApplicationGatewayInner.class, + Context.NONE); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, applicationGatewayName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayInner.class, + ApplicationGatewayInner.class, + context); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayInner createOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).block(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayInner createOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context).block(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String applicationGatewayName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String applicationGatewayName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, applicationGatewayName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayInner updateTags( + String resourceGroupName, String applicationGatewayName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, applicationGatewayName, parameters).block(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, applicationGatewayName, parameters, context).block(); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the application gateways 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 all the application gateways in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the application gateways 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 all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the application gateways 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 all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> startWithResponseAsync( + String resourceGroupName, String applicationGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> startWithResponseAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStartAsync( + String resourceGroupName, String applicationGatewayName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, applicationGatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStartAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, applicationGatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStart(String resourceGroupName, String applicationGatewayName) { + return beginStartAsync(resourceGroupName, applicationGatewayName).getSyncPoller(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStart( + String resourceGroupName, String applicationGatewayName, Context context) { + return beginStartAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync(String resourceGroupName, String applicationGatewayName) { + return beginStartAsync(resourceGroupName, applicationGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync(String resourceGroupName, String applicationGatewayName, Context context) { + return beginStartAsync(resourceGroupName, applicationGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 start(String resourceGroupName, String applicationGatewayName) { + startAsync(resourceGroupName, applicationGatewayName).block(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 start(String resourceGroupName, String applicationGatewayName, Context context) { + startAsync(resourceGroupName, applicationGatewayName, context).block(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> stopWithResponseAsync( + String resourceGroupName, String applicationGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> stopWithResponseAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStopAsync(String resourceGroupName, String applicationGatewayName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, applicationGatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStopAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, applicationGatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStop(String resourceGroupName, String applicationGatewayName) { + return beginStopAsync(resourceGroupName, applicationGatewayName).getSyncPoller(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStop( + String resourceGroupName, String applicationGatewayName, Context context) { + return beginStopAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 stopAsync(String resourceGroupName, String applicationGatewayName) { + return beginStopAsync(resourceGroupName, applicationGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 stopAsync(String resourceGroupName, String applicationGatewayName, Context context) { + return beginStopAsync(resourceGroupName, applicationGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 stop(String resourceGroupName, String applicationGatewayName) { + stopAsync(resourceGroupName, applicationGatewayName).block(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 stop(String resourceGroupName, String applicationGatewayName, Context context) { + stopAsync(resourceGroupName, applicationGatewayName, context).block(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backendHealthWithResponseAsync( + String resourceGroupName, String applicationGatewayName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .backendHealth( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backendHealthWithResponseAsync( + String resourceGroupName, String applicationGatewayName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .backendHealth( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationGatewayBackendHealthInner> + beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { + Mono>> mono = + backendHealthWithResponseAsync(resourceGroupName, applicationGatewayName, expand); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayBackendHealthInner.class, + ApplicationGatewayBackendHealthInner.class, + Context.NONE); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationGatewayBackendHealthInner> + beginBackendHealthAsync( + String resourceGroupName, String applicationGatewayName, String expand, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + backendHealthWithResponseAsync(resourceGroupName, applicationGatewayName, expand, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayBackendHealthInner.class, + ApplicationGatewayBackendHealthInner.class, + context); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand).getSyncPoller(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand, Context context) { + return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand, context).getSyncPoller(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backendHealthAsync( + String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backendHealthAsync( + String resourceGroupName, String applicationGatewayName) { + final String expand = null; + return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backendHealthAsync( + String resourceGroupName, String applicationGatewayName, String expand, Context context) { + return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthInner backendHealth( + String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthAsync(resourceGroupName, applicationGatewayName, expand).block(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName) { + final String expand = null; + return backendHealthAsync(resourceGroupName, applicationGatewayName, expand).block(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthInner backendHealth( + String resourceGroupName, String applicationGatewayName, String expand, Context context) { + return backendHealthAsync(resourceGroupName, applicationGatewayName, expand, context).block(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backendHealthOnDemandWithResponseAsync( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (probeRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter probeRequest is required and cannot be null.")); + } else { + probeRequest.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .backendHealthOnDemand( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + expand, + probeRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backendHealthOnDemandWithResponseAsync( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (probeRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter probeRequest is required and cannot be null.")); + } else { + probeRequest.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .backendHealthOnDemand( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + expand, + probeRequest, + accept, + context); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemandAsync( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + Mono>> mono = + backendHealthOnDemandWithResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayBackendHealthOnDemandInner.class, + ApplicationGatewayBackendHealthOnDemandInner.class, + Context.NONE); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemandAsync( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + backendHealthOnDemandWithResponseAsync( + resourceGroupName, applicationGatewayName, probeRequest, expand, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayBackendHealthOnDemandInner.class, + ApplicationGatewayBackendHealthOnDemandInner.class, + context); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand) + .getSyncPoller(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, context) + .getSyncPoller(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backendHealthOnDemandAsync( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backendHealthOnDemandAsync( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + final String expand = null; + return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backendHealthOnDemandAsync( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + return backendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).block(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + final String expand = null; + return backendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).block(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + return backendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, context) + .block(); + } + + /** + * Lists all available server variables. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableServerVariablesWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableServerVariables( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available server variables. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableServerVariablesWithResponseAsync(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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableServerVariables( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Lists all available server variables. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableServerVariablesAsync() { + return listAvailableServerVariablesWithResponseAsync() + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all available server variables. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listAvailableServerVariables() { + return listAvailableServerVariablesAsync().block(); + } + + /** + * Lists all available server variables. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listAvailableServerVariablesWithResponse(Context context) { + return listAvailableServerVariablesWithResponseAsync(context).block(); + } + + /** + * Lists all available request headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableRequestHeadersWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableRequestHeaders( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available request headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableRequestHeadersWithResponseAsync(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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableRequestHeaders( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Lists all available request headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableRequestHeadersAsync() { + return listAvailableRequestHeadersWithResponseAsync() + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all available request headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listAvailableRequestHeaders() { + return listAvailableRequestHeadersAsync().block(); + } + + /** + * Lists all available request headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listAvailableRequestHeadersWithResponse(Context context) { + return listAvailableRequestHeadersWithResponseAsync(context).block(); + } + + /** + * Lists all available response headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableResponseHeadersWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableResponseHeaders( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available response headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableResponseHeadersWithResponseAsync(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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableResponseHeaders( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Lists all available response headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableResponseHeadersAsync() { + return listAvailableResponseHeadersWithResponseAsync() + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all available response headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listAvailableResponseHeaders() { + return listAvailableResponseHeadersAsync().block(); + } + + /** + * Lists all available response headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listAvailableResponseHeadersWithResponse(Context context) { + return listAvailableResponseHeadersWithResponseAsync(context).block(); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAvailableWafRuleSetsWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableWafRuleSets( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available web application firewall rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableWafRuleSetsWithResponseAsync( + 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableWafRuleSets( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableWafRuleSetsAsync() { + return listAvailableWafRuleSetsWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets() { + return listAvailableWafRuleSetsAsync().block(); + } + + /** + * Lists all available web application firewall rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableWafRuleSetsWithResponse( + Context context) { + return listAvailableWafRuleSetsWithResponseAsync(context).block(); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableSslOptionsWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableSslOptions( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableSslOptionsWithResponseAsync( + 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableSslOptions( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableSslOptionsAsync() { + return listAvailableSslOptionsWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions() { + return listAvailableSslOptionsAsync().block(); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableSslOptionsWithResponse(Context context) { + return listAvailableSslOptionsWithResponseAsync(context).block(); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAvailableSslPredefinedPoliciesSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableSslPredefinedPolicies( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAvailableSslPredefinedPoliciesSinglePageAsync(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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableSslPredefinedPolicies( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSslPredefinedPoliciesAsync() { + return new PagedFlux<>( + () -> listAvailableSslPredefinedPoliciesSinglePageAsync(), + nextLink -> listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextLink)); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSslPredefinedPoliciesAsync( + Context context) { + return new PagedFlux<>( + () -> listAvailableSslPredefinedPoliciesSinglePageAsync(context), + nextLink -> listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSslPredefinedPolicies() { + return new PagedIterable<>(listAvailableSslPredefinedPoliciesAsync()); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSslPredefinedPolicies( + Context context) { + return new PagedIterable<>(listAvailableSslPredefinedPoliciesAsync(context)); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSslPredefinedPolicyWithResponseAsync( + String predefinedPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (predefinedPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSslPredefinedPolicy( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + predefinedPolicyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSslPredefinedPolicyWithResponseAsync( + String predefinedPolicyName, 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 (predefinedPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSslPredefinedPolicy( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + predefinedPolicyName, + accept, + context); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSslPredefinedPolicyAsync(String predefinedPolicyName) { + return getSslPredefinedPolicyWithResponseAsync(predefinedPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName) { + return getSslPredefinedPolicyAsync(predefinedPolicyName).block(); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSslPredefinedPolicyWithResponse( + String predefinedPolicyName, Context context) { + return getSslPredefinedPolicyWithResponseAsync(predefinedPolicyName, 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 response for ListApplicationGateways API service call. + */ + @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 response for ListApplicationGateways API service call. + */ + @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 response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAvailableSslPredefinedPoliciesNextSinglePageAsync(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 + .listAvailableSslPredefinedPoliciesNext(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 response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAvailableSslPredefinedPoliciesNextSinglePageAsync(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 + .listAvailableSslPredefinedPoliciesNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysImpl.java new file mode 100644 index 0000000000000..f835b4d4c636c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysImpl.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ApplicationGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGateway; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableSslOptions; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableWafRuleSetsResult; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealth; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthOnDemand; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPredefinedPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewaysImpl implements ApplicationGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaysImpl.class); + + private final ApplicationGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationGatewaysImpl( + ApplicationGatewaysClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String applicationGatewayName) { + this.serviceClient().delete(resourceGroupName, applicationGatewayName); + } + + public void delete(String resourceGroupName, String applicationGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, applicationGatewayName, context); + } + + public ApplicationGateway getByResourceGroup(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewayInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, applicationGatewayName); + if (inner != null) { + return new ApplicationGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationGatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public void start(String resourceGroupName, String applicationGatewayName) { + this.serviceClient().start(resourceGroupName, applicationGatewayName); + } + + public void start(String resourceGroupName, String applicationGatewayName, Context context) { + this.serviceClient().start(resourceGroupName, applicationGatewayName, context); + } + + public void stop(String resourceGroupName, String applicationGatewayName) { + this.serviceClient().stop(resourceGroupName, applicationGatewayName); + } + + public void stop(String resourceGroupName, String applicationGatewayName, Context context) { + this.serviceClient().stop(resourceGroupName, applicationGatewayName, context); + } + + public ApplicationGatewayBackendHealth backendHealth( + String resourceGroupName, String applicationGatewayName, String expand) { + ApplicationGatewayBackendHealthInner inner = + this.serviceClient().backendHealth(resourceGroupName, applicationGatewayName, expand); + if (inner != null) { + return new ApplicationGatewayBackendHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealth backendHealth(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewayBackendHealthInner inner = + this.serviceClient().backendHealth(resourceGroupName, applicationGatewayName); + if (inner != null) { + return new ApplicationGatewayBackendHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealth backendHealth( + String resourceGroupName, String applicationGatewayName, String expand, Context context) { + ApplicationGatewayBackendHealthInner inner = + this.serviceClient().backendHealth(resourceGroupName, applicationGatewayName, expand, context); + if (inner != null) { + return new ApplicationGatewayBackendHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + ApplicationGatewayBackendHealthOnDemandInner inner = + this.serviceClient().backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, expand); + if (inner != null) { + return new ApplicationGatewayBackendHealthOnDemandImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + ApplicationGatewayBackendHealthOnDemandInner inner = + this.serviceClient().backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest); + if (inner != null) { + return new ApplicationGatewayBackendHealthOnDemandImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + ApplicationGatewayBackendHealthOnDemandInner inner = + this + .serviceClient() + .backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, expand, context); + if (inner != null) { + return new ApplicationGatewayBackendHealthOnDemandImpl(inner, this.manager()); + } else { + return null; + } + } + + public List listAvailableServerVariables() { + List inner = this.serviceClient().listAvailableServerVariables(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Response> listAvailableServerVariablesWithResponse(Context context) { + return this.serviceClient().listAvailableServerVariablesWithResponse(context); + } + + public List listAvailableRequestHeaders() { + List inner = this.serviceClient().listAvailableRequestHeaders(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Response> listAvailableRequestHeadersWithResponse(Context context) { + return this.serviceClient().listAvailableRequestHeadersWithResponse(context); + } + + public List listAvailableResponseHeaders() { + List inner = this.serviceClient().listAvailableResponseHeaders(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Response> listAvailableResponseHeadersWithResponse(Context context) { + return this.serviceClient().listAvailableResponseHeadersWithResponse(context); + } + + public ApplicationGatewayAvailableWafRuleSetsResult listAvailableWafRuleSets() { + ApplicationGatewayAvailableWafRuleSetsResultInner inner = this.serviceClient().listAvailableWafRuleSets(); + if (inner != null) { + return new ApplicationGatewayAvailableWafRuleSetsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAvailableWafRuleSetsWithResponse( + Context context) { + Response inner = + this.serviceClient().listAvailableWafRuleSetsWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewayAvailableWafRuleSetsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationGatewayAvailableSslOptions listAvailableSslOptions() { + ApplicationGatewayAvailableSslOptionsInner inner = this.serviceClient().listAvailableSslOptions(); + if (inner != null) { + return new ApplicationGatewayAvailableSslOptionsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAvailableSslOptionsWithResponse(Context context) { + Response inner = + this.serviceClient().listAvailableSslOptionsWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewayAvailableSslOptionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listAvailableSslPredefinedPolicies() { + PagedIterable inner = + this.serviceClient().listAvailableSslPredefinedPolicies(); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewaySslPredefinedPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableSslPredefinedPolicies(Context context) { + PagedIterable inner = + this.serviceClient().listAvailableSslPredefinedPolicies(context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewaySslPredefinedPolicyImpl(inner1, this.manager())); + } + + public ApplicationGatewaySslPredefinedPolicy getSslPredefinedPolicy(String predefinedPolicyName) { + ApplicationGatewaySslPredefinedPolicyInner inner = + this.serviceClient().getSslPredefinedPolicy(predefinedPolicyName); + if (inner != null) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSslPredefinedPolicyWithResponse( + String predefinedPolicyName, Context context) { + Response inner = + this.serviceClient().getSslPredefinedPolicyWithResponse(predefinedPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewaySslPredefinedPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationGateway 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 applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, 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 applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, 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 applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + this.delete(resourceGroupName, applicationGatewayName, 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 applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + this.delete(resourceGroupName, applicationGatewayName, context); + } + + private ApplicationGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ApplicationGatewayImpl define(String name) { + return new ApplicationGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.java new file mode 100644 index 0000000000000..10867019f5958 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class ApplicationSecurityGroupImpl + implements ApplicationSecurityGroup, ApplicationSecurityGroup.Definition, ApplicationSecurityGroup.Update { + private ApplicationSecurityGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ApplicationSecurityGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String applicationSecurityGroupName; + + private TagsObject updateParameters; + + public ApplicationSecurityGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ApplicationSecurityGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationSecurityGroups() + .createOrUpdate(resourceGroupName, applicationSecurityGroupName, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationSecurityGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationSecurityGroups() + .createOrUpdate(resourceGroupName, applicationSecurityGroupName, this.innerModel(), context); + return this; + } + + ApplicationSecurityGroupImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ApplicationSecurityGroupInner(); + this.serviceManager = serviceManager; + this.applicationSecurityGroupName = name; + } + + public ApplicationSecurityGroupImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ApplicationSecurityGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationSecurityGroups() + .updateTagsWithResponse(resourceGroupName, applicationSecurityGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ApplicationSecurityGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationSecurityGroups() + .updateTagsWithResponse(resourceGroupName, applicationSecurityGroupName, updateParameters, context) + .getValue(); + return this; + } + + ApplicationSecurityGroupImpl( + ApplicationSecurityGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationSecurityGroupName = Utils.getValueFromIdByName(innerObject.id(), "applicationSecurityGroups"); + } + + public ApplicationSecurityGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationSecurityGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, context) + .getValue(); + return this; + } + + public ApplicationSecurityGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationSecurityGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationSecurityGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsClientImpl.java new file mode 100644 index 0000000000000..745d1aee11bb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsClientImpl.java @@ -0,0 +1,1497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ApplicationSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroupListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 ApplicationSecurityGroupsClient. */ +public final class ApplicationSecurityGroupsClientImpl implements ApplicationSecurityGroupsClient { + private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationSecurityGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationSecurityGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationSecurityGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ApplicationSecurityGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationSecurityGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ApplicationSecurityGroupsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups/{applicationSecurityGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups/{applicationSecurityGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups/{applicationSecurityGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApplicationSecurityGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups/{applicationSecurityGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String applicationSecurityGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + applicationSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String applicationSecurityGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + applicationSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String applicationSecurityGroupName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, applicationSecurityGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String applicationSecurityGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, applicationSecurityGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String applicationSecurityGroupName) { + return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName).getSyncPoller(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String applicationSecurityGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName, context).getSyncPoller(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String applicationSecurityGroupName) { + return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String applicationSecurityGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String applicationSecurityGroupName) { + deleteAsync(resourceGroupName, applicationSecurityGroupName).block(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String applicationSecurityGroupName, Context context) { + deleteAsync(resourceGroupName, applicationSecurityGroupName, context).block(); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 information about the specified application security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationSecurityGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + applicationSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 information about the specified application security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationSecurityGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + applicationSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 information about the specified application security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationSecurityGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 information about the specified application security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationSecurityGroupInner getByResourceGroup( + String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupAsync(resourceGroupName, applicationSecurityGroupName).block(); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 information about the specified application security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationSecurityGroupName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationSecurityGroupName, context).block(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationSecurityGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + applicationSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String applicationSecurityGroupName, + ApplicationSecurityGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationSecurityGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + applicationSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationSecurityGroupInner> + beginCreateOrUpdateAsync( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationSecurityGroupInner.class, + ApplicationSecurityGroupInner.class, + Context.NONE); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationSecurityGroupInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String applicationSecurityGroupName, + ApplicationSecurityGroupInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationSecurityGroupInner.class, + ApplicationSecurityGroupInner.class, + context); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String applicationSecurityGroupName, + ApplicationSecurityGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String applicationSecurityGroupName, + ApplicationSecurityGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationSecurityGroupInner createOrUpdate( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters).block(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationSecurityGroupInner createOrUpdate( + String resourceGroupName, + String applicationSecurityGroupName, + ApplicationSecurityGroupInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters, context).block(); + } + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationSecurityGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + applicationSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationSecurityGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + applicationSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationSecurityGroupInner updateTags( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters).block(); + } + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters, context) + .block(); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all application security groups 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 all application security groups in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all application security groups 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 all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all application security groups 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 all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 a list of application security groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 application security groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync( + 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 + .listAllNext(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 application security groups. + */ + @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 list of application security groups. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsImpl.java new file mode 100644 index 0000000000000..6c8b7ae708867 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsImpl.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.network.generated.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.network.generated.fluent.ApplicationSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationSecurityGroupsImpl implements ApplicationSecurityGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupsImpl.class); + + private final ApplicationSecurityGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationSecurityGroupsImpl( + ApplicationSecurityGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) { + this.serviceClient().delete(resourceGroupName, applicationSecurityGroupName); + } + + public void delete(String resourceGroupName, String applicationSecurityGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, applicationSecurityGroupName, context); + } + + public ApplicationSecurityGroup getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) { + ApplicationSecurityGroupInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, applicationSecurityGroupName); + if (inner != null) { + return new ApplicationSecurityGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationSecurityGroupName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationSecurityGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public ApplicationSecurityGroup 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 applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, 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 applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, 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 applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, applicationSecurityGroupName, 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 applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, applicationSecurityGroupName, context); + } + + private ApplicationSecurityGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ApplicationSecurityGroupImpl define(String name) { + return new ApplicationSecurityGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java new file mode 100644 index 0000000000000..fc9826a6caa60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.models.AutoApprovedPrivateLinkService; + +public final class AutoApprovedPrivateLinkServiceImpl implements AutoApprovedPrivateLinkService { + private AutoApprovedPrivateLinkServiceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AutoApprovedPrivateLinkServiceImpl( + AutoApprovedPrivateLinkServiceInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String privateLinkService() { + return this.innerModel().privateLinkService(); + } + + public AutoApprovedPrivateLinkServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.java new file mode 100644 index 0000000000000..7f88baceebc23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegation; +import java.util.Collections; +import java.util.List; + +public final class AvailableDelegationImpl implements AvailableDelegation { + private AvailableDelegationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailableDelegationImpl( + AvailableDelegationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String serviceName() { + return this.innerModel().serviceName(); + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AvailableDelegationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java new file mode 100644 index 0000000000000..d03153cee2a01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailableDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegationsResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableDelegationsClient. */ +public final class AvailableDelegationsClientImpl implements AvailableDelegationsClient { + private final ClientLogger logger = new ClientLogger(AvailableDelegationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailableDelegationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableDelegationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableDelegationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(AvailableDelegationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailableDelegations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailableDelegationsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, 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 an array of available delegations. + */ + @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 an array of available delegations. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsImpl.java new file mode 100644 index 0000000000000..1d6ee7433eb26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailableDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegation; +import com.azure.resourcemanager.network.generated.models.AvailableDelegations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailableDelegationsImpl implements AvailableDelegations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableDelegationsImpl.class); + + private final AvailableDelegationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailableDelegationsImpl( + AvailableDelegationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + private AvailableDelegationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java new file mode 100644 index 0000000000000..51e03c0c50a83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailableEndpointServicesClient; +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.azure.resourcemanager.network.generated.models.EndpointServicesListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableEndpointServicesClient. */ +public final class AvailableEndpointServicesClientImpl implements AvailableEndpointServicesClient { + private final ClientLogger logger = new ClientLogger(AvailableEndpointServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailableEndpointServicesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableEndpointServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableEndpointServicesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + AvailableEndpointServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailableEndpointServices to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailableEndpointServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/virtualNetworkAvailableEndpointServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, 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 response for the ListAvailableEndpointServices API service call. + */ + @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 response for the ListAvailableEndpointServices API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesImpl.java new file mode 100644 index 0000000000000..f35dcab9e3061 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailableEndpointServicesClient; +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.azure.resourcemanager.network.generated.models.AvailableEndpointServices; +import com.azure.resourcemanager.network.generated.models.EndpointServiceResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailableEndpointServicesImpl implements AvailableEndpointServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableEndpointServicesImpl.class); + + private final AvailableEndpointServicesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailableEndpointServicesImpl( + AvailableEndpointServicesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new EndpointServiceResultImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new EndpointServiceResultImpl(inner1, this.manager())); + } + + private AvailableEndpointServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.java new file mode 100644 index 0000000000000..7da37af37bcf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointType; + +public final class AvailablePrivateEndpointTypeImpl implements AvailablePrivateEndpointType { + private AvailablePrivateEndpointTypeInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailablePrivateEndpointTypeImpl( + AvailablePrivateEndpointTypeInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public AvailablePrivateEndpointTypeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java new file mode 100644 index 0000000000000..e8d23fd50cd29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java @@ -0,0 +1,599 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailablePrivateEndpointTypesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointTypesResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailablePrivateEndpointTypesClient. */ +public final class AvailablePrivateEndpointTypesClientImpl implements AvailablePrivateEndpointTypesClient { + private final ClientLogger logger = new ClientLogger(AvailablePrivateEndpointTypesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailablePrivateEndpointTypesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailablePrivateEndpointTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailablePrivateEndpointTypesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + AvailablePrivateEndpointTypesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailablePrivateEndpointTypes to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailablePrivateEndpointTypesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/availablePrivateEndpointTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" + + "/{location}/availablePrivateEndpointTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String location, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + location, + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + 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())); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String location, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + location, + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String location, String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(location, resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String location, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(location, resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String location, String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(location, resourceGroupName)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String location, String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(location, resourceGroupName, 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 an array of available PrivateEndpoint types. + */ + @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 an array of available PrivateEndpoint types. + */ + @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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesImpl.java new file mode 100644 index 0000000000000..ae9c725ffa838 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailablePrivateEndpointTypesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointType; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailablePrivateEndpointTypesImpl implements AvailablePrivateEndpointTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailablePrivateEndpointTypesImpl.class); + + private final AvailablePrivateEndpointTypesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailablePrivateEndpointTypesImpl( + AvailablePrivateEndpointTypesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String location, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(location, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String location, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(location, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + private AvailablePrivateEndpointTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java new file mode 100644 index 0000000000000..bb3134655e7e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersList; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListCountry; +import java.util.Collections; +import java.util.List; + +public final class AvailableProvidersListImpl implements AvailableProvidersList { + private AvailableProvidersListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailableProvidersListImpl( + AvailableProvidersListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List countries() { + List inner = this.innerModel().countries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AvailableProvidersListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.java new file mode 100644 index 0000000000000..c2c089679e66c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailableResourceGroupDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegationsResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AvailableResourceGroupDelegationsClient. + */ +public final class AvailableResourceGroupDelegationsClientImpl implements AvailableResourceGroupDelegationsClient { + private final ClientLogger logger = new ClientLogger(AvailableResourceGroupDelegationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailableResourceGroupDelegationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableResourceGroupDelegationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableResourceGroupDelegationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + AvailableResourceGroupDelegationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailableResourceGroupDelegations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailableResourceGroupDelegationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" + + "/{location}/availableDelegations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @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); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + location, + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String resourceGroupName) { + return new PagedIterable<>(listAsync(location, resourceGroupName)); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(location, resourceGroupName, 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 an array of available delegations. + */ + @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 an array of available delegations. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsImpl.java new file mode 100644 index 0000000000000..98e550ceb0de9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailableResourceGroupDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegation; +import com.azure.resourcemanager.network.generated.models.AvailableResourceGroupDelegations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailableResourceGroupDelegationsImpl implements AvailableResourceGroupDelegations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableResourceGroupDelegationsImpl.class); + + private final AvailableResourceGroupDelegationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailableResourceGroupDelegationsImpl( + AvailableResourceGroupDelegationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(location, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(location, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + private AvailableResourceGroupDelegationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.java new file mode 100644 index 0000000000000..914b36b5a4eff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAlias; + +public final class AvailableServiceAliasImpl implements AvailableServiceAlias { + private AvailableServiceAliasInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailableServiceAliasImpl( + AvailableServiceAliasInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public AvailableServiceAliasInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java new file mode 100644 index 0000000000000..1be3ee6389221 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java @@ -0,0 +1,589 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailableServiceAliasesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAliasesResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableServiceAliasesClient. */ +public final class AvailableServiceAliasesClientImpl implements AvailableServiceAliasesClient { + private final ClientLogger logger = new ClientLogger(AvailableServiceAliasesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailableServiceAliasesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableServiceAliasesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableServiceAliasesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(AvailableServiceAliasesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailableServiceAliases to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailableServiceAliasesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @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.Network/locations" + + "/{location}/availableServiceAliases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @PathParam("subscriptionId") String subscriptionId, + @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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + location, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + location, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String location) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, location), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String location, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, location, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String location) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, location)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String location, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, location, 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 an array of available service aliases. + */ + @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 an array of available service aliases. + */ + @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 an array of available service aliases. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 an array of available service aliases. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesImpl.java new file mode 100644 index 0000000000000..a60006d104ced --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AvailableServiceAliasesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAlias; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAliases; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailableServiceAliasesImpl implements AvailableServiceAliases { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceAliasesImpl.class); + + private final AvailableServiceAliasesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailableServiceAliasesImpl( + AvailableServiceAliasesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String location) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, location); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String location, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, location, context); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + private AvailableServiceAliasesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.java new file mode 100644 index 0000000000000..b3e4a9ec79965 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTag; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class AzureFirewallFqdnTagImpl implements AzureFirewallFqdnTag { + private AzureFirewallFqdnTagInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AzureFirewallFqdnTagImpl( + AzureFirewallFqdnTagInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String fqdnTagName() { + return this.innerModel().fqdnTagName(); + } + + public String id() { + return this.innerModel().id(); + } + + public AzureFirewallFqdnTagInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsClientImpl.java new file mode 100644 index 0000000000000..b2855b8a4df29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsClientImpl.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AzureFirewallFqdnTagsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTagListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AzureFirewallFqdnTagsClient. */ +public final class AzureFirewallFqdnTagsClientImpl implements AzureFirewallFqdnTagsClient { + private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AzureFirewallFqdnTagsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallFqdnTagsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureFirewallFqdnTagsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(AzureFirewallFqdnTagsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAzureFirewallFqdnTags to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AzureFirewallFqdnTagsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Azure Firewall FQDN Tags 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 all the Azure Firewall FQDN Tags in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Azure Firewall FQDN Tags 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 all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Azure Firewall FQDN Tags 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 all the Azure Firewall FQDN Tags in a subscription. + */ + @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 response for ListAzureFirewallFqdnTags API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListAzureFirewallFqdnTags API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync( + 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 + .listAllNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsImpl.java new file mode 100644 index 0000000000000..a2de75c127777 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AzureFirewallFqdnTagsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTag; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTags; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AzureFirewallFqdnTagsImpl implements AzureFirewallFqdnTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagsImpl.class); + + private final AzureFirewallFqdnTagsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AzureFirewallFqdnTagsImpl( + AzureFirewallFqdnTagsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AzureFirewallFqdnTagImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureFirewallFqdnTagImpl(inner1, this.manager())); + } + + private AzureFirewallFqdnTagsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.java new file mode 100644 index 0000000000000..a1d111ac90a14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewall; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpGroups; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class AzureFirewallImpl implements AzureFirewall, AzureFirewall.Definition, AzureFirewall.Update { + private AzureFirewallInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public List applicationRuleCollections() { + List inner = this.innerModel().applicationRuleCollections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List natRuleCollections() { + List inner = this.innerModel().natRuleCollections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List networkRuleCollections() { + List inner = this.innerModel().networkRuleCollections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AzureFirewallIpConfiguration managementIpConfiguration() { + return this.innerModel().managementIpConfiguration(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public AzureFirewallThreatIntelMode threatIntelMode() { + return this.innerModel().threatIntelMode(); + } + + public SubResource virtualHub() { + return this.innerModel().virtualHub(); + } + + public SubResource firewallPolicy() { + return this.innerModel().firewallPolicy(); + } + + public HubIpAddresses hubIpAddresses() { + return this.innerModel().hubIpAddresses(); + } + + public List ipGroups() { + List inner = this.innerModel().ipGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AzureFirewallSku sku() { + return this.innerModel().sku(); + } + + public Map additionalProperties() { + Map inner = this.innerModel().additionalProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public AzureFirewallInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String azureFirewallName; + + private TagsObject updateParameters; + + public AzureFirewallImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AzureFirewall create() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .createOrUpdate(resourceGroupName, azureFirewallName, this.innerModel(), Context.NONE); + return this; + } + + public AzureFirewall create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .createOrUpdate(resourceGroupName, azureFirewallName, this.innerModel(), context); + return this; + } + + AzureFirewallImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new AzureFirewallInner(); + this.serviceManager = serviceManager; + this.azureFirewallName = name; + } + + public AzureFirewallImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public AzureFirewall apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .updateTags(resourceGroupName, azureFirewallName, updateParameters, Context.NONE); + return this; + } + + public AzureFirewall apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .updateTags(resourceGroupName, azureFirewallName, updateParameters, context); + return this; + } + + AzureFirewallImpl( + AzureFirewallInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.azureFirewallName = Utils.getValueFromIdByName(innerObject.id(), "azureFirewalls"); + } + + public AzureFirewall refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, Context.NONE) + .getValue(); + return this; + } + + public AzureFirewall refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, context) + .getValue(); + return this; + } + + public AzureFirewallImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AzureFirewallImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AzureFirewallImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public AzureFirewallImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public AzureFirewallImpl withApplicationRuleCollections( + List applicationRuleCollections) { + this.innerModel().withApplicationRuleCollections(applicationRuleCollections); + return this; + } + + public AzureFirewallImpl withNatRuleCollections(List natRuleCollections) { + this.innerModel().withNatRuleCollections(natRuleCollections); + return this; + } + + public AzureFirewallImpl withNetworkRuleCollections( + List networkRuleCollections) { + this.innerModel().withNetworkRuleCollections(networkRuleCollections); + return this; + } + + public AzureFirewallImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public AzureFirewallImpl withManagementIpConfiguration(AzureFirewallIpConfiguration managementIpConfiguration) { + this.innerModel().withManagementIpConfiguration(managementIpConfiguration); + return this; + } + + public AzureFirewallImpl withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { + this.innerModel().withThreatIntelMode(threatIntelMode); + return this; + } + + public AzureFirewallImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public AzureFirewallImpl withFirewallPolicy(SubResource firewallPolicy) { + this.innerModel().withFirewallPolicy(firewallPolicy); + return this; + } + + public AzureFirewallImpl withHubIpAddresses(HubIpAddresses hubIpAddresses) { + this.innerModel().withHubIpAddresses(hubIpAddresses); + return this; + } + + public AzureFirewallImpl withSku(AzureFirewallSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public AzureFirewallImpl withAdditionalProperties(Map additionalProperties) { + this.innerModel().withAdditionalProperties(additionalProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsClientImpl.java new file mode 100644 index 0000000000000..317bc6533f332 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsClientImpl.java @@ -0,0 +1,1536 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AzureFirewallsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 AzureFirewallsClient. */ +public final class AzureFirewallsClientImpl implements AzureFirewallsClient { + private final ClientLogger logger = new ClientLogger(AzureFirewallsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AzureFirewallsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureFirewallsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(AzureFirewallsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAzureFirewalls to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AzureFirewallsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls/{azureFirewallName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureFirewallName") String azureFirewallName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls/{azureFirewallName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureFirewallName") String azureFirewallName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls/{azureFirewallName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureFirewallName") String azureFirewallName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AzureFirewallInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls/{azureFirewallName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureFirewallName") String azureFirewallName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{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> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azureFirewallName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureFirewallName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureFirewallName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azureFirewallName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureFirewallName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureFirewallName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azureFirewallName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, azureFirewallName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azureFirewallName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, azureFirewallName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azureFirewallName) { + return beginDeleteAsync(resourceGroupName, azureFirewallName).getSyncPoller(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azureFirewallName, Context context) { + return beginDeleteAsync(resourceGroupName, azureFirewallName, context).getSyncPoller(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azureFirewallName) { + return beginDeleteAsync(resourceGroupName, azureFirewallName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azureFirewallName, Context context) { + return beginDeleteAsync(resourceGroupName, azureFirewallName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 azureFirewallName) { + deleteAsync(resourceGroupName, azureFirewallName).block(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 azureFirewallName, Context context) { + deleteAsync(resourceGroupName, azureFirewallName, context).block(); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String azureFirewallName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureFirewallName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureFirewallName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String azureFirewallName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureFirewallName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureFirewallName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, azureFirewallName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupAsync(resourceGroupName, azureFirewallName).block(); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String azureFirewallName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, azureFirewallName, context).block(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureFirewallName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureFirewallName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AzureFirewallInner> beginCreateOrUpdateAsync( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, azureFirewallName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AzureFirewallInner.class, AzureFirewallInner.class, Context.NONE); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AzureFirewallInner> beginCreateOrUpdateAsync( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, azureFirewallName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AzureFirewallInner.class, AzureFirewallInner.class, context); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AzureFirewallInner> beginCreateOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AzureFirewallInner> beginCreateOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureFirewallInner createOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return createOrUpdateAsync(resourceGroupName, azureFirewallName, parameters).block(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureFirewallInner createOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, azureFirewallName, parameters, context).block(); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String azureFirewallName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureFirewallName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String azureFirewallName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureFirewallName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AzureFirewallInner> beginUpdateTagsAsync( + String resourceGroupName, String azureFirewallName, TagsObject parameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, azureFirewallName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AzureFirewallInner.class, AzureFirewallInner.class, Context.NONE); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AzureFirewallInner> beginUpdateTagsAsync( + String resourceGroupName, String azureFirewallName, TagsObject parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, azureFirewallName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AzureFirewallInner.class, AzureFirewallInner.class, context); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AzureFirewallInner> beginUpdateTags( + String resourceGroupName, String azureFirewallName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, azureFirewallName, parameters).getSyncPoller(); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AzureFirewallInner> beginUpdateTags( + String resourceGroupName, String azureFirewallName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, azureFirewallName, parameters, context).getSyncPoller(); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String azureFirewallName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, azureFirewallName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String azureFirewallName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, azureFirewallName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureFirewallInner updateTags(String resourceGroupName, String azureFirewallName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, azureFirewallName, parameters).block(); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureFirewallInner updateTags( + String resourceGroupName, String azureFirewallName, TagsObject parameters, Context context) { + return updateTagsAsync(resourceGroupName, azureFirewallName, parameters, context).block(); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Azure Firewalls 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 all the Azure Firewalls in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Azure Firewalls 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 all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Azure Firewalls 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 all the Azure Firewalls in a subscription. + */ + @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 response for ListAzureFirewalls API service call. + */ + @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 response for ListAzureFirewalls API service call. + */ + @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 response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsImpl.java new file mode 100644 index 0000000000000..3ea6270ad7abf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.AzureFirewallsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewall; +import com.azure.resourcemanager.network.generated.models.AzureFirewalls; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AzureFirewallsImpl implements AzureFirewalls { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallsImpl.class); + + private final AzureFirewallsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AzureFirewallsImpl( + AzureFirewallsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String azureFirewallName) { + this.serviceClient().delete(resourceGroupName, azureFirewallName); + } + + public void delete(String resourceGroupName, String azureFirewallName, Context context) { + this.serviceClient().delete(resourceGroupName, azureFirewallName, context); + } + + public AzureFirewall getByResourceGroup(String resourceGroupName, String azureFirewallName) { + AzureFirewallInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, azureFirewallName); + if (inner != null) { + return new AzureFirewallImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String azureFirewallName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureFirewallImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public AzureFirewall 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 azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, 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 azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, 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 azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + this.delete(resourceGroupName, azureFirewallName, 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 azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + this.delete(resourceGroupName, azureFirewallName, context); + } + + private AzureFirewallsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public AzureFirewallImpl define(String name) { + return new AzureFirewallImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.java new file mode 100644 index 0000000000000..9253fb87414fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReport; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportItem; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation; +import java.util.Collections; +import java.util.List; + +public final class AzureReachabilityReportImpl implements AzureReachabilityReport { + private AzureReachabilityReportInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AzureReachabilityReportImpl( + AzureReachabilityReportInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String aggregationLevel() { + return this.innerModel().aggregationLevel(); + } + + public AzureReachabilityReportLocation providerLocation() { + return this.innerModel().providerLocation(); + } + + public List reachabilityReport() { + List inner = this.innerModel().reachabilityReport(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AzureReachabilityReportInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.java new file mode 100644 index 0000000000000..46048ae25edd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.azure.resourcemanager.network.generated.models.AzureWebCategory; + +public final class AzureWebCategoryImpl implements AzureWebCategory { + private AzureWebCategoryInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AzureWebCategoryImpl( + AzureWebCategoryInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager 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 etag() { + return this.innerModel().etag(); + } + + public String group() { + return this.innerModel().group(); + } + + public AzureWebCategoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressPoolImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressPoolImpl.java new file mode 100644 index 0000000000000..017c1ab0905b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressPoolImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class BackendAddressPoolImpl + implements BackendAddressPool, BackendAddressPool.Definition, BackendAddressPool.Update { + private BackendAddressPoolInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public List tunnelInterfaces() { + List inner = this.innerModel().tunnelInterfaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancerBackendAddresses() { + List inner = this.innerModel().loadBalancerBackendAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List backendIpConfigurations() { + List inner = this.innerModel().backendIpConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource outboundRule() { + return this.innerModel().outboundRule(); + } + + public List outboundRules() { + List inner = this.innerModel().outboundRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public BackendAddressPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String loadBalancerName; + + private String backendAddressPoolName; + + public BackendAddressPoolImpl withExistingLoadBalancer(String resourceGroupName, String loadBalancerName) { + this.resourceGroupName = resourceGroupName; + this.loadBalancerName = loadBalancerName; + return this; + } + + public BackendAddressPool create() { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .createOrUpdate( + resourceGroupName, loadBalancerName, backendAddressPoolName, this.innerModel(), Context.NONE); + return this; + } + + public BackendAddressPool create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .createOrUpdate( + resourceGroupName, loadBalancerName, backendAddressPoolName, this.innerModel(), context); + return this; + } + + BackendAddressPoolImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new BackendAddressPoolInner(); + this.serviceManager = serviceManager; + this.backendAddressPoolName = name; + } + + public BackendAddressPoolImpl update() { + return this; + } + + public BackendAddressPool apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .createOrUpdate( + resourceGroupName, loadBalancerName, backendAddressPoolName, this.innerModel(), Context.NONE); + return this; + } + + public BackendAddressPool apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .createOrUpdate( + resourceGroupName, loadBalancerName, backendAddressPoolName, this.innerModel(), context); + return this; + } + + BackendAddressPoolImpl( + BackendAddressPoolInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = Utils.getValueFromIdByName(innerObject.id(), "loadBalancers"); + this.backendAddressPoolName = Utils.getValueFromIdByName(innerObject.id(), "backendAddressPools"); + } + + public BackendAddressPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, Context.NONE) + .getValue(); + return this; + } + + public BackendAddressPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, context) + .getValue(); + return this; + } + + public BackendAddressPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BackendAddressPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BackendAddressPoolImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public BackendAddressPoolImpl withTunnelInterfaces(List tunnelInterfaces) { + this.innerModel().withTunnelInterfaces(tunnelInterfaces); + return this; + } + + public BackendAddressPoolImpl withLoadBalancerBackendAddresses( + List loadBalancerBackendAddresses) { + this.innerModel().withLoadBalancerBackendAddresses(loadBalancerBackendAddresses); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionActiveSessionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionActiveSessionImpl.java new file mode 100644 index 0000000000000..3f2c6a2e09817 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionActiveSessionImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.azure.resourcemanager.network.generated.models.BastionActiveSession; +import com.azure.resourcemanager.network.generated.models.BastionConnectProtocol; + +public final class BastionActiveSessionImpl implements BastionActiveSession { + private BastionActiveSessionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BastionActiveSessionImpl( + BastionActiveSessionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sessionId() { + return this.innerModel().sessionId(); + } + + public Object startTime() { + return this.innerModel().startTime(); + } + + public String targetSubscriptionId() { + return this.innerModel().targetSubscriptionId(); + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String targetHostname() { + return this.innerModel().targetHostname(); + } + + public String targetResourceGroup() { + return this.innerModel().targetResourceGroup(); + } + + public String username() { + return this.innerModel().username(); + } + + public String targetIpAddress() { + return this.innerModel().targetIpAddress(); + } + + public BastionConnectProtocol protocol() { + return this.innerModel().protocol(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public Float sessionDurationInMins() { + return this.innerModel().sessionDurationInMins(); + } + + public BastionActiveSessionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.java new file mode 100644 index 0000000000000..7552ae97a725f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.azure.resourcemanager.network.generated.models.BastionHost; +import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BastionHostImpl implements BastionHost, BastionHost.Definition, BastionHost.Update { + private BastionHostInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String dnsName() { + return this.innerModel().dnsName(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public BastionHostInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String bastionHostname; + + public BastionHostImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public BastionHost create() { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .createOrUpdate(resourceGroupName, bastionHostname, this.innerModel(), Context.NONE); + return this; + } + + public BastionHost create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .createOrUpdate(resourceGroupName, bastionHostname, this.innerModel(), context); + return this; + } + + BastionHostImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new BastionHostInner(); + this.serviceManager = serviceManager; + this.bastionHostname = name; + } + + public BastionHostImpl update() { + return this; + } + + public BastionHost apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .createOrUpdate(resourceGroupName, bastionHostname, this.innerModel(), Context.NONE); + return this; + } + + public BastionHost apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .createOrUpdate(resourceGroupName, bastionHostname, this.innerModel(), context); + return this; + } + + BastionHostImpl( + BastionHostInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.bastionHostname = Utils.getValueFromIdByName(innerObject.id(), "bastionHosts"); + } + + public BastionHost refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .getByResourceGroupWithResponse(resourceGroupName, bastionHostname, Context.NONE) + .getValue(); + return this; + } + + public BastionHost refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .getByResourceGroupWithResponse(resourceGroupName, bastionHostname, context) + .getValue(); + return this; + } + + public BastionHostImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BastionHostImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BastionHostImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public BastionHostImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public BastionHostImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public BastionHostImpl withDnsName(String dnsName) { + this.innerModel().withDnsName(dnsName); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsClientImpl.java new file mode 100644 index 0000000000000..75ceca2543557 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsClientImpl.java @@ -0,0 +1,1254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.BastionHostsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.azure.resourcemanager.network.generated.models.BastionHostListResult; +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 BastionHostsClient. */ +public final class BastionHostsClientImpl implements BastionHostsClient { + private final ClientLogger logger = new ClientLogger(BastionHostsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BastionHostsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of BastionHostsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BastionHostsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(BastionHostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientBastionHosts to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface BastionHostsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BastionHostInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 bastionHostname) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 bastionHostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 bastionHostname) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, bastionHostname); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 bastionHostname, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, bastionHostname, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 bastionHostname) { + return beginDeleteAsync(resourceGroupName, bastionHostname).getSyncPoller(); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 bastionHostname, Context context) { + return beginDeleteAsync(resourceGroupName, bastionHostname, context).getSyncPoller(); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 bastionHostname) { + return beginDeleteAsync(resourceGroupName, bastionHostname) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 bastionHostname, Context context) { + return beginDeleteAsync(resourceGroupName, bastionHostname, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 bastionHostname) { + deleteAsync(resourceGroupName, bastionHostname).block(); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 bastionHostname, Context context) { + deleteAsync(resourceGroupName, bastionHostname, context).block(); + } + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String bastionHostname) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String bastionHostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String bastionHostname) { + return getByResourceGroupWithResponseAsync(resourceGroupName, bastionHostname) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner getByResourceGroup(String resourceGroupName, String bastionHostname) { + return getByResourceGroupAsync(resourceGroupName, bastionHostname).block(); + } + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String bastionHostname, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, bastionHostname, context).block(); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String bastionHostname, BastionHostInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String bastionHostname, BastionHostInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BastionHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, String bastionHostname, BastionHostInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, bastionHostname, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BastionHostInner.class, BastionHostInner.class, Context.NONE); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BastionHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, String bastionHostname, BastionHostInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, bastionHostname, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BastionHostInner.class, BastionHostInner.class, context); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, String bastionHostname, BastionHostInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, bastionHostname, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, String bastionHostname, BastionHostInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, bastionHostname, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String bastionHostname, BastionHostInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, bastionHostname, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String bastionHostname, BastionHostInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, bastionHostname, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner createOrUpdate( + String resourceGroupName, String bastionHostname, BastionHostInner parameters) { + return createOrUpdateAsync(resourceGroupName, bastionHostname, parameters).block(); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner createOrUpdate( + String resourceGroupName, String bastionHostname, BastionHostInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, bastionHostname, parameters, context).block(); + } + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for ListBastionHosts API service call. + */ + @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 response for ListBastionHosts API service call. + */ + @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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsImpl.java new file mode 100644 index 0000000000000..12262140fd535 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.BastionHostsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.azure.resourcemanager.network.generated.models.BastionHost; +import com.azure.resourcemanager.network.generated.models.BastionHosts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BastionHostsImpl implements BastionHosts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostsImpl.class); + + private final BastionHostsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public BastionHostsImpl( + BastionHostsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String bastionHostname) { + this.serviceClient().delete(resourceGroupName, bastionHostname); + } + + public void delete(String resourceGroupName, String bastionHostname, Context context) { + this.serviceClient().delete(resourceGroupName, bastionHostname, context); + } + + public BastionHost getByResourceGroup(String resourceGroupName, String bastionHostname) { + BastionHostInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, bastionHostname); + if (inner != null) { + return new BastionHostImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String bastionHostname, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, bastionHostname, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BastionHostImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public BastionHost 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 bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, bastionHostname, 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 bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, bastionHostname, 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 bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + this.delete(resourceGroupName, bastionHostname, 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 bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + this.delete(resourceGroupName, bastionHostname, context); + } + + private BastionHostsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public BastionHostImpl define(String name) { + return new BastionHostImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java new file mode 100644 index 0000000000000..784524a4495b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.azure.resourcemanager.network.generated.models.BastionSessionState; + +public final class BastionSessionStateImpl implements BastionSessionState { + private BastionSessionStateInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BastionSessionStateImpl( + BastionSessionStateInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sessionId() { + return this.innerModel().sessionId(); + } + + public String message() { + return this.innerModel().message(); + } + + public String state() { + return this.innerModel().state(); + } + + public BastionSessionStateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.java new file mode 100644 index 0000000000000..c0e64bac5cc18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLink; +import com.azure.resourcemanager.network.generated.models.VM; + +public final class BastionShareableLinkImpl implements BastionShareableLink { + private BastionShareableLinkInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BastionShareableLinkImpl( + BastionShareableLinkInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public VM vm() { + return this.innerModel().vm(); + } + + public String bsl() { + return this.innerModel().bsl(); + } + + public String createdAt() { + return this.innerModel().createdAt(); + } + + public String message() { + return this.innerModel().message(); + } + + public BastionShareableLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.java new file mode 100644 index 0000000000000..616b59e09988b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.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.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.models.BgpConnection; +import com.azure.resourcemanager.network.generated.models.HubBgpConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class BgpConnectionImpl implements BgpConnection, BgpConnection.Definition, BgpConnection.Update { + private BgpConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Long peerAsn() { + return this.innerModel().peerAsn(); + } + + public String peerIp() { + return this.innerModel().peerIp(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HubBgpConnectionStatus connectionState() { + return this.innerModel().connectionState(); + } + + public BgpConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHubName; + + private String connectionName; + + public BgpConnectionImpl withExistingVirtualHub(String resourceGroupName, String virtualHubName) { + this.resourceGroupName = resourceGroupName; + this.virtualHubName = virtualHubName; + return this; + } + + public BgpConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubBgpConnections() + .createOrUpdate(resourceGroupName, virtualHubName, connectionName, this.innerModel(), Context.NONE); + return this; + } + + public BgpConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubBgpConnections() + .createOrUpdate(resourceGroupName, virtualHubName, connectionName, this.innerModel(), context); + return this; + } + + BgpConnectionImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new BgpConnectionInner(); + this.serviceManager = serviceManager; + this.connectionName = name; + } + + public BgpConnectionImpl update() { + return this; + } + + public BgpConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubBgpConnections() + .createOrUpdate(resourceGroupName, virtualHubName, connectionName, this.innerModel(), Context.NONE); + return this; + } + + public BgpConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubBgpConnections() + .createOrUpdate(resourceGroupName, virtualHubName, connectionName, this.innerModel(), context); + return this; + } + + BgpConnectionImpl( + BgpConnectionInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.connectionName = Utils.getValueFromIdByName(innerObject.id(), "bgpConnections"); + } + + public BgpConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubBgpConnections() + .getWithResponse(resourceGroupName, virtualHubName, connectionName, Context.NONE) + .getValue(); + return this; + } + + public BgpConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubBgpConnections() + .getWithResponse(resourceGroupName, virtualHubName, connectionName, context) + .getValue(); + return this; + } + + public BgpConnectionImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public BgpConnectionImpl withPeerAsn(Long peerAsn) { + this.innerModel().withPeerAsn(peerAsn); + return this; + } + + public BgpConnectionImpl withPeerIp(String peerIp) { + this.innerModel().withPeerIp(peerIp); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpPeerStatusListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpPeerStatusListResultImpl.java new file mode 100644 index 0000000000000..0a8845b7c6406 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpPeerStatusListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatus; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatusListResult; +import java.util.Collections; +import java.util.List; + +public final class BgpPeerStatusListResultImpl implements BgpPeerStatusListResult { + private BgpPeerStatusListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BgpPeerStatusListResultImpl( + BgpPeerStatusListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public BgpPeerStatusListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesClientImpl.java new file mode 100644 index 0000000000000..e3380fed67dc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesClientImpl.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.BgpServiceCommunitiesClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunityListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BgpServiceCommunitiesClient. */ +public final class BgpServiceCommunitiesClientImpl implements BgpServiceCommunitiesClient { + private final ClientLogger logger = new ClientLogger(BgpServiceCommunitiesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BgpServiceCommunitiesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of BgpServiceCommunitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BgpServiceCommunitiesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(BgpServiceCommunitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientBgpServiceCommunities to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface BgpServiceCommunitiesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the available bgp service communities. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the available bgp service communities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the available bgp service communities. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the available bgp service communities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the available bgp service communities. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the available bgp service communities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @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 response for the ListServiceCommunity API service call. + */ + @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 response for the ListServiceCommunity API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesImpl.java new file mode 100644 index 0000000000000..11452f55f5acb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.BgpServiceCommunitiesClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunities; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunity; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BgpServiceCommunitiesImpl implements BgpServiceCommunities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunitiesImpl.class); + + private final BgpServiceCommunitiesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public BgpServiceCommunitiesImpl( + BgpServiceCommunitiesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new BgpServiceCommunityImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new BgpServiceCommunityImpl(inner1, this.manager())); + } + + private BgpServiceCommunitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.java new file mode 100644 index 0000000000000..fc000910b504d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import com.azure.resourcemanager.network.generated.models.BgpCommunity; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunity; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BgpServiceCommunityImpl implements BgpServiceCommunity { + private BgpServiceCommunityInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BgpServiceCommunityImpl( + BgpServiceCommunityInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 String serviceName() { + return this.innerModel().serviceName(); + } + + public List bgpCommunities() { + List inner = this.innerModel().bgpCommunities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public BgpServiceCommunityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorQueryResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorQueryResultImpl.java new file mode 100644 index 0000000000000..a364beba16e6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorQueryResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorQueryResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSourceStatus; +import com.azure.resourcemanager.network.generated.models.ConnectionStateSnapshot; +import java.util.Collections; +import java.util.List; + +public final class ConnectionMonitorQueryResultImpl implements ConnectionMonitorQueryResult { + private ConnectionMonitorQueryResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectionMonitorQueryResultImpl( + ConnectionMonitorQueryResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ConnectionMonitorSourceStatus sourceStatus() { + return this.innerModel().sourceStatus(); + } + + public List states() { + List inner = this.innerModel().states(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConnectionMonitorQueryResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorResultImpl.java new file mode 100644 index 0000000000000..3bd4c9a257083 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorResultImpl.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitor; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorDestination; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorOutput; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorQueryResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSource; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ConnectionMonitorResultImpl + implements ConnectionMonitorResult, ConnectionMonitorResult.Definition, ConnectionMonitorResult.Update { + private ConnectionMonitorResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager 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 String etag() { + return this.innerModel().etag(); + } + + public ConnectionMonitorSource source() { + return this.innerModel().source(); + } + + public ConnectionMonitorDestination destination() { + return this.innerModel().destination(); + } + + public Boolean autoStart() { + return this.innerModel().autoStart(); + } + + public Integer monitoringIntervalInSeconds() { + return this.innerModel().monitoringIntervalInSeconds(); + } + + public List endpoints() { + List inner = this.innerModel().endpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List testConfigurations() { + List inner = this.innerModel().testConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List testGroups() { + List inner = this.innerModel().testGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List outputs() { + List inner = this.innerModel().outputs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String notes() { + return this.innerModel().notes(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public String monitoringStatus() { + return this.innerModel().monitoringStatus(); + } + + public ConnectionMonitorType connectionMonitorType() { + return this.innerModel().connectionMonitorType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ConnectionMonitorResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkWatcherName; + + private String connectionMonitorName; + + private String createMigrate; + + private ConnectionMonitor createParameters; + + private TagsObject updateParameters; + + public ConnectionMonitorResultImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + public ConnectionMonitorResult create() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitors() + .createOrUpdate( + resourceGroupName, + networkWatcherName, + connectionMonitorName, + createParameters, + createMigrate, + Context.NONE); + return this; + } + + public ConnectionMonitorResult create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitors() + .createOrUpdate( + resourceGroupName, + networkWatcherName, + connectionMonitorName, + createParameters, + createMigrate, + context); + return this; + } + + ConnectionMonitorResultImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ConnectionMonitorResultInner(); + this.serviceManager = serviceManager; + this.connectionMonitorName = name; + this.createMigrate = null; + this.createParameters = new ConnectionMonitor(); + } + + public ConnectionMonitorResultImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ConnectionMonitorResult apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitors() + .updateTagsWithResponse( + resourceGroupName, networkWatcherName, connectionMonitorName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ConnectionMonitorResult apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitors() + .updateTagsWithResponse( + resourceGroupName, networkWatcherName, connectionMonitorName, updateParameters, context) + .getValue(); + return this; + } + + ConnectionMonitorResultImpl( + ConnectionMonitorResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = Utils.getValueFromIdByName(innerObject.id(), "networkWatchers"); + this.connectionMonitorName = Utils.getValueFromIdByName(innerObject.id(), "connectionMonitors"); + } + + public ConnectionMonitorResult refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitors() + .getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, Context.NONE) + .getValue(); + return this; + } + + public ConnectionMonitorResult refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitors() + .getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, context) + .getValue(); + return this; + } + + public void stop() { + serviceManager.connectionMonitors().stop(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void stop(Context context) { + serviceManager.connectionMonitors().stop(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public void start() { + serviceManager.connectionMonitors().start(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void start(Context context) { + serviceManager + .connectionMonitors() + .start(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public ConnectionMonitorQueryResult query() { + return serviceManager.connectionMonitors().query(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public ConnectionMonitorQueryResult query(Context context) { + return serviceManager + .connectionMonitors() + .query(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public ConnectionMonitorResultImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public ConnectionMonitorResultImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public ConnectionMonitorResultImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ConnectionMonitorResultImpl withSource(ConnectionMonitorSource source) { + this.createParameters.withSource(source); + return this; + } + + public ConnectionMonitorResultImpl withDestination(ConnectionMonitorDestination destination) { + this.createParameters.withDestination(destination); + return this; + } + + public ConnectionMonitorResultImpl withAutoStart(Boolean autoStart) { + this.createParameters.withAutoStart(autoStart); + return this; + } + + public ConnectionMonitorResultImpl withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.createParameters.withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + public ConnectionMonitorResultImpl withEndpoints(List endpoints) { + this.createParameters.withEndpoints(endpoints); + return this; + } + + public ConnectionMonitorResultImpl withTestConfigurations( + List testConfigurations) { + this.createParameters.withTestConfigurations(testConfigurations); + return this; + } + + public ConnectionMonitorResultImpl withTestGroups(List testGroups) { + this.createParameters.withTestGroups(testGroups); + return this; + } + + public ConnectionMonitorResultImpl withOutputs(List outputs) { + this.createParameters.withOutputs(outputs); + return this; + } + + public ConnectionMonitorResultImpl withNotes(String notes) { + this.createParameters.withNotes(notes); + return this; + } + + public ConnectionMonitorResultImpl withMigrate(String migrate) { + this.createMigrate = migrate; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsClientImpl.java new file mode 100644 index 0000000000000..f3760b882873b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsClientImpl.java @@ -0,0 +1,2204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ConnectionMonitorsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitor; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 ConnectionMonitorsClient. */ +public final class ConnectionMonitorsClientImpl implements ConnectionMonitorsClient { + private final ClientLogger logger = new ClientLogger(ConnectionMonitorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ConnectionMonitorsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ConnectionMonitorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectionMonitorsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ConnectionMonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientConnectionMonitors to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ConnectionMonitorsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("migrate") String migrate, + @BodyParam("application/json") ConnectionMonitor parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> query( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + migrate, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + migrate, + parameters, + accept, + context); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectionMonitorResultInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectionMonitorResultInner.class, + ConnectionMonitorResultInner.class, + Context.NONE); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectionMonitorResultInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectionMonitorResultInner.class, + ConnectionMonitorResultInner.class, + context); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate) + .getSyncPoller(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, context) + .getSyncPoller(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters) { + final String migrate = null; + return beginCreateOrUpdateAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate) { + return createOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate) + .block(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters) { + final String migrate = null; + return createOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate) + .block(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context) { + return createOrUpdateAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, context) + .block(); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner get( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + deleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + deleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner updateTags( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).block(); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + TagsObject parameters, + Context context) { + return updateTagsWithResponseAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, context) + .block(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + stopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + stopAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + startAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + startAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> queryWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .query( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> queryWithResponseAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (connectionMonitorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .query( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectionMonitorQueryResultInner> + beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + Mono>> mono = + queryWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectionMonitorQueryResultInner.class, + ConnectionMonitorQueryResultInner.class, + Context.NONE); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectionMonitorQueryResultInner> + beginQueryAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + queryWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectionMonitorQueryResultInner.class, + ConnectionMonitorQueryResultInner.class, + context); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono queryAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono queryAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorQueryResultInner query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return queryAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorQueryResultInner query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return queryAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).block(); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkWatcherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkWatcherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkWatcherName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkWatcherName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName, context)); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName, context)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsImpl.java new file mode 100644 index 0000000000000..e9e80aad78dc1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsImpl.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ConnectionMonitorsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorQueryResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitors; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ConnectionMonitorsImpl implements ConnectionMonitors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorsImpl.class); + + private final ConnectionMonitorsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ConnectionMonitorsImpl( + ConnectionMonitorsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ConnectionMonitorResult get( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorResultInner inner = + this.serviceClient().get(resourceGroupName, networkWatcherName, connectionMonitorName); + if (inner != null) { + return new ConnectionMonitorResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConnectionMonitorResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void delete( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + this.serviceClient().stop(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void stop( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + this.serviceClient().stop(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + this.serviceClient().start(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void start( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + this.serviceClient().start(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public ConnectionMonitorQueryResult query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorQueryResultInner inner = + this.serviceClient().query(resourceGroupName, networkWatcherName, connectionMonitorName); + if (inner != null) { + return new ConnectionMonitorQueryResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionMonitorQueryResult query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + ConnectionMonitorQueryResultInner inner = + this.serviceClient().query(resourceGroupName, networkWatcherName, connectionMonitorName, context); + if (inner != null) { + return new ConnectionMonitorQueryResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName); + return Utils.mapPage(inner, inner1 -> new ConnectionMonitorResultImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName, context); + return Utils.mapPage(inner, inner1 -> new ConnectionMonitorResultImpl(inner1, this.manager())); + } + + public ConnectionMonitorResult 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + return this.getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, connectionMonitorName, 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + private ConnectionMonitorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ConnectionMonitorResultImpl define(String name) { + return new ConnectionMonitorResultImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java new file mode 100644 index 0000000000000..0667470d1eb4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.models.ConnectionResetSharedKey; + +public final class ConnectionResetSharedKeyImpl implements ConnectionResetSharedKey { + private ConnectionResetSharedKeyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectionResetSharedKeyImpl( + ConnectionResetSharedKeyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public int keyLength() { + return this.innerModel().keyLength(); + } + + public ConnectionResetSharedKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.java new file mode 100644 index 0000000000000..68dc4b2ad5aa0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; +import com.azure.resourcemanager.network.generated.models.ConnectionSharedKey; + +public final class ConnectionSharedKeyImpl implements ConnectionSharedKey { + private ConnectionSharedKeyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectionSharedKeyImpl( + ConnectionSharedKeyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String value() { + return this.innerModel().value(); + } + + public ConnectionSharedKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityInformationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityInformationImpl.java new file mode 100644 index 0000000000000..bf46680145f4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityInformationImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import com.azure.resourcemanager.network.generated.models.ConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ConnectivityHop; +import com.azure.resourcemanager.network.generated.models.ConnectivityInformation; +import java.util.Collections; +import java.util.List; + +public final class ConnectivityInformationImpl implements ConnectivityInformation { + private ConnectivityInformationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectivityInformationImpl( + ConnectivityInformationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List hops() { + List inner = this.innerModel().hops(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public Integer avgLatencyInMs() { + return this.innerModel().avgLatencyInMs(); + } + + public Integer minLatencyInMs() { + return this.innerModel().minLatencyInMs(); + } + + public Integer maxLatencyInMs() { + return this.innerModel().maxLatencyInMs(); + } + + public Integer probesSent() { + return this.innerModel().probesSent(); + } + + public Integer probesFailed() { + return this.innerModel().probesFailed(); + } + + public ConnectivityInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.java new file mode 100644 index 0000000000000..e04dfb4392f22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.CommissionedState; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefix; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class CustomIpPrefixImpl implements CustomIpPrefix, CustomIpPrefix.Definition, CustomIpPrefix.Update { + private CustomIpPrefixInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String cidr() { + return this.innerModel().cidr(); + } + + public String signedMessage() { + return this.innerModel().signedMessage(); + } + + public String authorizationMessage() { + return this.innerModel().authorizationMessage(); + } + + public CustomIpPrefix customIpPrefixParent() { + CustomIpPrefixInner inner = this.innerModel().customIpPrefixParent(); + if (inner != null) { + return new CustomIpPrefixImpl(inner, this.manager()); + } else { + return null; + } + } + + public List childCustomIpPrefixes() { + List inner = this.innerModel().childCustomIpPrefixes(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new CustomIpPrefixImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public CommissionedState commissionedState() { + return this.innerModel().commissionedState(); + } + + public List publicIpPrefixes() { + List inner = this.innerModel().publicIpPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public String failedReason() { + return this.innerModel().failedReason(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public CustomIpPrefixInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String customIpPrefixName; + + private TagsObject updateParameters; + + public CustomIpPrefixImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CustomIpPrefix create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .createOrUpdate(resourceGroupName, customIpPrefixName, this.innerModel(), Context.NONE); + return this; + } + + public CustomIpPrefix create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .createOrUpdate(resourceGroupName, customIpPrefixName, this.innerModel(), context); + return this; + } + + CustomIpPrefixImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new CustomIpPrefixInner(); + this.serviceManager = serviceManager; + this.customIpPrefixName = name; + } + + public CustomIpPrefixImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public CustomIpPrefix apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .updateTagsWithResponse(resourceGroupName, customIpPrefixName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public CustomIpPrefix apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .updateTagsWithResponse(resourceGroupName, customIpPrefixName, updateParameters, context) + .getValue(); + return this; + } + + CustomIpPrefixImpl( + CustomIpPrefixInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.customIpPrefixName = Utils.getValueFromIdByName(innerObject.id(), "customIpPrefixes"); + } + + public CustomIpPrefix refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public CustomIpPrefix refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, localExpand, context) + .getValue(); + return this; + } + + public CustomIpPrefixImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CustomIpPrefixImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CustomIpPrefixImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public CustomIpPrefixImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public CustomIpPrefixImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public CustomIpPrefixImpl withCidr(String cidr) { + this.innerModel().withCidr(cidr); + return this; + } + + public CustomIpPrefixImpl withSignedMessage(String signedMessage) { + this.innerModel().withSignedMessage(signedMessage); + return this; + } + + public CustomIpPrefixImpl withAuthorizationMessage(String authorizationMessage) { + this.innerModel().withAuthorizationMessage(authorizationMessage); + return this; + } + + public CustomIpPrefixImpl withCustomIpPrefixParent(CustomIpPrefixInner customIpPrefixParent) { + this.innerModel().withCustomIpPrefixParent(customIpPrefixParent); + return this; + } + + public CustomIpPrefixImpl withCommissionedState(CommissionedState commissionedState) { + this.innerModel().withCommissionedState(commissionedState); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesClientImpl.java new file mode 100644 index 0000000000000..d190f9af42b8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesClientImpl.java @@ -0,0 +1,1478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.CustomIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefixListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 CustomIpPrefixesClient. */ +public final class CustomIpPrefixesClientImpl implements CustomIpPrefixesClient { + private final ClientLogger logger = new ClientLogger(CustomIpPrefixesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CustomIpPrefixesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of CustomIpPrefixesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomIpPrefixesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(CustomIpPrefixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientCustomIpPrefixes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface CustomIpPrefixesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes/{customIpPrefixName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customIpPrefixName") String customIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes/{customIpPrefixName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customIpPrefixName") String customIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes/{customIpPrefixName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customIpPrefixName") String customIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CustomIpPrefixInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes/{customIpPrefixName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customIpPrefixName") String customIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customIpPrefixName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customIpPrefixName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customIpPrefixName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customIpPrefixName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customIpPrefixName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, customIpPrefixName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customIpPrefixName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, customIpPrefixName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customIpPrefixName) { + return beginDeleteAsync(resourceGroupName, customIpPrefixName).getSyncPoller(); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customIpPrefixName, Context context) { + return beginDeleteAsync(resourceGroupName, customIpPrefixName, context).getSyncPoller(); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customIpPrefixName) { + return beginDeleteAsync(resourceGroupName, customIpPrefixName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customIpPrefixName, Context context) { + return beginDeleteAsync(resourceGroupName, customIpPrefixName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 customIpPrefixName) { + deleteAsync(resourceGroupName, customIpPrefixName).block(); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 customIpPrefixName, Context context) { + deleteAsync(resourceGroupName, customIpPrefixName, context).block(); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String customIpPrefixName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customIpPrefixName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String customIpPrefixName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customIpPrefixName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String customIpPrefixName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customIpPrefixName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String customIpPrefixName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, customIpPrefixName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomIpPrefixInner getByResourceGroup(String resourceGroupName, String customIpPrefixName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, customIpPrefixName, expand).block(); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String customIpPrefixName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customIpPrefixName, expand, context).block(); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customIpPrefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customIpPrefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CustomIpPrefixInner> beginCreateOrUpdateAsync( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, customIpPrefixName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomIpPrefixInner.class, + CustomIpPrefixInner.class, + Context.NONE); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CustomIpPrefixInner> beginCreateOrUpdateAsync( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, customIpPrefixName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CustomIpPrefixInner.class, CustomIpPrefixInner.class, context); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CustomIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CustomIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomIpPrefixInner createOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters) { + return createOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters).block(); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomIpPrefixInner createOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters, context).block(); + } + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String customIpPrefixName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customIpPrefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String customIpPrefixName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (customIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customIpPrefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String customIpPrefixName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, customIpPrefixName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomIpPrefixInner updateTags(String resourceGroupName, String customIpPrefixName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, customIpPrefixName, parameters).block(); + } + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String customIpPrefixName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, customIpPrefixName, parameters, context).block(); + } + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the custom IP prefixes 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 all the custom IP prefixes in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the custom IP prefixes 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 all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the custom IP prefixes 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 all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for ListCustomIpPrefixes API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListCustomIpPrefixes API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for ListCustomIpPrefixes API service call. + */ + @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 response for ListCustomIpPrefixes API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesImpl.java new file mode 100644 index 0000000000000..41834836d2485 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.CustomIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefix; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefixes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CustomIpPrefixesImpl implements CustomIpPrefixes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomIpPrefixesImpl.class); + + private final CustomIpPrefixesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public CustomIpPrefixesImpl( + CustomIpPrefixesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String customIpPrefixName) { + this.serviceClient().delete(resourceGroupName, customIpPrefixName); + } + + public void delete(String resourceGroupName, String customIpPrefixName, Context context) { + this.serviceClient().delete(resourceGroupName, customIpPrefixName, context); + } + + public CustomIpPrefix getByResourceGroup(String resourceGroupName, String customIpPrefixName) { + CustomIpPrefixInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, customIpPrefixName); + if (inner != null) { + return new CustomIpPrefixImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String customIpPrefixName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomIpPrefixImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public CustomIpPrefix 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 customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, expand, 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 customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + this.delete(resourceGroupName, customIpPrefixName, 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 customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + this.delete(resourceGroupName, customIpPrefixName, context); + } + + private CustomIpPrefixesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public CustomIpPrefixImpl define(String name) { + return new CustomIpPrefixImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java new file mode 100644 index 0000000000000..a42297af35177 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java @@ -0,0 +1,959 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.network.generated.fluent.DdosCustomPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 DdosCustomPoliciesClient. */ +public final class DdosCustomPoliciesClientImpl implements DdosCustomPoliciesClient { + private final ClientLogger logger = new ClientLogger(DdosCustomPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DdosCustomPoliciesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of DdosCustomPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DdosCustomPoliciesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(DdosCustomPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientDdosCustomPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface DdosCustomPoliciesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosCustomPolicies/{ddosCustomPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosCustomPolicies/{ddosCustomPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosCustomPolicies/{ddosCustomPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DdosCustomPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosCustomPolicies/{ddosCustomPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosCustomPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosCustomPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + ddosCustomPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosCustomPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosCustomPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + ddosCustomPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosCustomPolicyName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, ddosCustomPolicyName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosCustomPolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, ddosCustomPolicyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosCustomPolicyName) { + return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName).getSyncPoller(); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosCustomPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName, context).getSyncPoller(); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosCustomPolicyName) { + return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosCustomPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ddosCustomPolicyName) { + deleteAsync(resourceGroupName, ddosCustomPolicyName).block(); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ddosCustomPolicyName, Context context) { + deleteAsync(resourceGroupName, ddosCustomPolicyName, context).block(); + } + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ddosCustomPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosCustomPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ddosCustomPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ddosCustomPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosCustomPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ddosCustomPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ddosCustomPolicyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ddosCustomPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosCustomPolicyInner getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName) { + return getByResourceGroupAsync(resourceGroupName, ddosCustomPolicyName).block(); + } + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosCustomPolicyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ddosCustomPolicyName, context).block(); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosCustomPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ddosCustomPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosCustomPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ddosCustomPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DdosCustomPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DdosCustomPolicyInner.class, + DdosCustomPolicyInner.class, + Context.NONE); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DdosCustomPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DdosCustomPolicyInner.class, DdosCustomPolicyInner.class, context); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosCustomPolicyInner createOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters).block(); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosCustomPolicyInner createOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters, context).block(); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosCustomPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + ddosCustomPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosCustomPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + ddosCustomPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosCustomPolicyInner updateTags( + String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters).block(); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesImpl.java new file mode 100644 index 0000000000000..03a9b6a8e3d5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.DdosCustomPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicies; +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DdosCustomPoliciesImpl implements DdosCustomPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosCustomPoliciesImpl.class); + + private final DdosCustomPoliciesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public DdosCustomPoliciesImpl( + DdosCustomPoliciesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String ddosCustomPolicyName) { + this.serviceClient().delete(resourceGroupName, ddosCustomPolicyName); + } + + public void delete(String resourceGroupName, String ddosCustomPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, ddosCustomPolicyName, context); + } + + public DdosCustomPolicy getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName) { + DdosCustomPolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ddosCustomPolicyName); + if (inner != null) { + return new DdosCustomPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosCustomPolicyName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DdosCustomPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DdosCustomPolicy 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 ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, 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 ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, 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 ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + this.delete(resourceGroupName, ddosCustomPolicyName, 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 ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + this.delete(resourceGroupName, ddosCustomPolicyName, context); + } + + private DdosCustomPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public DdosCustomPolicyImpl define(String name) { + return new DdosCustomPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.java new file mode 100644 index 0000000000000..9ff1e99d135e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.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.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicy; +import com.azure.resourcemanager.network.generated.models.ProtocolCustomSettingsFormat; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DdosCustomPolicyImpl + implements DdosCustomPolicy, DdosCustomPolicy.Definition, DdosCustomPolicy.Update { + private DdosCustomPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List publicIpAddresses() { + List inner = this.innerModel().publicIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List protocolCustomSettings() { + List inner = this.innerModel().protocolCustomSettings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DdosCustomPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ddosCustomPolicyName; + + private TagsObject updateParameters; + + public DdosCustomPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DdosCustomPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .createOrUpdate(resourceGroupName, ddosCustomPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public DdosCustomPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .createOrUpdate(resourceGroupName, ddosCustomPolicyName, this.innerModel(), context); + return this; + } + + DdosCustomPolicyImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new DdosCustomPolicyInner(); + this.serviceManager = serviceManager; + this.ddosCustomPolicyName = name; + } + + public DdosCustomPolicyImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public DdosCustomPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .updateTagsWithResponse(resourceGroupName, ddosCustomPolicyName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public DdosCustomPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .updateTagsWithResponse(resourceGroupName, ddosCustomPolicyName, updateParameters, context) + .getValue(); + return this; + } + + DdosCustomPolicyImpl( + DdosCustomPolicyInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ddosCustomPolicyName = Utils.getValueFromIdByName(innerObject.id(), "ddosCustomPolicies"); + } + + public DdosCustomPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, Context.NONE) + .getValue(); + return this; + } + + public DdosCustomPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, context) + .getValue(); + return this; + } + + public DdosCustomPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DdosCustomPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DdosCustomPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public DdosCustomPolicyImpl withProtocolCustomSettings(List protocolCustomSettings) { + this.innerModel().withProtocolCustomSettings(protocolCustomSettings); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlanImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlanImpl.java new file mode 100644 index 0000000000000..9778e6a033ff6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlanImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlan; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DdosProtectionPlanImpl + implements DdosProtectionPlan, DdosProtectionPlan.Definition, DdosProtectionPlan.Update { + private DdosProtectionPlanInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager 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 String etag() { + return this.innerModel().etag(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List virtualNetworks() { + List inner = this.innerModel().virtualNetworks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DdosProtectionPlanInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ddosProtectionPlanName; + + private TagsObject updateParameters; + + public DdosProtectionPlanImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DdosProtectionPlan create() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .createOrUpdate(resourceGroupName, ddosProtectionPlanName, this.innerModel(), Context.NONE); + return this; + } + + public DdosProtectionPlan create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .createOrUpdate(resourceGroupName, ddosProtectionPlanName, this.innerModel(), context); + return this; + } + + DdosProtectionPlanImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new DdosProtectionPlanInner(); + this.serviceManager = serviceManager; + this.ddosProtectionPlanName = name; + } + + public DdosProtectionPlanImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public DdosProtectionPlan apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .updateTagsWithResponse(resourceGroupName, ddosProtectionPlanName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public DdosProtectionPlan apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .updateTagsWithResponse(resourceGroupName, ddosProtectionPlanName, updateParameters, context) + .getValue(); + return this; + } + + DdosProtectionPlanImpl( + DdosProtectionPlanInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ddosProtectionPlanName = Utils.getValueFromIdByName(innerObject.id(), "ddosProtectionPlans"); + } + + public DdosProtectionPlan refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, Context.NONE) + .getValue(); + return this; + } + + public DdosProtectionPlan refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, context) + .getValue(); + return this; + } + + public DdosProtectionPlanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DdosProtectionPlanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DdosProtectionPlanImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java new file mode 100644 index 0000000000000..8557066fdfdf3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java @@ -0,0 +1,1464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.DdosProtectionPlansClient; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlanListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 DdosProtectionPlansClient. */ +public final class DdosProtectionPlansClientImpl implements DdosProtectionPlansClient { + private final ClientLogger logger = new ClientLogger(DdosProtectionPlansClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DdosProtectionPlansService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of DdosProtectionPlansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DdosProtectionPlansClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(DdosProtectionPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientDdosProtectionPlans to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface DdosProtectionPlansService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans/{ddosProtectionPlanName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans/{ddosProtectionPlanName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans/{ddosProtectionPlanName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DdosProtectionPlanInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans/{ddosProtectionPlanName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosProtectionPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosProtectionPlanName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ddosProtectionPlanName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + ddosProtectionPlanName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosProtectionPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosProtectionPlanName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ddosProtectionPlanName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + ddosProtectionPlanName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosProtectionPlanName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, ddosProtectionPlanName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosProtectionPlanName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, ddosProtectionPlanName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosProtectionPlanName) { + return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName).getSyncPoller(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosProtectionPlanName, Context context) { + return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName, context).getSyncPoller(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosProtectionPlanName) { + return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ddosProtectionPlanName, Context context) { + return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ddosProtectionPlanName) { + deleteAsync(resourceGroupName, ddosProtectionPlanName).block(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ddosProtectionPlanName, Context context) { + deleteAsync(resourceGroupName, ddosProtectionPlanName, context).block(); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ddosProtectionPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosProtectionPlanName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ddosProtectionPlanName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ddosProtectionPlanName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ddosProtectionPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosProtectionPlanName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ddosProtectionPlanName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ddosProtectionPlanName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ddosProtectionPlanName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupAsync(resourceGroupName, ddosProtectionPlanName).block(); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosProtectionPlanName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ddosProtectionPlanName, context).block(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosProtectionPlanName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ddosProtectionPlanName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosProtectionPlanName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ddosProtectionPlanName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DdosProtectionPlanInner> beginCreateOrUpdateAsync( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DdosProtectionPlanInner.class, + DdosProtectionPlanInner.class, + Context.NONE); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DdosProtectionPlanInner> beginCreateOrUpdateAsync( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DdosProtectionPlanInner.class, + DdosProtectionPlanInner.class, + context); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosProtectionPlanInner createOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return createOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).block(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosProtectionPlanInner createOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters, context).block(); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosProtectionPlanName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + ddosProtectionPlanName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ddosProtectionPlanName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + ddosProtectionPlanName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosProtectionPlanInner updateTags( + String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters).block(); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters, context).block(); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all DDoS protection plans 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 all DDoS protection plans in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all DDoS protection plans 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 all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all DDoS protection plans 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 all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 a list of DDoS protection plans. + */ + @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 list of DDoS protection plans. + */ + @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 list of DDoS protection plans. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 DDoS protection plans. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansImpl.java new file mode 100644 index 0000000000000..ab776bd522aec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.DdosProtectionPlansClient; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlan; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlans; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DdosProtectionPlansImpl implements DdosProtectionPlans { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlansImpl.class); + + private final DdosProtectionPlansClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public DdosProtectionPlansImpl( + DdosProtectionPlansClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + this.serviceClient().delete(resourceGroupName, ddosProtectionPlanName); + } + + public void delete(String resourceGroupName, String ddosProtectionPlanName, Context context) { + this.serviceClient().delete(resourceGroupName, ddosProtectionPlanName, context); + } + + public DdosProtectionPlan getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + DdosProtectionPlanInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, ddosProtectionPlanName); + if (inner != null) { + return new DdosProtectionPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosProtectionPlanName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DdosProtectionPlanImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public DdosProtectionPlan 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 ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, 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 ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, 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 ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + this.delete(resourceGroupName, ddosProtectionPlanName, 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 ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + this.delete(resourceGroupName, ddosProtectionPlanName, context); + } + + private DdosProtectionPlansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public DdosProtectionPlanImpl define(String name) { + return new DdosProtectionPlanImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java new file mode 100644 index 0000000000000..970b43928ce65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java @@ -0,0 +1,536 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.DefaultSecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.SecurityRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DefaultSecurityRulesClient. */ +public final class DefaultSecurityRulesClientImpl implements DefaultSecurityRulesClient { + private final ClientLogger logger = new ClientLogger(DefaultSecurityRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DefaultSecurityRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of DefaultSecurityRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DefaultSecurityRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(DefaultSecurityRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientDefaultSecurityRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface DefaultSecurityRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @PathParam("defaultSecurityRuleName") String defaultSecurityRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkSecurityGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkSecurityGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkSecurityGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName)); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName, context)); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (defaultSecurityRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter defaultSecurityRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + defaultSecurityRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (defaultSecurityRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter defaultSecurityRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + defaultSecurityRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityRuleInner get( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).block(); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, 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 response for ListSecurityRule API service call. + */ + @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 response for ListSecurityRule API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesImpl.java new file mode 100644 index 0000000000000..42f0016a3f3ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.DefaultSecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.DefaultSecurityRules; +import com.azure.resourcemanager.network.generated.models.SecurityRule; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DefaultSecurityRulesImpl implements DefaultSecurityRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultSecurityRulesImpl.class); + + private final DefaultSecurityRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public DefaultSecurityRulesImpl( + DefaultSecurityRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkSecurityGroupName); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkSecurityGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public SecurityRule get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + SecurityRuleInner inner = + this.serviceClient().get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName); + if (inner != null) { + return new SecurityRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecurityRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DefaultSecurityRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DnsNameAvailabilityResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DnsNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..97671920fcebb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DnsNameAvailabilityResultImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.models.DnsNameAvailabilityResult; + +public final class DnsNameAvailabilityResultImpl implements DnsNameAvailabilityResult { + private DnsNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + DnsNameAvailabilityResultImpl( + DnsNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean available() { + return this.innerModel().available(); + } + + public DnsNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.java new file mode 100644 index 0000000000000..19f1154abec1f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.models.DscpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.ProtocolType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.QosIpRange; +import com.azure.resourcemanager.network.generated.models.QosPortRange; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class DscpConfigurationImpl + implements DscpConfiguration, DscpConfiguration.Definition, DscpConfiguration.Update { + private DscpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public List markings() { + List inner = this.innerModel().markings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List sourceIpRanges() { + List inner = this.innerModel().sourceIpRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationIpRanges() { + List inner = this.innerModel().destinationIpRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List sourcePortRanges() { + List inner = this.innerModel().sourcePortRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationPortRanges() { + List inner = this.innerModel().destinationPortRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProtocolType protocol() { + return this.innerModel().protocol(); + } + + public String qosCollectionId() { + return this.innerModel().qosCollectionId(); + } + + public List associatedNetworkInterfaces() { + List inner = this.innerModel().associatedNetworkInterfaces(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkInterfaceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DscpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String dscpConfigurationName; + + public DscpConfigurationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DscpConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getDscpConfigurations() + .createOrUpdate(resourceGroupName, dscpConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public DscpConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDscpConfigurations() + .createOrUpdate(resourceGroupName, dscpConfigurationName, this.innerModel(), context); + return this; + } + + DscpConfigurationImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new DscpConfigurationInner(); + this.serviceManager = serviceManager; + this.dscpConfigurationName = name; + } + + public DscpConfigurationImpl update() { + return this; + } + + public DscpConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDscpConfigurations() + .createOrUpdate(resourceGroupName, dscpConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public DscpConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDscpConfigurations() + .createOrUpdate(resourceGroupName, dscpConfigurationName, this.innerModel(), context); + return this; + } + + DscpConfigurationImpl( + DscpConfigurationInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dscpConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "dscpConfigurations"); + } + + public DscpConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDscpConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public DscpConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDscpConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, context) + .getValue(); + return this; + } + + public DscpConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DscpConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DscpConfigurationImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public DscpConfigurationImpl withMarkings(List markings) { + this.innerModel().withMarkings(markings); + return this; + } + + public DscpConfigurationImpl withSourceIpRanges(List sourceIpRanges) { + this.innerModel().withSourceIpRanges(sourceIpRanges); + return this; + } + + public DscpConfigurationImpl withDestinationIpRanges(List destinationIpRanges) { + this.innerModel().withDestinationIpRanges(destinationIpRanges); + return this; + } + + public DscpConfigurationImpl withSourcePortRanges(List sourcePortRanges) { + this.innerModel().withSourcePortRanges(sourcePortRanges); + return this; + } + + public DscpConfigurationImpl withDestinationPortRanges(List destinationPortRanges) { + this.innerModel().withDestinationPortRanges(destinationPortRanges); + return this; + } + + public DscpConfigurationImpl withProtocol(ProtocolType protocol) { + this.innerModel().withProtocol(protocol); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsClientImpl.java new file mode 100644 index 0000000000000..993fff80261b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsClientImpl.java @@ -0,0 +1,1263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.DscpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.DscpConfigurationListResult; +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 DscpConfigurationsClient. */ +public final class DscpConfigurationsClientImpl implements DscpConfigurationsClient { + private final ClientLogger logger = new ClientLogger(DscpConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DscpConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of DscpConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DscpConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(DscpConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientDscpConfigurations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface DscpConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/dscpConfigurations/{dscpConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dscpConfigurationName") String dscpConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DscpConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/dscpConfigurations/{dscpConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dscpConfigurationName") String dscpConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/dscpConfigurations/{dscpConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dscpConfigurationName") String dscpConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/dscpConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{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> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dscpConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dscpConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + dscpConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dscpConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dscpConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + dscpConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DscpConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, dscpConfigurationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DscpConfigurationInner.class, + DscpConfigurationInner.class, + Context.NONE); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DscpConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, dscpConfigurationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DscpConfigurationInner.class, + DscpConfigurationInner.class, + context); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DscpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DscpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DscpConfigurationInner createOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters) { + return createOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters).block(); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dSCP Configuration in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DscpConfigurationInner createOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters, context).block(); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String dscpConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dscpConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dscpConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + dscpConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String dscpConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dscpConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dscpConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + dscpConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String dscpConfigurationName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, dscpConfigurationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String dscpConfigurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, dscpConfigurationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dscpConfigurationName) { + return beginDeleteAsync(resourceGroupName, dscpConfigurationName).getSyncPoller(); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String dscpConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, dscpConfigurationName, context).getSyncPoller(); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dscpConfigurationName) { + return beginDeleteAsync(resourceGroupName, dscpConfigurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dscpConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, dscpConfigurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dscpConfigurationName) { + deleteAsync(resourceGroupName, dscpConfigurationName).block(); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dscpConfigurationName, Context context) { + deleteAsync(resourceGroupName, dscpConfigurationName, context).block(); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dscpConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dscpConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dscpConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + dscpConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dscpConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dscpConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dscpConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + dscpConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String dscpConfigurationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dscpConfigurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DscpConfigurationInner getByResourceGroup(String resourceGroupName, String dscpConfigurationName) { + return getByResourceGroupAsync(resourceGroupName, dscpConfigurationName).block(); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String dscpConfigurationName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dscpConfigurationName, context).block(); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all dscp configurations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all dscp configurations 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 all dscp configurations in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all dscp configurations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all dscp configurations 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 all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all dscp configurations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all dscp configurations 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 all dscp configurations in a subscription. + */ + @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 response for the DscpConfigurationList API service call. + */ + @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 response for the DscpConfigurationList API service call. + */ + @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 response for the DscpConfigurationList API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for the DscpConfigurationList API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsImpl.java new file mode 100644 index 0000000000000..97c7380bef505 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.DscpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.DscpConfiguration; +import com.azure.resourcemanager.network.generated.models.DscpConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DscpConfigurationsImpl implements DscpConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DscpConfigurationsImpl.class); + + private final DscpConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public DscpConfigurationsImpl( + DscpConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String dscpConfigurationName) { + this.serviceClient().delete(resourceGroupName, dscpConfigurationName); + } + + public void delete(String resourceGroupName, String dscpConfigurationName, Context context) { + this.serviceClient().delete(resourceGroupName, dscpConfigurationName, context); + } + + public DscpConfiguration getByResourceGroup(String resourceGroupName, String dscpConfigurationName) { + DscpConfigurationInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, dscpConfigurationName); + if (inner != null) { + return new DscpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String dscpConfigurationName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DscpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public DscpConfiguration 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 dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, 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 dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, 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 dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + this.delete(resourceGroupName, dscpConfigurationName, 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 dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + this.delete(resourceGroupName, dscpConfigurationName, context); + } + + private DscpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public DscpConfigurationImpl define(String name) { + return new DscpConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.java new file mode 100644 index 0000000000000..a7679f4199e4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroupListResult; +import java.util.Collections; +import java.util.List; + +public final class EffectiveNetworkSecurityGroupListResultImpl implements EffectiveNetworkSecurityGroupListResult { + private EffectiveNetworkSecurityGroupListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EffectiveNetworkSecurityGroupListResultImpl( + EffectiveNetworkSecurityGroupListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public EffectiveNetworkSecurityGroupListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.java new file mode 100644 index 0000000000000..b632d72835726 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoute; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteListResult; +import java.util.Collections; +import java.util.List; + +public final class EffectiveRouteListResultImpl implements EffectiveRouteListResult { + private EffectiveRouteListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EffectiveRouteListResultImpl( + EffectiveRouteListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public EffectiveRouteListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java new file mode 100644 index 0000000000000..3fc639dfa9eda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.azure.resourcemanager.network.generated.models.EndpointServiceResult; + +public final class EndpointServiceResultImpl implements EndpointServiceResult { + private EndpointServiceResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EndpointServiceResultImpl( + EndpointServiceResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager 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 EndpointServiceResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.java new file mode 100644 index 0000000000000..0734facdae69d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorization; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRouteCircuitAuthorizationImpl + implements ExpressRouteCircuitAuthorization, + ExpressRouteCircuitAuthorization.Definition, + ExpressRouteCircuitAuthorization.Update { + private ExpressRouteCircuitAuthorizationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public AuthorizationUseStatus authorizationUseStatus() { + return this.innerModel().authorizationUseStatus(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExpressRouteCircuitAuthorizationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String circuitName; + + private String authorizationName; + + public ExpressRouteCircuitAuthorizationImpl withExistingExpressRouteCircuit( + String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + public ExpressRouteCircuitAuthorization create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .createOrUpdate(resourceGroupName, circuitName, authorizationName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitAuthorization create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .createOrUpdate(resourceGroupName, circuitName, authorizationName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitAuthorizationImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteCircuitAuthorizationInner(); + this.serviceManager = serviceManager; + this.authorizationName = name; + } + + public ExpressRouteCircuitAuthorizationImpl update() { + return this; + } + + public ExpressRouteCircuitAuthorization apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .createOrUpdate(resourceGroupName, circuitName, authorizationName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitAuthorization apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .createOrUpdate(resourceGroupName, circuitName, authorizationName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitAuthorizationImpl( + ExpressRouteCircuitAuthorizationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.authorizationName = Utils.getValueFromIdByName(innerObject.id(), "authorizations"); + } + + public ExpressRouteCircuitAuthorization refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .getWithResponse(resourceGroupName, circuitName, authorizationName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuitAuthorization refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .getWithResponse(resourceGroupName, circuitName, authorizationName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitAuthorizationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ExpressRouteCircuitAuthorizationImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public ExpressRouteCircuitAuthorizationImpl withAuthorizationUseStatus( + AuthorizationUseStatus authorizationUseStatus) { + this.innerModel().withAuthorizationUseStatus(authorizationUseStatus); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java new file mode 100644 index 0000000000000..cad0e9975f43d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java @@ -0,0 +1,1181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteCircuitAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.AuthorizationListResult; +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 ExpressRouteCircuitAuthorizationsClient. + */ +public final class ExpressRouteCircuitAuthorizationsClientImpl implements ExpressRouteCircuitAuthorizationsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitAuthorizationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCircuitAuthorizationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitAuthorizationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCircuitAuthorizationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCircuitAuthorizationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCircuitAuthorizations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCircuitAuthorizationsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("authorizationName") String authorizationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("authorizationName") String authorizationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("authorizationName") String authorizationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCircuitAuthorizationInner authorizationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/authorizations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String circuitName, String authorizationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + authorizationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String circuitName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + authorizationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String circuitName, String authorizationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, circuitName, authorizationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String circuitName, String authorizationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, circuitName, authorizationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String authorizationName) { + return beginDeleteAsync(resourceGroupName, circuitName, authorizationName).getSyncPoller(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String authorizationName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, authorizationName, context).getSyncPoller(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return beginDeleteAsync(resourceGroupName, circuitName, authorizationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String circuitName, String authorizationName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, authorizationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String circuitName, String authorizationName) { + deleteAsync(resourceGroupName, circuitName, authorizationName).block(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String circuitName, String authorizationName, Context context) { + deleteAsync(resourceGroupName, circuitName, authorizationName, context).block(); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the specified authorization from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String circuitName, String authorizationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + authorizationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the specified authorization from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String circuitName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + authorizationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the specified authorization from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String circuitName, String authorizationName) { + return getWithResponseAsync(resourceGroupName, circuitName, authorizationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the specified authorization from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitAuthorizationInner get( + String resourceGroupName, String circuitName, String authorizationName) { + return getAsync(resourceGroupName, circuitName, authorizationName).block(); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the specified authorization from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String circuitName, String authorizationName, Context context) { + return getWithResponseAsync(resourceGroupName, circuitName, authorizationName, context).block(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (authorizationParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null.")); + } else { + authorizationParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + authorizationName, + apiVersion, + this.client.getSubscriptionId(), + authorizationParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (authorizationParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null.")); + } else { + authorizationParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + authorizationName, + apiVersion, + this.client.getSubscriptionId(), + authorizationParameters, + accept, + context); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitAuthorizationInner.class, + ExpressRouteCircuitAuthorizationInner.class, + Context.NONE); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, circuitName, authorizationName, authorizationParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitAuthorizationInner.class, + ExpressRouteCircuitAuthorizationInner.class, + context); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, circuitName, authorizationName, authorizationParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, circuitName, authorizationName, authorizationParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitAuthorizationInner createOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).block(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitAuthorizationInner createOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, context) + .block(); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String circuitName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String circuitName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String circuitName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String circuitName) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName)); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, 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 response for ListAuthorizations API service call retrieves all authorizations that belongs to an + * ExpressRouteCircuit. + */ + @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 response for ListAuthorizations API service call retrieves all authorizations that belongs to an + * ExpressRouteCircuit. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsImpl.java new file mode 100644 index 0000000000000..cf8ac14bae43e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsImpl.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.network.generated.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.network.generated.fluent.ExpressRouteCircuitAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorization; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorizations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCircuitAuthorizationsImpl implements ExpressRouteCircuitAuthorizations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitAuthorizationsImpl.class); + + private final ExpressRouteCircuitAuthorizationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCircuitAuthorizationsImpl( + ExpressRouteCircuitAuthorizationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String circuitName, String authorizationName) { + this.serviceClient().delete(resourceGroupName, circuitName, authorizationName); + } + + public void delete(String resourceGroupName, String circuitName, String authorizationName, Context context) { + this.serviceClient().delete(resourceGroupName, circuitName, authorizationName, context); + } + + public ExpressRouteCircuitAuthorization get( + String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationInner inner = + this.serviceClient().get(resourceGroupName, circuitName, authorizationName); + if (inner != null) { + return new ExpressRouteCircuitAuthorizationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String circuitName, String authorizationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, circuitName, authorizationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitAuthorizationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String circuitName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitAuthorizationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitAuthorizationImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitAuthorization 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + 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, circuitName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + 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, circuitName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + 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, circuitName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + 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, circuitName, authorizationName, context); + } + + private ExpressRouteCircuitAuthorizationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitAuthorizationImpl define(String name) { + return new ExpressRouteCircuitAuthorizationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..7609914ab6c22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.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.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRouteCircuitConnectionImpl + implements ExpressRouteCircuitConnection, + ExpressRouteCircuitConnection.Definition, + ExpressRouteCircuitConnection.Update { + private ExpressRouteCircuitConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource expressRouteCircuitPeering() { + return this.innerModel().expressRouteCircuitPeering(); + } + + public SubResource peerExpressRouteCircuitPeering() { + return this.innerModel().peerExpressRouteCircuitPeering(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig() { + return this.innerModel().ipv6CircuitConnectionConfig(); + } + + public CircuitConnectionStatus circuitConnectionStatus() { + return this.innerModel().circuitConnectionStatus(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExpressRouteCircuitConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String circuitName; + + private String peeringName; + + private String connectionName; + + public ExpressRouteCircuitConnectionImpl withExistingPeering( + String resourceGroupName, String circuitName, String peeringName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + this.peeringName = peeringName; + return this; + } + + public ExpressRouteCircuitConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .createOrUpdate( + resourceGroupName, circuitName, peeringName, connectionName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .createOrUpdate( + resourceGroupName, circuitName, peeringName, connectionName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitConnectionImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteCircuitConnectionInner(); + this.serviceManager = serviceManager; + this.connectionName = name; + } + + public ExpressRouteCircuitConnectionImpl update() { + return this; + } + + public ExpressRouteCircuitConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .createOrUpdate( + resourceGroupName, circuitName, peeringName, connectionName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .createOrUpdate( + resourceGroupName, circuitName, peeringName, connectionName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitConnectionImpl( + ExpressRouteCircuitConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); + this.connectionName = Utils.getValueFromIdByName(innerObject.id(), "connections"); + } + + public ExpressRouteCircuitConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuitConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitConnectionImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ExpressRouteCircuitConnectionImpl withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.innerModel().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + public ExpressRouteCircuitConnectionImpl withPeerExpressRouteCircuitPeering( + SubResource peerExpressRouteCircuitPeering) { + this.innerModel().withPeerExpressRouteCircuitPeering(peerExpressRouteCircuitPeering); + return this; + } + + public ExpressRouteCircuitConnectionImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public ExpressRouteCircuitConnectionImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public ExpressRouteCircuitConnectionImpl withIpv6CircuitConnectionConfig( + Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig) { + this.innerModel().withIpv6CircuitConnectionConfig(ipv6CircuitConnectionConfig); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java new file mode 100644 index 0000000000000..c6feb472bb9f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java @@ -0,0 +1,1283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnectionListResult; +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 ExpressRouteCircuitConnectionsClient. */ +public final class ExpressRouteCircuitConnectionsClientImpl implements ExpressRouteCircuitConnectionsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCircuitConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCircuitConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCircuitConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCircuitConnections to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCircuitConnectionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, String connectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, String connectionName) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).getSyncPoller(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, String connectionName) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 circuitName, String peeringName, String connectionName) { + deleteAsync(resourceGroupName, circuitName, peeringName, connectionName).block(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 circuitName, String peeringName, String connectionName, Context context) { + deleteAsync(resourceGroupName, circuitName, peeringName, connectionName, context).block(); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitConnectionInner get( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getAsync(resourceGroupName, circuitName, peeringName, connectionName).block(); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, context).block(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (expressRouteCircuitConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter expressRouteCircuitConnectionParameters is required and cannot be null.")); + } else { + expressRouteCircuitConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + expressRouteCircuitConnectionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (expressRouteCircuitConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter expressRouteCircuitConnectionParameters is required and cannot be null.")); + } else { + expressRouteCircuitConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + expressRouteCircuitConnectionParameters, + accept, + context); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCircuitConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitConnectionInner.class, + ExpressRouteCircuitConnectionInner.class, + Context.NONE); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCircuitConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + circuitName, + peeringName, + connectionName, + expressRouteCircuitConnectionParameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitConnectionInner.class, + ExpressRouteCircuitConnectionInner.class, + context); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCircuitConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCircuitConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + circuitName, + peeringName, + connectionName, + expressRouteCircuitConnectionParameters, + context) + .getSyncPoller(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + circuitName, + peeringName, + connectionName, + expressRouteCircuitConnectionParameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitConnectionInner createOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return createOrUpdateAsync( + resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters) + .block(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitConnectionInner createOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + circuitName, + peeringName, + connectionName, + expressRouteCircuitConnectionParameters, + context) + .block(); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String circuitName, String peeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String circuitName, String peeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, String peeringName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName)); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName, 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 response for ListConnections API service call retrieves all global reach connections that belongs to a + * Private Peering for an ExpressRouteCircuit. + */ + @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 response for ListConnections API service call retrieves all global reach connections that belongs to a + * Private Peering for an ExpressRouteCircuit. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsImpl.java new file mode 100644 index 0000000000000..5d3a4302adc15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCircuitConnectionsImpl implements ExpressRouteCircuitConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionsImpl.class); + + private final ExpressRouteCircuitConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCircuitConnectionsImpl( + ExpressRouteCircuitConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + this.serviceClient().delete(resourceGroupName, circuitName, peeringName, connectionName); + } + + public void delete( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, circuitName, peeringName, connectionName, context); + } + + public ExpressRouteCircuitConnection get( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionInner inner = + this.serviceClient().get(resourceGroupName, circuitName, peeringName, connectionName); + if (inner != null) { + return new ExpressRouteCircuitConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitConnection 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this + .getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, connectionName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, connectionName, context); + } + + private ExpressRouteCircuitConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitConnectionImpl define(String name) { + return new ExpressRouteCircuitConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.java new file mode 100644 index 0000000000000..1804cec0f2f5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuit; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorization; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeering; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitServiceProviderProperties; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ExpressRouteCircuitImpl + implements ExpressRouteCircuit, ExpressRouteCircuit.Definition, ExpressRouteCircuit.Update { + private ExpressRouteCircuitInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExpressRouteCircuitSku sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Boolean allowClassicOperations() { + return this.innerModel().allowClassicOperations(); + } + + public String circuitProvisioningState() { + return this.innerModel().circuitProvisioningState(); + } + + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.innerModel().serviceProviderProvisioningState(); + } + + public List authorizations() { + List inner = this.innerModel().authorizations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteCircuitAuthorizationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List peerings() { + List inner = this.innerModel().peerings(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String serviceKey() { + return this.innerModel().serviceKey(); + } + + public String serviceProviderNotes() { + return this.innerModel().serviceProviderNotes(); + } + + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.innerModel().serviceProviderProperties(); + } + + public SubResource expressRoutePort() { + return this.innerModel().expressRoutePort(); + } + + public Float bandwidthInGbps() { + return this.innerModel().bandwidthInGbps(); + } + + public Integer stag() { + return this.innerModel().stag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String gatewayManagerEtag() { + return this.innerModel().gatewayManagerEtag(); + } + + public Boolean globalReachEnabled() { + return this.innerModel().globalReachEnabled(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExpressRouteCircuitInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String circuitName; + + private TagsObject updateParameters; + + public ExpressRouteCircuitImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ExpressRouteCircuit create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .createOrUpdate(resourceGroupName, circuitName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuit create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .createOrUpdate(resourceGroupName, circuitName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteCircuitInner(); + this.serviceManager = serviceManager; + this.circuitName = name; + } + + public ExpressRouteCircuitImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ExpressRouteCircuit apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .updateTagsWithResponse(resourceGroupName, circuitName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuit apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .updateTagsWithResponse(resourceGroupName, circuitName, updateParameters, context) + .getValue(); + return this; + } + + ExpressRouteCircuitImpl( + ExpressRouteCircuitInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + } + + public ExpressRouteCircuit refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .getByResourceGroupWithResponse(resourceGroupName, circuitName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuit refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .getByResourceGroupWithResponse(resourceGroupName, circuitName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRouteCircuitImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRouteCircuitImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ExpressRouteCircuitImpl withSku(ExpressRouteCircuitSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ExpressRouteCircuitImpl withAllowClassicOperations(Boolean allowClassicOperations) { + this.innerModel().withAllowClassicOperations(allowClassicOperations); + return this; + } + + public ExpressRouteCircuitImpl withCircuitProvisioningState(String circuitProvisioningState) { + this.innerModel().withCircuitProvisioningState(circuitProvisioningState); + return this; + } + + public ExpressRouteCircuitImpl withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.innerModel().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + public ExpressRouteCircuitImpl withAuthorizations(List authorizations) { + this.innerModel().withAuthorizations(authorizations); + return this; + } + + public ExpressRouteCircuitImpl withPeerings(List peerings) { + this.innerModel().withPeerings(peerings); + return this; + } + + public ExpressRouteCircuitImpl withServiceKey(String serviceKey) { + this.innerModel().withServiceKey(serviceKey); + return this; + } + + public ExpressRouteCircuitImpl withServiceProviderNotes(String serviceProviderNotes) { + this.innerModel().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + public ExpressRouteCircuitImpl withServiceProviderProperties( + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.innerModel().withServiceProviderProperties(serviceProviderProperties); + return this; + } + + public ExpressRouteCircuitImpl withExpressRoutePort(SubResource expressRoutePort) { + this.innerModel().withExpressRoutePort(expressRoutePort); + return this; + } + + public ExpressRouteCircuitImpl withBandwidthInGbps(Float bandwidthInGbps) { + this.innerModel().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + public ExpressRouteCircuitImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.innerModel().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + public ExpressRouteCircuitImpl withGlobalReachEnabled(Boolean globalReachEnabled) { + this.innerModel().withGlobalReachEnabled(globalReachEnabled); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringImpl.java new file mode 100644 index 0000000000000..dfb7b009292a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringImpl.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeering; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitStats; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionId; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ExpressRouteCircuitPeeringImpl + implements ExpressRouteCircuitPeering, ExpressRouteCircuitPeering.Definition, ExpressRouteCircuitPeering.Update { + private ExpressRouteCircuitPeeringInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public ExpressRoutePeeringType peeringType() { + return this.innerModel().peeringType(); + } + + public ExpressRoutePeeringState state() { + return this.innerModel().state(); + } + + public Integer azureAsn() { + return this.innerModel().azureAsn(); + } + + public Long peerAsn() { + return this.innerModel().peerAsn(); + } + + public String primaryPeerAddressPrefix() { + return this.innerModel().primaryPeerAddressPrefix(); + } + + public String secondaryPeerAddressPrefix() { + return this.innerModel().secondaryPeerAddressPrefix(); + } + + public String primaryAzurePort() { + return this.innerModel().primaryAzurePort(); + } + + public String secondaryAzurePort() { + return this.innerModel().secondaryAzurePort(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public Integer vlanId() { + return this.innerModel().vlanId(); + } + + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.innerModel().microsoftPeeringConfig(); + } + + public ExpressRouteCircuitStats stats() { + ExpressRouteCircuitStatsInner inner = this.innerModel().stats(); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String gatewayManagerEtag() { + return this.innerModel().gatewayManagerEtag(); + } + + public String lastModifiedBy() { + return this.innerModel().lastModifiedBy(); + } + + public SubResource routeFilter() { + return this.innerModel().routeFilter(); + } + + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.innerModel().ipv6PeeringConfig(); + } + + public ExpressRouteConnectionId expressRouteConnection() { + return this.innerModel().expressRouteConnection(); + } + + public List connections() { + List inner = this.innerModel().connections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteCircuitConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List peeredConnections() { + List inner = this.innerModel().peeredConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PeerExpressRouteCircuitConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ExpressRouteCircuitPeeringInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String circuitName; + + private String peeringName; + + public ExpressRouteCircuitPeeringImpl withExistingExpressRouteCircuit( + String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + public ExpressRouteCircuitPeering create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .createOrUpdate(resourceGroupName, circuitName, peeringName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitPeering create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .createOrUpdate(resourceGroupName, circuitName, peeringName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitPeeringImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteCircuitPeeringInner(); + this.serviceManager = serviceManager; + this.peeringName = name; + } + + public ExpressRouteCircuitPeeringImpl update() { + return this; + } + + public ExpressRouteCircuitPeering apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .createOrUpdate(resourceGroupName, circuitName, peeringName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitPeering apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .createOrUpdate(resourceGroupName, circuitName, peeringName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitPeeringImpl( + ExpressRouteCircuitPeeringInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); + } + + public ExpressRouteCircuitPeering refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .getWithResponse(resourceGroupName, circuitName, peeringName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuitPeering refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .getWithResponse(resourceGroupName, circuitName, peeringName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitPeeringImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.innerModel().withPeeringType(peeringType); + return this; + } + + public ExpressRouteCircuitPeeringImpl withState(ExpressRoutePeeringState state) { + this.innerModel().withState(state); + return this; + } + + public ExpressRouteCircuitPeeringImpl withAzureAsn(Integer azureAsn) { + this.innerModel().withAzureAsn(azureAsn); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPeerAsn(Long peerAsn) { + this.innerModel().withPeerAsn(peerAsn); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.innerModel().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + public ExpressRouteCircuitPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.innerModel().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPrimaryAzurePort(String primaryAzurePort) { + this.innerModel().withPrimaryAzurePort(primaryAzurePort); + return this; + } + + public ExpressRouteCircuitPeeringImpl withSecondaryAzurePort(String secondaryAzurePort) { + this.innerModel().withSecondaryAzurePort(secondaryAzurePort); + return this; + } + + public ExpressRouteCircuitPeeringImpl withSharedKey(String sharedKey) { + this.innerModel().withSharedKey(sharedKey); + return this; + } + + public ExpressRouteCircuitPeeringImpl withVlanId(Integer vlanId) { + this.innerModel().withVlanId(vlanId); + return this; + } + + public ExpressRouteCircuitPeeringImpl withMicrosoftPeeringConfig( + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.innerModel().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + public ExpressRouteCircuitPeeringImpl withStats(ExpressRouteCircuitStatsInner stats) { + this.innerModel().withStats(stats); + return this; + } + + public ExpressRouteCircuitPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.innerModel().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + public ExpressRouteCircuitPeeringImpl withRouteFilter(SubResource routeFilter) { + this.innerModel().withRouteFilter(routeFilter); + return this; + } + + public ExpressRouteCircuitPeeringImpl withIpv6PeeringConfig( + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.innerModel().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + public ExpressRouteCircuitPeeringImpl withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection) { + this.innerModel().withExpressRouteConnection(expressRouteConnection); + return this; + } + + public ExpressRouteCircuitPeeringImpl withConnections(List connections) { + this.innerModel().withConnections(connections); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsClientImpl.java new file mode 100644 index 0000000000000..b424a49e87706 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsClientImpl.java @@ -0,0 +1,1147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteCircuitPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringListResult; +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 ExpressRouteCircuitPeeringsClient. */ +public final class ExpressRouteCircuitPeeringsClientImpl implements ExpressRouteCircuitPeeringsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCircuitPeeringsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitPeeringsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCircuitPeeringsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCircuitPeeringsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCircuitPeerings to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCircuitPeeringsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCircuitPeeringInner peeringParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, circuitName, peeringName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, circuitName, peeringName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName).getSyncPoller(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName, context).getSyncPoller(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, String peeringName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 circuitName, String peeringName) { + deleteAsync(resourceGroupName, circuitName, peeringName).block(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 circuitName, String peeringName, Context context) { + deleteAsync(resourceGroupName, circuitName, peeringName, context).block(); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String circuitName, String peeringName) { + return getWithResponseAsync(resourceGroupName, circuitName, peeringName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName) { + return getAsync(resourceGroupName, circuitName, peeringName).block(); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return getWithResponseAsync(resourceGroupName, circuitName, peeringName, context).block(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (peeringParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringParameters is required and cannot be null.")); + } else { + peeringParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + peeringParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (peeringParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringParameters is required and cannot be null.")); + } else { + peeringParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + peeringParameters, + accept, + context); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCircuitPeeringInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitPeeringInner.class, + ExpressRouteCircuitPeeringInner.class, + Context.NONE); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCircuitPeeringInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitPeeringInner.class, + ExpressRouteCircuitPeeringInner.class, + context); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitPeeringInner createOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).block(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitPeeringInner createOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters, context).block(); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String circuitName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String circuitName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String circuitName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String circuitName) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName)); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, 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 response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. + */ + @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 response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsImpl.java new file mode 100644 index 0000000000000..6edfcefac376d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsImpl.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.network.generated.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.network.generated.fluent.ExpressRouteCircuitPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeering; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeerings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCircuitPeeringsImpl implements ExpressRouteCircuitPeerings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringsImpl.class); + + private final ExpressRouteCircuitPeeringsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCircuitPeeringsImpl( + ExpressRouteCircuitPeeringsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String circuitName, String peeringName) { + this.serviceClient().delete(resourceGroupName, circuitName, peeringName); + } + + public void delete(String resourceGroupName, String circuitName, String peeringName, Context context) { + this.serviceClient().delete(resourceGroupName, circuitName, peeringName, context); + } + + public ExpressRouteCircuitPeering get(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringInner inner = this.serviceClient().get(resourceGroupName, circuitName, peeringName); + if (inner != null) { + return new ExpressRouteCircuitPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, circuitName, peeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitPeeringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String circuitName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitPeering 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, peeringName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, peeringName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, context); + } + + private ExpressRouteCircuitPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitPeeringImpl define(String name) { + return new ExpressRouteCircuitPeeringImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.java new file mode 100644 index 0000000000000..faf12e8c1596a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitStats; + +public final class ExpressRouteCircuitStatsImpl implements ExpressRouteCircuitStats { + private ExpressRouteCircuitStatsInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitStatsImpl( + ExpressRouteCircuitStatsInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Long primarybytesIn() { + return this.innerModel().primarybytesIn(); + } + + public Long primarybytesOut() { + return this.innerModel().primarybytesOut(); + } + + public Long secondarybytesIn() { + return this.innerModel().secondarybytesIn(); + } + + public Long secondarybytesOut() { + return this.innerModel().secondarybytesOut(); + } + + public ExpressRouteCircuitStatsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.java new file mode 100644 index 0000000000000..f97a3b071ce5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitArpTable; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsArpTableListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCircuitsArpTableListResultImpl implements ExpressRouteCircuitsArpTableListResult { + private ExpressRouteCircuitsArpTableListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitsArpTableListResultImpl( + ExpressRouteCircuitsArpTableListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCircuitsArpTableListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java new file mode 100644 index 0000000000000..7124504bd0e92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java @@ -0,0 +1,2747 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteCircuitsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 ExpressRouteCircuitsClient. */ +public final class ExpressRouteCircuitsClientImpl implements ExpressRouteCircuitsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCircuitsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCircuitsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ExpressRouteCircuitsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCircuits to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCircuitsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCircuitInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listArpTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTableSummary( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/stats") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getStats( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPeeringStats( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{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> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, circuitName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, circuitName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName) { + return beginDeleteAsync(resourceGroupName, circuitName).getSyncPoller(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, context).getSyncPoller(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName) { + return beginDeleteAsync(resourceGroupName, circuitName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 circuitName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 circuitName) { + deleteAsync(resourceGroupName, circuitName).block(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 circuitName, Context context) { + deleteAsync(resourceGroupName, circuitName, context).block(); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String circuitName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String circuitName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String circuitName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, circuitName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) { + return getByResourceGroupAsync(resourceGroupName, circuitName).block(); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String circuitName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, circuitName, context).block(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCircuitInner> beginCreateOrUpdateAsync( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, circuitName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitInner.class, + ExpressRouteCircuitInner.class, + Context.NONE); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCircuitInner> beginCreateOrUpdateAsync( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, circuitName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitInner.class, + ExpressRouteCircuitInner.class, + context); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitInner createOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateAsync(resourceGroupName, circuitName, parameters).block(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitInner createOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, circuitName, parameters, context).block(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String circuitName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String circuitName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String circuitName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, circuitName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, circuitName, parameters).block(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String circuitName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, circuitName, parameters, context).block(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listArpTableWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listArpTable( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listArpTableWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listArpTable( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + Mono>> mono = + listArpTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsArpTableListResultInner.class, + ExpressRouteCircuitsArpTableListResultInner.class, + Context.NONE); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTableAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listArpTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsArpTableListResultInner.class, + ExpressRouteCircuitsArpTableListResultInner.class, + context); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).getSyncPoller(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context).getSyncPoller(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listArpTableAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listArpTableAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsArpTableListResultInner listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).block(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsArpTableListResultInner listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context).block(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listRoutesTableWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRoutesTable( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listRoutesTableWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRoutesTable( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + Mono>> mono = + listRoutesTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableListResultInner.class, + ExpressRouteCircuitsRoutesTableListResultInner.class, + Context.NONE); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTableAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listRoutesTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableListResultInner.class, + ExpressRouteCircuitsRoutesTableListResultInner.class, + context); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).getSyncPoller(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRoutesTableAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRoutesTableAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).block(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context).block(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listRoutesTableSummaryWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRoutesTableSummary( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listRoutesTableSummaryWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRoutesTableSummary( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummaryAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + Mono>> mono = + listRoutesTableSummaryWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, + ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, + Context.NONE); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummaryAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listRoutesTableSummaryWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, + ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, + context); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRoutesTableSummaryAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRoutesTableSummaryAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath).block(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath, context).block(); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getStatsWithResponseAsync( + String resourceGroupName, String circuitName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getStats( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getStatsWithResponseAsync( + String resourceGroupName, String circuitName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getStats( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStatsAsync(String resourceGroupName, String circuitName) { + return getStatsWithResponseAsync(resourceGroupName, circuitName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { + return getStatsAsync(resourceGroupName, circuitName).block(); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStatsWithResponse( + String resourceGroupName, String circuitName, Context context) { + return getStatsWithResponseAsync(resourceGroupName, circuitName, context).block(); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPeeringStatsWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPeeringStats( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPeeringStatsWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPeeringStats( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPeeringStatsAsync( + String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithResponseAsync(resourceGroupName, circuitName, peeringName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitStatsInner getPeeringStats( + String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsAsync(resourceGroupName, circuitName, peeringName).block(); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPeeringStatsWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return getPeeringStatsWithResponseAsync(resourceGroupName, circuitName, peeringName, context).block(); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the express route circuits 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 all the express route circuits in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the express route circuits 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 all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the express route circuits 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 all the express route circuits in a subscription. + */ + @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 response for ListExpressRouteCircuit API service call. + */ + @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 response for ListExpressRouteCircuit API service call. + */ + @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 response for ListExpressRouteCircuit API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListExpressRouteCircuit API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsImpl.java new file mode 100644 index 0000000000000..9caddc64091dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsImpl.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteCircuitsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuit; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitStats; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuits; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsArpTableListResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableListResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCircuitsImpl implements ExpressRouteCircuits { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsImpl.class); + + private final ExpressRouteCircuitsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCircuitsImpl( + ExpressRouteCircuitsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String circuitName) { + this.serviceClient().delete(resourceGroupName, circuitName); + } + + public void delete(String resourceGroupName, String circuitName, Context context) { + this.serviceClient().delete(resourceGroupName, circuitName, context); + } + + public ExpressRouteCircuit getByResourceGroup(String resourceGroupName, String circuitName) { + ExpressRouteCircuitInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, circuitName); + if (inner != null) { + return new ExpressRouteCircuitImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String circuitName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, circuitName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsArpTableListResultInner inner = + this.serviceClient().listArpTable(resourceGroupName, circuitName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsArpTableListResultInner inner = + this.serviceClient().listArpTable(resourceGroupName, circuitName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsRoutesTableListResultInner inner = + this.serviceClient().listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsRoutesTableListResultInner inner = + this.serviceClient().listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsRoutesTableSummaryListResultInner inner = + this.serviceClient().listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableSummaryListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsRoutesTableSummaryListResultInner inner = + this + .serviceClient() + .listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableSummaryListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitStats getStats(String resourceGroupName, String circuitName) { + ExpressRouteCircuitStatsInner inner = this.serviceClient().getStats(resourceGroupName, circuitName); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getStatsWithResponse( + String resourceGroupName, String circuitName, Context context) { + Response inner = + this.serviceClient().getStatsWithResponse(resourceGroupName, circuitName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitStatsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteCircuitStats getPeeringStats(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitStatsInner inner = + this.serviceClient().getPeeringStats(resourceGroupName, circuitName, peeringName); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPeeringStatsWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context) { + Response inner = + this.serviceClient().getPeeringStatsWithResponse(resourceGroupName, circuitName, peeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitStatsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public ExpressRouteCircuit 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, circuitName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, circuitName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + this.delete(resourceGroupName, circuitName, 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 circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + this.delete(resourceGroupName, circuitName, context); + } + + private ExpressRouteCircuitsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitImpl define(String name) { + return new ExpressRouteCircuitImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java new file mode 100644 index 0000000000000..382f256d5259a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTable; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCircuitsRoutesTableListResultImpl implements ExpressRouteCircuitsRoutesTableListResult { + private ExpressRouteCircuitsRoutesTableListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitsRoutesTableListResultImpl( + ExpressRouteCircuitsRoutesTableListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCircuitsRoutesTableListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..0de4999c4953d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTableSummary; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableSummaryListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCircuitsRoutesTableSummaryListResultImpl + implements ExpressRouteCircuitsRoutesTableSummaryListResult { + private ExpressRouteCircuitsRoutesTableSummaryListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitsRoutesTableSummaryListResultImpl( + ExpressRouteCircuitsRoutesTableSummaryListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCircuitsRoutesTableSummaryListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.java new file mode 100644 index 0000000000000..bb9cd2cf33e5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; + +public final class ExpressRouteConnectionImpl implements ExpressRouteConnection { + private ExpressRouteConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteConnectionImpl( + ExpressRouteConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { + return this.innerModel().expressRouteCircuitPeering(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public Integer routingWeight() { + return this.innerModel().routingWeight(); + } + + public Boolean enableInternetSecurity() { + return this.innerModel().enableInternetSecurity(); + } + + public Boolean expressRouteGatewayBypass() { + return this.innerModel().expressRouteGatewayBypass(); + } + + public RoutingConfiguration routingConfiguration() { + return this.innerModel().routingConfiguration(); + } + + public ExpressRouteConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionListImpl.java new file mode 100644 index 0000000000000..78141ec0b225e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionListImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ExpressRouteConnectionListImpl implements ExpressRouteConnectionList { + private ExpressRouteConnectionListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteConnectionListImpl( + ExpressRouteConnectionListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ExpressRouteConnectionListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java new file mode 100644 index 0000000000000..4d2fd3ac112e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java @@ -0,0 +1,1079 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.network.generated.fluent.ExpressRouteConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +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 ExpressRouteConnectionsClient. */ +public final class ExpressRouteConnectionsClientImpl implements ExpressRouteConnectionsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ExpressRouteConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteConnectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteConnectionInner putExpressRouteConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (putExpressRouteConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter putExpressRouteConnectionParameters is required and cannot be null.")); + } else { + putExpressRouteConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + putExpressRouteConnectionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (putExpressRouteConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter putExpressRouteConnectionParameters is required and cannot be null.")); + } else { + putExpressRouteConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + putExpressRouteConnectionParameters, + accept, + context); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteConnectionInner.class, + ExpressRouteConnectionInner.class, + Context.NONE); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + expressRouteGatewayName, + connectionName, + putExpressRouteConnectionParameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteConnectionInner.class, + ExpressRouteConnectionInner.class, + context); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters) + .getSyncPoller(); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + expressRouteGatewayName, + connectionName, + putExpressRouteConnectionParameters, + context) + .getSyncPoller(); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + expressRouteGatewayName, + connectionName, + putExpressRouteConnectionParameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteConnectionInner createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return createOrUpdateAsync( + resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters) + .block(); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteConnectionInner createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + expressRouteGatewayName, + connectionName, + putExpressRouteConnectionParameters, + context) + .block(); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String expressRouteGatewayName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return getWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteConnectionInner get( + String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return getAsync(resourceGroupName, expressRouteGatewayName, connectionName).block(); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, context).block(); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, String connectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, String connectionName) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).getSyncPoller(); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, String connectionName) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 expressRouteGatewayName, String connectionName) { + deleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).block(); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 expressRouteGatewayName, String connectionName, Context context) { + deleteAsync(resourceGroupName, expressRouteGatewayName, connectionName, context).block(); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String expressRouteGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String expressRouteGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String expressRouteGatewayName) { + return listWithResponseAsync(resourceGroupName, expressRouteGatewayName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteConnectionListInner list(String resourceGroupName, String expressRouteGatewayName) { + return listAsync(resourceGroupName, expressRouteGatewayName).block(); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context) { + return listWithResponseAsync(resourceGroupName, expressRouteGatewayName, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsImpl.java new file mode 100644 index 0000000000000..5746bbc47ab82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsImpl.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.network.generated.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.network.generated.fluent.ExpressRouteConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionList; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteConnectionsImpl implements ExpressRouteConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionsImpl.class); + + private final ExpressRouteConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteConnectionsImpl( + ExpressRouteConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + ExpressRouteConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters); + if (inner != null) { + return new ExpressRouteConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context) { + ExpressRouteConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + expressRouteGatewayName, + connectionName, + putExpressRouteConnectionParameters, + context); + if (inner != null) { + return new ExpressRouteConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteConnection get(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + ExpressRouteConnectionInner inner = + this.serviceClient().get(resourceGroupName, expressRouteGatewayName, connectionName); + if (inner != null) { + return new ExpressRouteConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, expressRouteGatewayName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + this.serviceClient().delete(resourceGroupName, expressRouteGatewayName, connectionName); + } + + public void delete( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, expressRouteGatewayName, connectionName, context); + } + + public ExpressRouteConnectionList list(String resourceGroupName, String expressRouteGatewayName) { + ExpressRouteConnectionListInner inner = this.serviceClient().list(resourceGroupName, expressRouteGatewayName); + if (inner != null) { + return new ExpressRouteConnectionListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, expressRouteGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteConnectionListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ExpressRouteConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionImpl.java new file mode 100644 index 0000000000000..73db8adac6477 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionImpl.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitReference; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeering; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ExpressRouteCrossConnectionImpl + implements ExpressRouteCrossConnection, ExpressRouteCrossConnection.Definition, ExpressRouteCrossConnection.Update { + private ExpressRouteCrossConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public String primaryAzurePort() { + return this.innerModel().primaryAzurePort(); + } + + public String secondaryAzurePort() { + return this.innerModel().secondaryAzurePort(); + } + + public Integer stag() { + return this.innerModel().stag(); + } + + public String peeringLocation() { + return this.innerModel().peeringLocation(); + } + + public Integer bandwidthInMbps() { + return this.innerModel().bandwidthInMbps(); + } + + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.innerModel().expressRouteCircuit(); + } + + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.innerModel().serviceProviderProvisioningState(); + } + + public String serviceProviderNotes() { + return this.innerModel().serviceProviderNotes(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List peerings() { + List inner = this.innerModel().peerings(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteCrossConnectionPeeringImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExpressRouteCrossConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String crossConnectionName; + + private TagsObject updateCrossConnectionParameters; + + public ExpressRouteCrossConnectionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ExpressRouteCrossConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCrossConnections() + .createOrUpdate(resourceGroupName, crossConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCrossConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCrossConnections() + .createOrUpdate(resourceGroupName, crossConnectionName, this.innerModel(), context); + return this; + } + + ExpressRouteCrossConnectionImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteCrossConnectionInner(); + this.serviceManager = serviceManager; + this.crossConnectionName = name; + } + + public ExpressRouteCrossConnectionImpl update() { + this.updateCrossConnectionParameters = new TagsObject(); + return this; + } + + public ExpressRouteCrossConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCrossConnections() + .updateTagsWithResponse( + resourceGroupName, crossConnectionName, updateCrossConnectionParameters, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCrossConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCrossConnections() + .updateTagsWithResponse( + resourceGroupName, crossConnectionName, updateCrossConnectionParameters, context) + .getValue(); + return this; + } + + ExpressRouteCrossConnectionImpl( + ExpressRouteCrossConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.crossConnectionName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCrossConnections"); + } + + public ExpressRouteCrossConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCrossConnections() + .getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCrossConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCrossConnections() + .getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, context) + .getValue(); + return this; + } + + public ExpressRouteCrossConnectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRouteCrossConnectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRouteCrossConnectionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateCrossConnectionParameters.withTags(tags); + return this; + } + } + + public ExpressRouteCrossConnectionImpl withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.innerModel().withExpressRouteCircuit(expressRouteCircuit); + return this; + } + + public ExpressRouteCrossConnectionImpl withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.innerModel().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + public ExpressRouteCrossConnectionImpl withServiceProviderNotes(String serviceProviderNotes) { + this.innerModel().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + public ExpressRouteCrossConnectionImpl withPeerings(List peerings) { + this.innerModel().withPeerings(peerings); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringImpl.java new file mode 100644 index 0000000000000..8a557bbceaf0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeering; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRouteCrossConnectionPeeringImpl implements ExpressRouteCrossConnectionPeering { + private ExpressRouteCrossConnectionPeeringInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCrossConnectionPeeringImpl( + ExpressRouteCrossConnectionPeeringInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ExpressRoutePeeringType peeringType() { + return this.innerModel().peeringType(); + } + + public ExpressRoutePeeringState state() { + return this.innerModel().state(); + } + + public Integer azureAsn() { + return this.innerModel().azureAsn(); + } + + public Long peerAsn() { + return this.innerModel().peerAsn(); + } + + public String primaryPeerAddressPrefix() { + return this.innerModel().primaryPeerAddressPrefix(); + } + + public String secondaryPeerAddressPrefix() { + return this.innerModel().secondaryPeerAddressPrefix(); + } + + public String primaryAzurePort() { + return this.innerModel().primaryAzurePort(); + } + + public String secondaryAzurePort() { + return this.innerModel().secondaryAzurePort(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public Integer vlanId() { + return this.innerModel().vlanId(); + } + + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.innerModel().microsoftPeeringConfig(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String gatewayManagerEtag() { + return this.innerModel().gatewayManagerEtag(); + } + + public String lastModifiedBy() { + return this.innerModel().lastModifiedBy(); + } + + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.innerModel().ipv6PeeringConfig(); + } + + public ExpressRouteCrossConnectionPeeringInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java new file mode 100644 index 0000000000000..adfb958939486 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java @@ -0,0 +1,1182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteCrossConnectionPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeeringList; +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 ExpressRouteCrossConnectionPeeringsClient. + */ +public final class ExpressRouteCrossConnectionPeeringsClientImpl implements ExpressRouteCrossConnectionPeeringsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCrossConnectionPeeringsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionPeeringsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCrossConnectionPeeringsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCrossConnectionPeeringsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCrossConnectionPeerings to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCrossConnectionPeeringsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCrossConnectionPeeringInner peeringParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String crossConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String crossConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String crossConnectionName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, crossConnectionName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String crossConnectionName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, crossConnectionName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String crossConnectionName) { + return new PagedIterable<>(listAsync(resourceGroupName, crossConnectionName)); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String crossConnectionName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, crossConnectionName, context)); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 crossConnectionName, String peeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 crossConnectionName, String peeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 crossConnectionName, String peeringName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, crossConnectionName, peeringName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 crossConnectionName, String peeringName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 crossConnectionName, String peeringName) { + return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName).getSyncPoller(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 crossConnectionName, String peeringName, Context context) { + return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName, context).getSyncPoller(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 crossConnectionName, String peeringName) { + return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 crossConnectionName, String peeringName, Context context) { + return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 crossConnectionName, String peeringName) { + deleteAsync(resourceGroupName, crossConnectionName, peeringName).block(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 crossConnectionName, String peeringName, Context context) { + deleteAsync(resourceGroupName, crossConnectionName, peeringName, context).block(); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String crossConnectionName, String peeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String crossConnectionName, String peeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String crossConnectionName, String peeringName) { + return getWithResponseAsync(resourceGroupName, crossConnectionName, peeringName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionPeeringInner get( + String resourceGroupName, String crossConnectionName, String peeringName) { + return getAsync(resourceGroupName, crossConnectionName, peeringName).block(); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String crossConnectionName, String peeringName, Context context) { + return getWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, context).block(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (peeringParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringParameters is required and cannot be null.")); + } else { + peeringParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + peeringParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (peeringParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringParameters is required and cannot be null.")); + } else { + peeringParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + peeringParameters, + accept, + context); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCrossConnectionPeeringInner.class, + ExpressRouteCrossConnectionPeeringInner.class, + Context.NONE); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, crossConnectionName, peeringName, peeringParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCrossConnectionPeeringInner.class, + ExpressRouteCrossConnectionPeeringInner.class, + context); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionPeeringInner createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return createOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).block(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionPeeringInner createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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 response for ListPeering API service call retrieves all peerings that belong to an + * ExpressRouteCrossConnection. + */ + @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 response for ListPeering API service call retrieves all peerings that belong to an + * ExpressRouteCrossConnection. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsImpl.java new file mode 100644 index 0000000000000..350ff56e55e6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsImpl.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteCrossConnectionPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeering; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeerings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCrossConnectionPeeringsImpl implements ExpressRouteCrossConnectionPeerings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringsImpl.class); + + private final ExpressRouteCrossConnectionPeeringsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCrossConnectionPeeringsImpl( + ExpressRouteCrossConnectionPeeringsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String crossConnectionName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, crossConnectionName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String crossConnectionName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, crossConnectionName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionPeeringImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String crossConnectionName, String peeringName) { + this.serviceClient().delete(resourceGroupName, crossConnectionName, peeringName); + } + + public void delete(String resourceGroupName, String crossConnectionName, String peeringName, Context context) { + this.serviceClient().delete(resourceGroupName, crossConnectionName, peeringName, context); + } + + public ExpressRouteCrossConnectionPeering get( + String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringInner inner = + this.serviceClient().get(resourceGroupName, crossConnectionName, peeringName); + if (inner != null) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String crossConnectionName, String peeringName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, crossConnectionName, peeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCrossConnectionPeeringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteCrossConnectionPeering createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters) { + ExpressRouteCrossConnectionPeeringInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters); + if (inner != null) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCrossConnectionPeering createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context) { + ExpressRouteCrossConnectionPeeringInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, context); + if (inner != null) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + private ExpressRouteCrossConnectionPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsClientImpl.java new file mode 100644 index 0000000000000..51683b824c81c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsClientImpl.java @@ -0,0 +1,2257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.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.network.generated.fluent.ExpressRouteCrossConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 ExpressRouteCrossConnectionsClient. */ +public final class ExpressRouteCrossConnectionsClientImpl implements ExpressRouteCrossConnectionsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCrossConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCrossConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCrossConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCrossConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCrossConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCrossConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject crossConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listArpTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary" + + "/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTableSummary( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String crossConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String crossConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String crossConnectionName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, crossConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupAsync(resourceGroupName, crossConnectionName).block(); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String crossConnectionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, crossConnectionName, context).block(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String crossConnectionName, + ExpressRouteCrossConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCrossConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, crossConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCrossConnectionInner.class, + ExpressRouteCrossConnectionInner.class, + Context.NONE); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteCrossConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String crossConnectionName, + ExpressRouteCrossConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, crossConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCrossConnectionInner.class, + ExpressRouteCrossConnectionInner.class, + context); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCrossConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).getSyncPoller(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteCrossConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String crossConnectionName, + ExpressRouteCrossConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context).getSyncPoller(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String crossConnectionName, + ExpressRouteCrossConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionInner createOrUpdate( + String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).block(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionInner createOrUpdate( + String resourceGroupName, + String crossConnectionName, + ExpressRouteCrossConnectionInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context).block(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (crossConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter crossConnectionParameters is required and cannot be null.")); + } else { + crossConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + crossConnectionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (crossConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter crossConnectionParameters is required and cannot be null.")); + } else { + crossConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + crossConnectionParameters, + accept, + context); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters) { + return updateTagsWithResponseAsync(resourceGroupName, crossConnectionName, crossConnectionParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionInner updateTags( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters) { + return updateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).block(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, context) + .block(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listArpTableWithResponseAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listArpTable( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listArpTableWithResponseAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listArpTable( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTableAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + Mono>> mono = + listArpTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsArpTableListResultInner.class, + ExpressRouteCircuitsArpTableListResultInner.class, + Context.NONE); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTableAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listArpTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsArpTableListResultInner.class, + ExpressRouteCircuitsArpTableListResultInner.class, + context); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).getSyncPoller(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listArpTableAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listArpTableAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsArpTableListResultInner listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).block(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsArpTableListResultInner listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + return listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context).block(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listRoutesTableSummaryWithResponseAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRoutesTableSummary( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listRoutesTableSummaryWithResponseAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRoutesTableSummary( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummaryAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + Mono>> mono = + listRoutesTableSummaryWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, + Context.NONE); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummaryAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listRoutesTableSummaryWithResponseAsync( + resourceGroupName, crossConnectionName, peeringName, devicePath, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, + context); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .getSyncPoller(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + return beginListRoutesTableSummaryAsync( + resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRoutesTableSummaryAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRoutesTableSummaryAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + return beginListRoutesTableSummaryAsync( + resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).block(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + return listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .block(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listRoutesTableWithResponseAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRoutesTable( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listRoutesTableWithResponseAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (crossConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (devicePath == null) { + return Mono.error(new IllegalArgumentException("Parameter devicePath is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRoutesTable( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTableAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + Mono>> mono = + listRoutesTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableListResultInner.class, + ExpressRouteCircuitsRoutesTableListResultInner.class, + Context.NONE); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTableAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listRoutesTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableListResultInner.class, + ExpressRouteCircuitsRoutesTableListResultInner.class, + context); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRoutesTableAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRoutesTableAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).block(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + return listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 response for ListExpressRouteCrossConnection API service call. + */ + @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 response for ListExpressRouteCrossConnection API service call. + */ + @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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsImpl.java new file mode 100644 index 0000000000000..010fe871f1c2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteCrossConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsArpTableListResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableListResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnections; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCrossConnectionsImpl implements ExpressRouteCrossConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionsImpl.class); + + private final ExpressRouteCrossConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCrossConnectionsImpl( + ExpressRouteCrossConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public ExpressRouteCrossConnection getByResourceGroup(String resourceGroupName, String crossConnectionName) { + ExpressRouteCrossConnectionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, crossConnectionName); + if (inner != null) { + return new ExpressRouteCrossConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String crossConnectionName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCrossConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCircuitsArpTableListResultInner inner = + this.serviceClient().listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsArpTableListResultInner inner = + this.serviceClient().listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner = + this + .serviceClient() + .listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner = + this + .serviceClient() + .listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCircuitsRoutesTableListResultInner inner = + this.serviceClient().listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsRoutesTableListResultInner inner = + this + .serviceClient() + .listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCrossConnection 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 crossConnectionName = Utils.getValueFromIdByName(id, "expressRouteCrossConnections"); + if (crossConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'expressRouteCrossConnections'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, 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 crossConnectionName = Utils.getValueFromIdByName(id, "expressRouteCrossConnections"); + if (crossConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'expressRouteCrossConnections'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, context); + } + + private ExpressRouteCrossConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCrossConnectionImpl define(String name) { + return new ExpressRouteCrossConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..153898b8c502f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionRoutesTableSummary; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl + implements ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + private ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl( + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.java new file mode 100644 index 0000000000000..f257ef3f9a57f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ExpressRouteGatewayImpl + implements ExpressRouteGateway, ExpressRouteGateway.Definition, ExpressRouteGateway.Update { + private ExpressRouteGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration() { + return this.innerModel().autoScaleConfiguration(); + } + + public List expressRouteConnections() { + List inner = this.innerModel().expressRouteConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualHubId virtualHub() { + return this.innerModel().virtualHub(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExpressRouteGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String expressRouteGatewayName; + + private TagsObject updateExpressRouteGatewayParameters; + + public ExpressRouteGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ExpressRouteGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .createOrUpdate(resourceGroupName, expressRouteGatewayName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .createOrUpdate(resourceGroupName, expressRouteGatewayName, this.innerModel(), context); + return this; + } + + ExpressRouteGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteGatewayInner(); + this.serviceManager = serviceManager; + this.expressRouteGatewayName = name; + } + + public ExpressRouteGatewayImpl update() { + this.updateExpressRouteGatewayParameters = new TagsObject(); + return this; + } + + public ExpressRouteGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .updateTags( + resourceGroupName, expressRouteGatewayName, updateExpressRouteGatewayParameters, Context.NONE); + return this; + } + + public ExpressRouteGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .updateTags(resourceGroupName, expressRouteGatewayName, updateExpressRouteGatewayParameters, context); + return this; + } + + ExpressRouteGatewayImpl( + ExpressRouteGatewayInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRouteGatewayName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteGateways"); + } + + public ExpressRouteGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, context) + .getValue(); + return this; + } + + public ExpressRouteGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRouteGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRouteGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateExpressRouteGatewayParameters.withTags(tags); + return this; + } + } + + public ExpressRouteGatewayImpl withAutoScaleConfiguration( + ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { + this.innerModel().withAutoScaleConfiguration(autoScaleConfiguration); + return this; + } + + public ExpressRouteGatewayImpl withVirtualHub(VirtualHubId virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayListImpl.java new file mode 100644 index 0000000000000..3da3af53a8f27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayListImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ExpressRouteGatewayListImpl implements ExpressRouteGatewayList { + private ExpressRouteGatewayListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteGatewayListImpl( + ExpressRouteGatewayListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteGatewayImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ExpressRouteGatewayListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java new file mode 100644 index 0000000000000..10fc41c29f9a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java @@ -0,0 +1,1425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.network.generated.fluent.ExpressRouteGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 ExpressRouteGatewaysClient. */ +public final class ExpressRouteGatewaysClientImpl implements ExpressRouteGatewaysClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ExpressRouteGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteGateways to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteGatewaysService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteGatewayInner putExpressRouteGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject expressRouteGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists ExpressRoute gateways under a given 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySubscription( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists ExpressRoute gateways under a given 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionWithResponseAsync(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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscription( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Lists ExpressRoute gateways under a given 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listBySubscriptionAsync() { + return listBySubscriptionWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists ExpressRoute gateways under a given 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayListInner listBySubscription() { + return listBySubscriptionAsync().block(); + } + + /** + * Lists ExpressRoute gateways under a given 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listBySubscriptionWithResponse(Context context) { + return listBySubscriptionWithResponseAsync(context).block(); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupWithResponseAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupWithResponseAsync( + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithResponseAsync(resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayListInner listByResourceGroup(String resourceGroupName) { + return listByResourceGroupAsync(resourceGroupName).block(); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource 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 list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByResourceGroupWithResponse( + String resourceGroupName, Context context) { + return listByResourceGroupWithResponseAsync(resourceGroupName, context).block(); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (putExpressRouteGatewayParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter putExpressRouteGatewayParameters is required and cannot be null.")); + } else { + putExpressRouteGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + this.client.getSubscriptionId(), + putExpressRouteGatewayParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (putExpressRouteGatewayParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter putExpressRouteGatewayParameters is required and cannot be null.")); + } else { + putExpressRouteGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + this.client.getSubscriptionId(), + putExpressRouteGatewayParameters, + accept, + context); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteGatewayInner.class, + ExpressRouteGatewayInner.class, + Context.NONE); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteGatewayInner.class, + ExpressRouteGatewayInner.class, + context); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayInner createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return createOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters) + .block(); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayInner createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, context) + .block(); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (expressRouteGatewayParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter expressRouteGatewayParameters is required and cannot be null.")); + } else { + expressRouteGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + expressRouteGatewayParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, + String expressRouteGatewayName, + TagsObject expressRouteGatewayParameters, + 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 (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null.")); + } + if (expressRouteGatewayParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter expressRouteGatewayParameters is required and cannot be null.")); + } else { + expressRouteGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + expressRouteGatewayParameters, + accept, + context); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteGatewayInner> beginUpdateTagsAsync( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteGatewayInner.class, + ExpressRouteGatewayInner.class, + Context.NONE); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteGatewayInner> beginUpdateTagsAsync( + String resourceGroupName, + String expressRouteGatewayName, + TagsObject expressRouteGatewayParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync( + resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteGatewayInner.class, + ExpressRouteGatewayInner.class, + context); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteGatewayInner> beginUpdateTags( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters) { + return beginUpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters) + .getSyncPoller(); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteGatewayInner> beginUpdateTags( + String resourceGroupName, + String expressRouteGatewayName, + TagsObject expressRouteGatewayParameters, + Context context) { + return beginUpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, context) + .getSyncPoller(); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters) { + return beginUpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, + String expressRouteGatewayName, + TagsObject expressRouteGatewayParameters, + Context context) { + return beginUpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayInner updateTags( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters) { + return updateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters).block(); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayInner updateTags( + String resourceGroupName, + String expressRouteGatewayName, + TagsObject expressRouteGatewayParameters, + Context context) { + return updateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, context) + .block(); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String expressRouteGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String expressRouteGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String expressRouteGatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, expressRouteGatewayName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { + return getByResourceGroupAsync(resourceGroupName, expressRouteGatewayName).block(); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, expressRouteGatewayName, context).block(); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRouteGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter expressRouteGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, expressRouteGatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, expressRouteGatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 expressRouteGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 expressRouteGatewayName) { + deleteAsync(resourceGroupName, expressRouteGatewayName).block(); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 expressRouteGatewayName, Context context) { + deleteAsync(resourceGroupName, expressRouteGatewayName, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysImpl.java new file mode 100644 index 0000000000000..820240a9873db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysImpl.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.network.generated.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.network.generated.fluent.ExpressRouteGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayList; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteGatewaysImpl implements ExpressRouteGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewaysImpl.class); + + private final ExpressRouteGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteGatewaysImpl( + ExpressRouteGatewaysClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExpressRouteGatewayList listBySubscription() { + ExpressRouteGatewayListInner inner = this.serviceClient().listBySubscription(); + if (inner != null) { + return new ExpressRouteGatewayListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listBySubscriptionWithResponse(Context context) { + Response inner = this.serviceClient().listBySubscriptionWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteGatewayListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteGatewayList listByResourceGroup(String resourceGroupName) { + ExpressRouteGatewayListInner inner = this.serviceClient().listByResourceGroup(resourceGroupName); + if (inner != null) { + return new ExpressRouteGatewayListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByResourceGroupWithResponse( + String resourceGroupName, Context context) { + Response inner = + this.serviceClient().listByResourceGroupWithResponse(resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteGatewayListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteGateway getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { + ExpressRouteGatewayInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, expressRouteGatewayName); + if (inner != null) { + return new ExpressRouteGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { + this.serviceClient().delete(resourceGroupName, expressRouteGatewayName); + } + + public void delete(String resourceGroupName, String expressRouteGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, expressRouteGatewayName, context); + } + + public ExpressRouteGateway 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 expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, 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 expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, 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 expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + this.delete(resourceGroupName, expressRouteGatewayName, 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 expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + this.delete(resourceGroupName, expressRouteGatewayName, context); + } + + private ExpressRouteGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteGatewayImpl define(String name) { + return new ExpressRouteGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.java new file mode 100644 index 0000000000000..83503263925f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLink; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkConnectorType; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkMacSecConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRouteLinkImpl implements ExpressRouteLink { + private ExpressRouteLinkInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteLinkImpl( + ExpressRouteLinkInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String routerName() { + return this.innerModel().routerName(); + } + + public String interfaceName() { + return this.innerModel().interfaceName(); + } + + public String patchPanelId() { + return this.innerModel().patchPanelId(); + } + + public String rackId() { + return this.innerModel().rackId(); + } + + public ExpressRouteLinkConnectorType connectorType() { + return this.innerModel().connectorType(); + } + + public ExpressRouteLinkAdminState adminState() { + return this.innerModel().adminState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExpressRouteLinkMacSecConfig macSecConfig() { + return this.innerModel().macSecConfig(); + } + + public ExpressRouteLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksClientImpl.java new file mode 100644 index 0000000000000..cec72e80fec87 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksClientImpl.java @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteLinksClient. */ +public final class ExpressRouteLinksClientImpl implements ExpressRouteLinksClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteLinksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteLinksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ExpressRouteLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteLinks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @PathParam("linkName") String linkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}/links") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @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); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink child resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String expressRoutePortName, String linkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + if (linkName == null) { + return Mono.error(new IllegalArgumentException("Parameter linkName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + linkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink child resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String expressRoutePortName, String linkName, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + if (linkName == null) { + return Mono.error(new IllegalArgumentException("Parameter linkName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + linkName, + accept, + context); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink child resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String expressRoutePortName, String linkName) { + return getWithResponseAsync(resourceGroupName, expressRoutePortName, linkName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink child resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName) { + return getAsync(resourceGroupName, expressRoutePortName, linkName).block(); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink child resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String expressRoutePortName, String linkName, Context context) { + return getWithResponseAsync(resourceGroupName, expressRoutePortName, linkName, context).block(); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String expressRoutePortName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + 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())); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String expressRoutePortName, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String expressRoutePortName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, expressRoutePortName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String expressRoutePortName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, expressRoutePortName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String expressRoutePortName) { + return new PagedIterable<>(listAsync(resourceGroupName, expressRoutePortName)); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String expressRoutePortName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, expressRoutePortName, 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 response for ListExpressRouteLinks API service call. + */ + @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 response for ListExpressRouteLinks API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksImpl.java new file mode 100644 index 0000000000000..524226c96c9b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLink; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteLinksImpl implements ExpressRouteLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinksImpl.class); + + private final ExpressRouteLinksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteLinksImpl( + ExpressRouteLinksClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExpressRouteLink get(String resourceGroupName, String expressRoutePortName, String linkName) { + ExpressRouteLinkInner inner = this.serviceClient().get(resourceGroupName, expressRoutePortName, linkName); + if (inner != null) { + return new ExpressRouteLinkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String expressRoutePortName, String linkName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, expressRoutePortName, linkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteLinkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String expressRoutePortName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, expressRoutePortName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteLinkImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String expressRoutePortName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, expressRoutePortName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteLinkImpl(inner1, this.manager())); + } + + private ExpressRouteLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortImpl.java new file mode 100644 index 0000000000000..3913c046b3789 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortImpl.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.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLink; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePort; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsEncapsulation; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ExpressRoutePortImpl + implements ExpressRoutePort, ExpressRoutePort.Definition, ExpressRoutePort.Update { + private ExpressRoutePortInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String peeringLocation() { + return this.innerModel().peeringLocation(); + } + + public Integer bandwidthInGbps() { + return this.innerModel().bandwidthInGbps(); + } + + public Float provisionedBandwidthInGbps() { + return this.innerModel().provisionedBandwidthInGbps(); + } + + public String mtu() { + return this.innerModel().mtu(); + } + + public ExpressRoutePortsEncapsulation encapsulation() { + return this.innerModel().encapsulation(); + } + + public String etherType() { + return this.innerModel().etherType(); + } + + public String allocationDate() { + return this.innerModel().allocationDate(); + } + + public List links() { + List inner = this.innerModel().links(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteLinkImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List circuits() { + List inner = this.innerModel().circuits(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExpressRoutePortInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String expressRoutePortName; + + private TagsObject updateParameters; + + public ExpressRoutePortImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ExpressRoutePort create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .createOrUpdate(resourceGroupName, expressRoutePortName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRoutePort create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .createOrUpdate(resourceGroupName, expressRoutePortName, this.innerModel(), context); + return this; + } + + ExpressRoutePortImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRoutePortInner(); + this.serviceManager = serviceManager; + this.expressRoutePortName = name; + } + + public ExpressRoutePortImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ExpressRoutePort apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .updateTagsWithResponse(resourceGroupName, expressRoutePortName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ExpressRoutePort apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .updateTagsWithResponse(resourceGroupName, expressRoutePortName, updateParameters, context) + .getValue(); + return this; + } + + ExpressRoutePortImpl( + ExpressRoutePortInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRoutePortName = Utils.getValueFromIdByName(innerObject.id(), "ExpressRoutePorts"); + } + + public ExpressRoutePort refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRoutePort refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, context) + .getValue(); + return this; + } + + public ExpressRoutePortImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRoutePortImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRoutePortImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ExpressRoutePortImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ExpressRoutePortImpl withPeeringLocation(String peeringLocation) { + this.innerModel().withPeeringLocation(peeringLocation); + return this; + } + + public ExpressRoutePortImpl withBandwidthInGbps(Integer bandwidthInGbps) { + this.innerModel().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + public ExpressRoutePortImpl withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { + this.innerModel().withEncapsulation(encapsulation); + return this; + } + + public ExpressRoutePortImpl withLinks(List links) { + this.innerModel().withLinks(links); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsClientImpl.java new file mode 100644 index 0000000000000..f8c70c078b02f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsClientImpl.java @@ -0,0 +1,1647 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRoutePortsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortListResult; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaRequest; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 ExpressRoutePortsClient. */ +public final class ExpressRoutePortsClientImpl implements ExpressRoutePortsClient { + private final ClientLogger logger = new ClientLogger(ExpressRoutePortsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRoutePortsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRoutePortsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRoutePortsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ExpressRoutePortsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRoutePorts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRoutePortsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @BodyParam("application/json") ExpressRoutePortInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts") + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRoutePorts/{expressRoutePortName}/generateLoa") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateLoa( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @BodyParam("application/json") GenerateExpressRoutePortsLoaRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String expressRoutePortName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String expressRoutePortName, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + accept, + context); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String expressRoutePortName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, expressRoutePortName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String expressRoutePortName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, expressRoutePortName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName) { + return beginDeleteAsync(resourceGroupName, expressRoutePortName).getSyncPoller(); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String expressRoutePortName, Context context) { + return beginDeleteAsync(resourceGroupName, expressRoutePortName, context).getSyncPoller(); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String expressRoutePortName) { + return beginDeleteAsync(resourceGroupName, expressRoutePortName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String expressRoutePortName, Context context) { + return beginDeleteAsync(resourceGroupName, expressRoutePortName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String expressRoutePortName) { + deleteAsync(resourceGroupName, expressRoutePortName).block(); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String expressRoutePortName, Context context) { + deleteAsync(resourceGroupName, expressRoutePortName, context).block(); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String expressRoutePortName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String expressRoutePortName, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + accept, + context); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String expressRoutePortName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, expressRoutePortName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName) { + return getByResourceGroupAsync(resourceGroupName, expressRoutePortName).block(); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRoutePortName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, expressRoutePortName, context).block(); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + parameters, + accept, + context); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRoutePortInner> beginCreateOrUpdateAsync( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, expressRoutePortName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRoutePortInner.class, + ExpressRoutePortInner.class, + Context.NONE); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRoutePortInner> beginCreateOrUpdateAsync( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, expressRoutePortName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExpressRoutePortInner.class, ExpressRoutePortInner.class, context); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortInner createOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return createOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters).block(); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortInner createOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters, context).block(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to update ExpressRoutePort resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String expressRoutePortName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to update ExpressRoutePort resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String expressRoutePortName, TagsObject parameters, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + parameters, + accept, + context); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to update ExpressRoutePort resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String expressRoutePortName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, expressRoutePortName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to update ExpressRoutePort resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortInner updateTags( + String resourceGroupName, String expressRoutePortName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, expressRoutePortName, parameters).block(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to update ExpressRoutePort resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String expressRoutePortName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, expressRoutePortName, parameters, context).block(); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of 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 response for GenerateExpressRoutePortsLOA API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateLoaWithResponseAsync( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateLoa( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + request, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of 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 response for GenerateExpressRoutePortsLOA API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateLoaWithResponseAsync( + String resourceGroupName, + String expressRoutePortName, + GenerateExpressRoutePortsLoaRequest request, + 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateLoa( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + resourceGroupName, + expressRoutePortName, + request, + accept, + context); + } + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of 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 response for GenerateExpressRoutePortsLOA API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateLoaAsync( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request) { + return generateLoaWithResponseAsync(resourceGroupName, expressRoutePortName, request) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of 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 response for GenerateExpressRoutePortsLOA API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenerateExpressRoutePortsLoaResultInner generateLoa( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request) { + return generateLoaAsync(resourceGroupName, expressRoutePortName, request).block(); + } + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of 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 response for GenerateExpressRoutePortsLOA API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateLoaWithResponse( + String resourceGroupName, + String expressRoutePortName, + GenerateExpressRoutePortsLoaRequest request, + Context context) { + return generateLoaWithResponseAsync(resourceGroupName, expressRoutePortName, request, 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for ListExpressRoutePorts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 response for ListExpressRoutePorts API service call. + */ + @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 response for ListExpressRoutePorts API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsImpl.java new file mode 100644 index 0000000000000..6a6e8719b9303 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsImpl.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.network.generated.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.network.generated.fluent.ExpressRoutePortsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePort; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePorts; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaRequest; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRoutePortsImpl implements ExpressRoutePorts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsImpl.class); + + private final ExpressRoutePortsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRoutePortsImpl( + ExpressRoutePortsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String expressRoutePortName) { + this.serviceClient().delete(resourceGroupName, expressRoutePortName); + } + + public void delete(String resourceGroupName, String expressRoutePortName, Context context) { + this.serviceClient().delete(resourceGroupName, expressRoutePortName, context); + } + + public ExpressRoutePort getByResourceGroup(String resourceGroupName, String expressRoutePortName) { + ExpressRoutePortInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, expressRoutePortName); + if (inner != null) { + return new ExpressRoutePortImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRoutePortName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRoutePortImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public GenerateExpressRoutePortsLoaResult generateLoa( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request) { + GenerateExpressRoutePortsLoaResultInner inner = + this.serviceClient().generateLoa(resourceGroupName, expressRoutePortName, request); + if (inner != null) { + return new GenerateExpressRoutePortsLoaResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateLoaWithResponse( + String resourceGroupName, + String expressRoutePortName, + GenerateExpressRoutePortsLoaRequest request, + Context context) { + Response inner = + this.serviceClient().generateLoaWithResponse(resourceGroupName, expressRoutePortName, request, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GenerateExpressRoutePortsLoaResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRoutePort 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 expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, 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 expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, 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 expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + this.delete(resourceGroupName, expressRoutePortName, 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 expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + this.delete(resourceGroupName, expressRoutePortName, context); + } + + private ExpressRoutePortsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRoutePortImpl define(String name) { + return new ExpressRoutePortImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.java new file mode 100644 index 0000000000000..707f7023f1585 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocation; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationBandwidths; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ExpressRoutePortsLocationImpl implements ExpressRoutePortsLocation { + private ExpressRoutePortsLocationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRoutePortsLocationImpl( + ExpressRoutePortsLocationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 String address() { + return this.innerModel().address(); + } + + public String contact() { + return this.innerModel().contact(); + } + + public List availableBandwidths() { + List inner = this.innerModel().availableBandwidths(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public ExpressRoutePortsLocationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsClientImpl.java new file mode 100644 index 0000000000000..b0834d810cc0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsClientImpl.java @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRoutePortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRoutePortsLocationsClient. */ +public final class ExpressRoutePortsLocationsClientImpl implements ExpressRoutePortsLocationsClient { + private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRoutePortsLocationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRoutePortsLocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRoutePortsLocationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRoutePortsLocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRoutePortsLocations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRoutePortsLocationsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("locationName") String locationName, + @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); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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())); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the ExpressRoutePorts peering location resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String locationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + locationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the ExpressRoutePorts peering location resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String locationName, 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 (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, locationName, accept, context); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the ExpressRoutePorts peering location resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locationName) { + return getWithResponseAsync(locationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the ExpressRoutePorts peering location resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortsLocationInner get(String locationName) { + return getAsync(locationName).block(); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the ExpressRoutePorts peering location resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String locationName, Context context) { + return getWithResponseAsync(locationName, 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 response for ListExpressRoutePortsLocations API service call. + */ + @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 response for ListExpressRoutePortsLocations API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsImpl.java new file mode 100644 index 0000000000000..00b5f2a4b688a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsImpl.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.network.generated.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.network.generated.fluent.ExpressRoutePortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocation; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRoutePortsLocationsImpl implements ExpressRoutePortsLocations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationsImpl.class); + + private final ExpressRoutePortsLocationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRoutePortsLocationsImpl( + ExpressRoutePortsLocationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortsLocationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortsLocationImpl(inner1, this.manager())); + } + + public ExpressRoutePortsLocation get(String locationName) { + ExpressRoutePortsLocationInner inner = this.serviceClient().get(locationName); + if (inner != null) { + return new ExpressRoutePortsLocationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String locationName, Context context) { + Response inner = this.serviceClient().getWithResponse(locationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRoutePortsLocationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ExpressRoutePortsLocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProviderImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProviderImpl.java new file mode 100644 index 0000000000000..4c792cad55a27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProviderImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProvider; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviderBandwidthsOffered; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ExpressRouteServiceProviderImpl implements ExpressRouteServiceProvider { + private ExpressRouteServiceProviderInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteServiceProviderImpl( + ExpressRouteServiceProviderInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 List peeringLocations() { + List inner = this.innerModel().peeringLocations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List bandwidthsOffered() { + List inner = this.innerModel().bandwidthsOffered(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public ExpressRouteServiceProviderInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersClientImpl.java new file mode 100644 index 0000000000000..939ea653e9780 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersClientImpl.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteServiceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviderListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteServiceProvidersClient. */ +public final class ExpressRouteServiceProvidersClientImpl implements ExpressRouteServiceProvidersClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteServiceProvidersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteServiceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteServiceProvidersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteServiceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteServiceProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteServiceProvidersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the available express route service providers. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the available express route service providers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the available express route service providers. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the available express route service providers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the available express route service providers. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the available express route service providers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @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 response for the ListExpressRouteServiceProvider API service call. + */ + @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 response for the ListExpressRouteServiceProvider API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersImpl.java new file mode 100644 index 0000000000000..57cb6e25fc1bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ExpressRouteServiceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProvider; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviders; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteServiceProvidersImpl implements ExpressRouteServiceProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProvidersImpl.class); + + private final ExpressRouteServiceProvidersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteServiceProvidersImpl( + ExpressRouteServiceProvidersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRouteServiceProviderImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteServiceProviderImpl(inner1, this.manager())); + } + + private ExpressRouteServiceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java new file mode 100644 index 0000000000000..42115f6c631e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java @@ -0,0 +1,1289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.FirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyListResult; +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 FirewallPoliciesClient. */ +public final class FirewallPoliciesClientImpl implements FirewallPoliciesClient { + private final ClientLogger logger = new ClientLogger(FirewallPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FirewallPoliciesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPoliciesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(FirewallPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface FirewallPoliciesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FirewallPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{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> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, firewallPolicyName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, firewallPolicyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName).getSyncPoller(); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName, context).getSyncPoller(); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 firewallPolicyName) { + deleteAsync(resourceGroupName, firewallPolicyName).block(); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 firewallPolicyName, Context context) { + deleteAsync(resourceGroupName, firewallPolicyName, context).block(); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String firewallPolicyName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String firewallPolicyName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String firewallPolicyName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, firewallPolicyName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String firewallPolicyName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, firewallPolicyName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyInner getByResourceGroup(String resourceGroupName, String firewallPolicyName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, firewallPolicyName, expand).block(); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String firewallPolicyName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, firewallPolicyName, expand, context).block(); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FirewallPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, firewallPolicyName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FirewallPolicyInner.class, + FirewallPolicyInner.class, + Context.NONE); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FirewallPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, firewallPolicyName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FirewallPolicyInner.class, FirewallPolicyInner.class, context); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FirewallPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FirewallPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyInner createOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters).block(); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyInner createOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters, context).block(); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Firewall Policies 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 all the Firewall Policies in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Firewall Policies 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 all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Firewall Policies 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 all the Firewall Policies in a subscription. + */ + @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 response for ListFirewallPolicies API service call. + */ + @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 response for ListFirewallPolicies API service call. + */ + @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 response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesImpl.java new file mode 100644 index 0000000000000..e7931690efcaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.FirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicies; +import com.azure.resourcemanager.network.generated.models.FirewallPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FirewallPoliciesImpl implements FirewallPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPoliciesImpl.class); + + private final FirewallPoliciesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPoliciesImpl( + FirewallPoliciesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String firewallPolicyName) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName); + } + + public void delete(String resourceGroupName, String firewallPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName, context); + } + + public FirewallPolicy getByResourceGroup(String resourceGroupName, String firewallPolicyName) { + FirewallPolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, firewallPolicyName); + if (inner != null) { + return new FirewallPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String firewallPolicyName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FirewallPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public FirewallPolicy 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 firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, expand, 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 firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + this.delete(resourceGroupName, firewallPolicyName, 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 firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + this.delete(resourceGroupName, firewallPolicyName, context); + } + + private FirewallPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public FirewallPolicyImpl define(String name) { + return new FirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyImpl.java new file mode 100644 index 0000000000000..803544c730dbc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyImpl.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.FirewallPolicy; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySku; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyTransportSecurity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class FirewallPolicyImpl implements FirewallPolicy, FirewallPolicy.Definition, FirewallPolicy.Update { + private FirewallPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public List ruleCollectionGroups() { + List inner = this.innerModel().ruleCollectionGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SubResource basePolicy() { + return this.innerModel().basePolicy(); + } + + public List firewalls() { + List inner = this.innerModel().firewalls(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List childPolicies() { + List inner = this.innerModel().childPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AzureFirewallThreatIntelMode threatIntelMode() { + return this.innerModel().threatIntelMode(); + } + + public FirewallPolicyThreatIntelWhitelist threatIntelWhitelist() { + return this.innerModel().threatIntelWhitelist(); + } + + public FirewallPolicyInsights insights() { + return this.innerModel().insights(); + } + + public FirewallPolicySnat snat() { + return this.innerModel().snat(); + } + + public DnsSettings dnsSettings() { + return this.innerModel().dnsSettings(); + } + + public FirewallPolicyIntrusionDetection intrusionDetection() { + return this.innerModel().intrusionDetection(); + } + + public FirewallPolicyTransportSecurity transportSecurity() { + return this.innerModel().transportSecurity(); + } + + public FirewallPolicySku sku() { + return this.innerModel().sku(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public FirewallPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String firewallPolicyName; + + public FirewallPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public FirewallPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .createOrUpdate(resourceGroupName, firewallPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public FirewallPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .createOrUpdate(resourceGroupName, firewallPolicyName, this.innerModel(), context); + return this; + } + + FirewallPolicyImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new FirewallPolicyInner(); + this.serviceManager = serviceManager; + this.firewallPolicyName = name; + } + + public FirewallPolicyImpl update() { + return this; + } + + public FirewallPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .createOrUpdate(resourceGroupName, firewallPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public FirewallPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .createOrUpdate(resourceGroupName, firewallPolicyName, this.innerModel(), context); + return this; + } + + FirewallPolicyImpl( + FirewallPolicyInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.firewallPolicyName = Utils.getValueFromIdByName(innerObject.id(), "firewallPolicies"); + } + + public FirewallPolicy refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public FirewallPolicy refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, localExpand, context) + .getValue(); + return this; + } + + public FirewallPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FirewallPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FirewallPolicyImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public FirewallPolicyImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public FirewallPolicyImpl withBasePolicy(SubResource basePolicy) { + this.innerModel().withBasePolicy(basePolicy); + return this; + } + + public FirewallPolicyImpl withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { + this.innerModel().withThreatIntelMode(threatIntelMode); + return this; + } + + public FirewallPolicyImpl withThreatIntelWhitelist(FirewallPolicyThreatIntelWhitelist threatIntelWhitelist) { + this.innerModel().withThreatIntelWhitelist(threatIntelWhitelist); + return this; + } + + public FirewallPolicyImpl withInsights(FirewallPolicyInsights insights) { + this.innerModel().withInsights(insights); + return this; + } + + public FirewallPolicyImpl withSnat(FirewallPolicySnat snat) { + this.innerModel().withSnat(snat); + return this; + } + + public FirewallPolicyImpl withDnsSettings(DnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + public FirewallPolicyImpl withIntrusionDetection(FirewallPolicyIntrusionDetection intrusionDetection) { + this.innerModel().withIntrusionDetection(intrusionDetection); + return this; + } + + public FirewallPolicyImpl withTransportSecurity(FirewallPolicyTransportSecurity transportSecurity) { + this.innerModel().withTransportSecurity(transportSecurity); + return this; + } + + public FirewallPolicyImpl withSku(FirewallPolicySku sku) { + this.innerModel().withSku(sku); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupImpl.java new file mode 100644 index 0000000000000..7e5fa7b12f58a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupImpl.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.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class FirewallPolicyRuleCollectionGroupImpl + implements FirewallPolicyRuleCollectionGroup, + FirewallPolicyRuleCollectionGroup.Definition, + FirewallPolicyRuleCollectionGroup.Update { + private FirewallPolicyRuleCollectionGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public List ruleCollections() { + List inner = this.innerModel().ruleCollections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public FirewallPolicyRuleCollectionGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String firewallPolicyName; + + private String ruleCollectionGroupName; + + public FirewallPolicyRuleCollectionGroupImpl withExistingFirewallPolicy( + String resourceGroupName, String firewallPolicyName) { + this.resourceGroupName = resourceGroupName; + this.firewallPolicyName = firewallPolicyName; + return this; + } + + public FirewallPolicyRuleCollectionGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .createOrUpdate( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, this.innerModel(), Context.NONE); + return this; + } + + public FirewallPolicyRuleCollectionGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .createOrUpdate( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, this.innerModel(), context); + return this; + } + + FirewallPolicyRuleCollectionGroupImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new FirewallPolicyRuleCollectionGroupInner(); + this.serviceManager = serviceManager; + this.ruleCollectionGroupName = name; + } + + public FirewallPolicyRuleCollectionGroupImpl update() { + return this; + } + + public FirewallPolicyRuleCollectionGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .createOrUpdate( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, this.innerModel(), Context.NONE); + return this; + } + + public FirewallPolicyRuleCollectionGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .createOrUpdate( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, this.innerModel(), context); + return this; + } + + FirewallPolicyRuleCollectionGroupImpl( + FirewallPolicyRuleCollectionGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.firewallPolicyName = Utils.getValueFromIdByName(innerObject.id(), "firewallPolicies"); + this.ruleCollectionGroupName = Utils.getValueFromIdByName(innerObject.id(), "ruleCollectionGroups"); + } + + public FirewallPolicyRuleCollectionGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE) + .getValue(); + return this; + } + + public FirewallPolicyRuleCollectionGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context) + .getValue(); + return this; + } + + public FirewallPolicyRuleCollectionGroupImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public FirewallPolicyRuleCollectionGroupImpl withPriority(Integer priority) { + this.innerModel().withPriority(priority); + return this; + } + + public FirewallPolicyRuleCollectionGroupImpl withRuleCollections( + List ruleCollections) { + this.innerModel().withRuleCollections(ruleCollections); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java new file mode 100644 index 0000000000000..87250d963adf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java @@ -0,0 +1,1185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.FirewallPolicyRuleCollectionGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroupListResult; +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 FirewallPolicyRuleCollectionGroupsClient. + */ +public final class FirewallPolicyRuleCollectionGroupsClientImpl implements FirewallPolicyRuleCollectionGroupsClient { + private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollectionGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FirewallPolicyRuleCollectionGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPolicyRuleCollectionGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPolicyRuleCollectionGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + FirewallPolicyRuleCollectionGroupsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicyRuleCollectionGroups to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface FirewallPolicyRuleCollectionGroupsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("ruleCollectionGroupName") String ruleCollectionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("ruleCollectionGroupName") String ruleCollectionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("ruleCollectionGroupName") String ruleCollectionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FirewallPolicyRuleCollectionGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, String ruleCollectionGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required and cannot be null.")); + } + if (ruleCollectionGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ruleCollectionGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + ruleCollectionGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, String ruleCollectionGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required and cannot be null.")); + } + if (ruleCollectionGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ruleCollectionGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + ruleCollectionGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, String ruleCollectionGroupName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, String ruleCollectionGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, String ruleCollectionGroupName) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).getSyncPoller(); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, String ruleCollectionGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, String ruleCollectionGroupName) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 firewallPolicyName, String ruleCollectionGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 firewallPolicyName, String ruleCollectionGroupName) { + deleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).block(); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 firewallPolicyName, String ruleCollectionGroupName, Context context) { + deleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context).block(); + } + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required and cannot be null.")); + } + if (ruleCollectionGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ruleCollectionGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + ruleCollectionGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required and cannot be null.")); + } + if (ruleCollectionGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ruleCollectionGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + ruleCollectionGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + return getWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyRuleCollectionGroupInner get( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + return getAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).block(); + } + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context).block(); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required and cannot be null.")); + } + if (ruleCollectionGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ruleCollectionGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + ruleCollectionGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required and cannot be null.")); + } + if (ruleCollectionGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ruleCollectionGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + ruleCollectionGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FirewallPolicyRuleCollectionGroupInner.class, + FirewallPolicyRuleCollectionGroupInner.class, + Context.NONE); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FirewallPolicyRuleCollectionGroupInner.class, + FirewallPolicyRuleCollectionGroupInner.class, + context); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyRuleCollectionGroupInner createOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters).block(); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyRuleCollectionGroupInner createOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, context) + .block(); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String firewallPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String firewallPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (firewallPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String firewallPolicyName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, firewallPolicyName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String firewallPolicyName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, firewallPolicyName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String firewallPolicyName) { + return new PagedIterable<>(listAsync(resourceGroupName, firewallPolicyName)); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String firewallPolicyName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, firewallPolicyName, 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 response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @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 response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsImpl.java new file mode 100644 index 0000000000000..ed33afbf87125 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsImpl.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.network.generated.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.network.generated.fluent.FirewallPolicyRuleCollectionGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroup; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FirewallPolicyRuleCollectionGroupsImpl implements FirewallPolicyRuleCollectionGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollectionGroupsImpl.class); + + private final FirewallPolicyRuleCollectionGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPolicyRuleCollectionGroupsImpl( + FirewallPolicyRuleCollectionGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName); + } + + public void delete( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + } + + public FirewallPolicyRuleCollectionGroup get( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + FirewallPolicyRuleCollectionGroupInner inner = + this.serviceClient().get(resourceGroupName, firewallPolicyName, ruleCollectionGroupName); + if (inner != null) { + return new FirewallPolicyRuleCollectionGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FirewallPolicyRuleCollectionGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String firewallPolicyName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, firewallPolicyName); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyRuleCollectionGroupImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String firewallPolicyName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, firewallPolicyName, context); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyRuleCollectionGroupImpl(inner1, this.manager())); + } + + public FirewallPolicyRuleCollectionGroup 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 firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + return this + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, 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 firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + return this.getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, 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 firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + this.delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, 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 firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + this.delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + } + + private FirewallPolicyRuleCollectionGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public FirewallPolicyRuleCollectionGroupImpl define(String name) { + return new FirewallPolicyRuleCollectionGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java new file mode 100644 index 0000000000000..9de4a344bb32a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.FlowLog; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import java.util.Collections; +import java.util.Map; + +public final class FlowLogImpl implements FlowLog, FlowLog.Definition, FlowLog.Update { + private FlowLogInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String targetResourceGuid() { + return this.innerModel().targetResourceGuid(); + } + + public String storageId() { + return this.innerModel().storageId(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public RetentionPolicyParameters retentionPolicy() { + return this.innerModel().retentionPolicy(); + } + + public FlowLogFormatParameters format() { + return this.innerModel().format(); + } + + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.innerModel().flowAnalyticsConfiguration(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public FlowLogInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkWatcherName; + + private String flowLogName; + + private TagsObject updateParameters; + + public FlowLogImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + public FlowLog create() { + this.innerObject = + serviceManager + .serviceClient() + .getFlowLogs() + .createOrUpdate(resourceGroupName, networkWatcherName, flowLogName, this.innerModel(), Context.NONE); + return this; + } + + public FlowLog create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFlowLogs() + .createOrUpdate(resourceGroupName, networkWatcherName, flowLogName, this.innerModel(), context); + return this; + } + + FlowLogImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new FlowLogInner(); + this.serviceManager = serviceManager; + this.flowLogName = name; + } + + public FlowLogImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public FlowLog apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFlowLogs() + .updateTagsWithResponse( + resourceGroupName, networkWatcherName, flowLogName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public FlowLog apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFlowLogs() + .updateTagsWithResponse(resourceGroupName, networkWatcherName, flowLogName, updateParameters, context) + .getValue(); + return this; + } + + FlowLogImpl(FlowLogInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = Utils.getValueFromIdByName(innerObject.id(), "networkWatchers"); + this.flowLogName = Utils.getValueFromIdByName(innerObject.id(), "flowLogs"); + } + + public FlowLog refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFlowLogs() + .getWithResponse(resourceGroupName, networkWatcherName, flowLogName, Context.NONE) + .getValue(); + return this; + } + + public FlowLog refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFlowLogs() + .getWithResponse(resourceGroupName, networkWatcherName, flowLogName, context) + .getValue(); + return this; + } + + public FlowLogImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FlowLogImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FlowLogImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public FlowLogImpl withTargetResourceId(String targetResourceId) { + this.innerModel().withTargetResourceId(targetResourceId); + return this; + } + + public FlowLogImpl withStorageId(String storageId) { + this.innerModel().withStorageId(storageId); + return this; + } + + public FlowLogImpl withEnabled(Boolean enabled) { + this.innerModel().withEnabled(enabled); + return this; + } + + public FlowLogImpl withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { + this.innerModel().withRetentionPolicy(retentionPolicy); + return this; + } + + public FlowLogImpl withFormat(FlowLogFormatParameters format) { + this.innerModel().withFormat(format); + return this; + } + + public FlowLogImpl withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration) { + this.innerModel().withFlowAnalyticsConfiguration(flowAnalyticsConfiguration); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogInformationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogInformationImpl.java new file mode 100644 index 0000000000000..85b87d5fd8145 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogInformationImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogInformation; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; + +public final class FlowLogInformationImpl implements FlowLogInformation { + private FlowLogInformationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + FlowLogInformationImpl( + FlowLogInformationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.innerModel().flowAnalyticsConfiguration(); + } + + public String storageId() { + return this.innerModel().storageId(); + } + + public boolean enabled() { + return this.innerModel().enabled(); + } + + public RetentionPolicyParameters retentionPolicy() { + return this.innerModel().retentionPolicy(); + } + + public FlowLogFormatParameters format() { + return this.innerModel().format(); + } + + public FlowLogInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsClientImpl.java new file mode 100644 index 0000000000000..bcd7d89eda075 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsClientImpl.java @@ -0,0 +1,1336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.FlowLogsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.FlowLogListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 FlowLogsClient. */ +public final class FlowLogsClientImpl implements FlowLogsClient { + private final ClientLogger logger = new ClientLogger(FlowLogsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FlowLogsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FlowLogsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FlowLogsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(FlowLogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFlowLogs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface FlowLogsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("flowLogName") String flowLogName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FlowLogInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("flowLogName") String flowLogName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("flowLogName") String flowLogName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("flowLogName") String flowLogName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkWatcherName, String flowLogName, FlowLogInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (flowLogName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowLogName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + flowLogName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + FlowLogInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (flowLogName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowLogName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + flowLogName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FlowLogInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkWatcherName, String flowLogName, FlowLogInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FlowLogInner.class, FlowLogInner.class, Context.NONE); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FlowLogInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + FlowLogInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FlowLogInner.class, FlowLogInner.class, context); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FlowLogInner> beginCreateOrUpdate( + String resourceGroupName, String networkWatcherName, String flowLogName, FlowLogInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).getSyncPoller(); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FlowLogInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + FlowLogInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkWatcherName, String flowLogName, FlowLogInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + FlowLogInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInner createOrUpdate( + String resourceGroupName, String networkWatcherName, String flowLogName, FlowLogInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).block(); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + FlowLogInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, context).block(); + } + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkWatcherName, String flowLogName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (flowLogName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowLogName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + flowLogName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (flowLogName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowLogName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + flowLogName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String networkWatcherName, String flowLogName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInner updateTags( + String resourceGroupName, String networkWatcherName, String flowLogName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).block(); + } + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + TagsObject parameters, + Context context) { + return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, context) + .block(); + } + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkWatcherName, String flowLogName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (flowLogName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowLogName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + flowLogName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (flowLogName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowLogName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + flowLogName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkWatcherName, String flowLogName) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInner get(String resourceGroupName, String networkWatcherName, String flowLogName) { + return getAsync(resourceGroupName, networkWatcherName, flowLogName).block(); + } + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName, context).block(); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkWatcherName, String flowLogName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (flowLogName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowLogName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + flowLogName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (flowLogName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowLogName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + flowLogName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkWatcherName, String flowLogName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String flowLogName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, flowLogName).getSyncPoller(); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, flowLogName, context).getSyncPoller(); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkWatcherName, String flowLogName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, flowLogName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, flowLogName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkWatcherName, String flowLogName) { + deleteAsync(resourceGroupName, networkWatcherName, flowLogName).block(); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + deleteAsync(resourceGroupName, networkWatcherName, flowLogName, context).block(); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String networkWatcherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkWatcherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkWatcherName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkWatcherName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkWatcherName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkWatcherName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkWatcherName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName, 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 list of flow logs. + */ + @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 list of flow logs. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsImpl.java new file mode 100644 index 0000000000000..e5d771f3515c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.FlowLogsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.FlowLog; +import com.azure.resourcemanager.network.generated.models.FlowLogs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FlowLogsImpl implements FlowLogs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogsImpl.class); + + private final FlowLogsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FlowLogsImpl( + FlowLogsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public FlowLog get(String resourceGroupName, String networkWatcherName, String flowLogName) { + FlowLogInner inner = this.serviceClient().get(resourceGroupName, networkWatcherName, flowLogName); + if (inner != null) { + return new FlowLogImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkWatcherName, flowLogName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FlowLogImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkWatcherName, String flowLogName) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, flowLogName); + } + + public void delete(String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, flowLogName, context); + } + + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkWatcherName); + return Utils.mapPage(inner, inner1 -> new FlowLogImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkWatcherName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkWatcherName, context); + return Utils.mapPage(inner, inner1 -> new FlowLogImpl(inner1, this.manager())); + } + + public FlowLog 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, networkWatcherName, flowLogName, 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, networkWatcherName, flowLogName, 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, flowLogName, 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, flowLogName, context); + } + + private FlowLogsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public FlowLogImpl define(String name) { + return new FlowLogImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.java new file mode 100644 index 0000000000000..29fee3d0da41c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.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.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; +import java.util.Collections; +import java.util.List; + +public final class FrontendIpConfigurationImpl implements FrontendIpConfiguration { + private FrontendIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + FrontendIpConfigurationImpl( + FrontendIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List inboundNatPools() { + List inner = this.innerModel().inboundNatPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List outboundRules() { + List inner = this.innerModel().outboundRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public IpVersion privateIpAddressVersion() { + return this.innerModel().privateIpAddressVersion(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public SubResource publicIpPrefix() { + return this.innerModel().publicIpPrefix(); + } + + public SubResource gatewayLoadBalancer() { + return this.innerModel().gatewayLoadBalancer(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public FrontendIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GatewayRouteListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GatewayRouteListResultImpl.java new file mode 100644 index 0000000000000..6e59c4256f1fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GatewayRouteListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import com.azure.resourcemanager.network.generated.models.GatewayRoute; +import com.azure.resourcemanager.network.generated.models.GatewayRouteListResult; +import java.util.Collections; +import java.util.List; + +public final class GatewayRouteListResultImpl implements GatewayRouteListResult { + private GatewayRouteListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + GatewayRouteListResultImpl( + GatewayRouteListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public GatewayRouteListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GenerateExpressRoutePortsLoaResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GenerateExpressRoutePortsLoaResultImpl.java new file mode 100644 index 0000000000000..2c58295ce6f0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GenerateExpressRoutePortsLoaResultImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaResult; + +public final class GenerateExpressRoutePortsLoaResultImpl implements GenerateExpressRoutePortsLoaResult { + private GenerateExpressRoutePortsLoaResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + GenerateExpressRoutePortsLoaResultImpl( + GenerateExpressRoutePortsLoaResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String encodedContent() { + return this.innerModel().encodedContent(); + } + + public GenerateExpressRoutePortsLoaResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationImpl.java new file mode 100644 index 0000000000000..91246a713bc8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.HubIpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class HubIpConfigurationImpl + implements HubIpConfiguration, HubIpConfiguration.Definition, HubIpConfiguration.Update { + private HubIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HubIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHubName; + + private String ipConfigName; + + public HubIpConfigurationImpl withExistingVirtualHub(String resourceGroupName, String virtualHubName) { + this.resourceGroupName = resourceGroupName; + this.virtualHubName = virtualHubName; + return this; + } + + public HubIpConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .createOrUpdate(resourceGroupName, virtualHubName, ipConfigName, this.innerModel(), Context.NONE); + return this; + } + + public HubIpConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .createOrUpdate(resourceGroupName, virtualHubName, ipConfigName, this.innerModel(), context); + return this; + } + + HubIpConfigurationImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new HubIpConfigurationInner(); + this.serviceManager = serviceManager; + this.ipConfigName = name; + } + + public HubIpConfigurationImpl update() { + return this; + } + + public HubIpConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .createOrUpdate(resourceGroupName, virtualHubName, ipConfigName, this.innerModel(), Context.NONE); + return this; + } + + public HubIpConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .createOrUpdate(resourceGroupName, virtualHubName, ipConfigName, this.innerModel(), context); + return this; + } + + HubIpConfigurationImpl( + HubIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.ipConfigName = Utils.getValueFromIdByName(innerObject.id(), "ipConfigurations"); + } + + public HubIpConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .getWithResponse(resourceGroupName, virtualHubName, ipConfigName, Context.NONE) + .getValue(); + return this; + } + + public HubIpConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .getWithResponse(resourceGroupName, virtualHubName, ipConfigName, context) + .getValue(); + return this; + } + + public HubIpConfigurationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public HubIpConfigurationImpl withPrivateIpAddress(String privateIpAddress) { + this.innerModel().withPrivateIpAddress(privateIpAddress); + return this; + } + + public HubIpConfigurationImpl withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { + this.innerModel().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + public HubIpConfigurationImpl withSubnet(SubnetInner subnet) { + this.innerModel().withSubnet(subnet); + return this; + } + + public HubIpConfigurationImpl withPublicIpAddress(PublicIpAddressInner publicIpAddress) { + this.innerModel().withPublicIpAddress(publicIpAddress); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTableImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTableImpl.java new file mode 100644 index 0000000000000..208d142ef5501 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTableImpl.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import com.azure.resourcemanager.network.generated.models.HubRoute; +import com.azure.resourcemanager.network.generated.models.HubRouteTable; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class HubRouteTableImpl implements HubRouteTable, HubRouteTable.Definition, HubRouteTable.Update { + private HubRouteTableInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List routes() { + List inner = this.innerModel().routes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List labels() { + List inner = this.innerModel().labels(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List associatedConnections() { + List inner = this.innerModel().associatedConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List propagatingConnections() { + List inner = this.innerModel().propagatingConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HubRouteTableInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHubName; + + private String routeTableName; + + public HubRouteTableImpl withExistingVirtualHub(String resourceGroupName, String virtualHubName) { + this.resourceGroupName = resourceGroupName; + this.virtualHubName = virtualHubName; + return this; + } + + public HubRouteTable create() { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, this.innerModel(), Context.NONE); + return this; + } + + public HubRouteTable create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, this.innerModel(), context); + return this; + } + + HubRouteTableImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new HubRouteTableInner(); + this.serviceManager = serviceManager; + this.routeTableName = name; + } + + public HubRouteTableImpl update() { + return this; + } + + public HubRouteTable apply() { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, this.innerModel(), Context.NONE); + return this; + } + + public HubRouteTable apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, this.innerModel(), context); + return this; + } + + HubRouteTableImpl( + HubRouteTableInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.routeTableName = Utils.getValueFromIdByName(innerObject.id(), "hubRouteTables"); + } + + public HubRouteTable refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .getWithResponse(resourceGroupName, virtualHubName, routeTableName, Context.NONE) + .getValue(); + return this; + } + + public HubRouteTable refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .getWithResponse(resourceGroupName, virtualHubName, routeTableName, context) + .getValue(); + return this; + } + + public HubRouteTableImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public HubRouteTableImpl withRoutes(List routes) { + this.innerModel().withRoutes(routes); + return this; + } + + public HubRouteTableImpl withLabels(List labels) { + this.innerModel().withLabels(labels); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java new file mode 100644 index 0000000000000..7524653914798 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java @@ -0,0 +1,1139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.HubRouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import com.azure.resourcemanager.network.generated.models.ListHubRouteTablesResult; +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 HubRouteTablesClient. */ +public final class HubRouteTablesClientImpl implements HubRouteTablesClient { + private final ClientLogger logger = new ClientLogger(HubRouteTablesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final HubRouteTablesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of HubRouteTablesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HubRouteTablesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(HubRouteTablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientHubRouteTables to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface HubRouteTablesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubRouteTables/{routeTableName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") HubRouteTableInner routeTableParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubRouteTables/{routeTableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubRouteTables/{routeTableName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubRouteTables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @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); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (routeTableParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeTableParameters is required and cannot be null.")); + } else { + routeTableParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + routeTableParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters, + 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (routeTableParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeTableParameters is required and cannot be null.")); + } else { + routeTableParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + routeTableParameters, + accept, + context); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, HubRouteTableInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), HubRouteTableInner.class, HubRouteTableInner.class, Context.NONE); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, HubRouteTableInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualHubName, routeTableName, routeTableParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), HubRouteTableInner.class, HubRouteTableInner.class, context); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, HubRouteTableInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters) + .getSyncPoller(); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, HubRouteTableInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, routeTableParameters, context) + .getSyncPoller(); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, routeTableParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubRouteTableInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters).block(); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubRouteTableInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters, context) + .block(); + } + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String routeTableName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String routeTableName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualHubName, String routeTableName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeTableName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubRouteTableInner get(String resourceGroupName, String virtualHubName, String routeTableName) { + return getAsync(resourceGroupName, virtualHubName, routeTableName).block(); + } + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeTableName, context).block(); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String routeTableName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String routeTableName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + accept, + context); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String routeTableName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, routeTableName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String routeTableName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, routeTableName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String routeTableName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName).getSyncPoller(); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String routeTableName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName, context).getSyncPoller(); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String routeTableName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String routeTableName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName, String routeTableName) { + deleteAsync(resourceGroupName, virtualHubName, routeTableName).block(); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName, String routeTableName, Context context) { + deleteAsync(resourceGroupName, virtualHubName, routeTableName, context).block(); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + 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())); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, 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 list of RouteTables and a URL nextLink to get the next set of results. + */ + @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 list of RouteTables and a URL nextLink to get the next set of results. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesImpl.java new file mode 100644 index 0000000000000..83f64fe28d701 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.HubRouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import com.azure.resourcemanager.network.generated.models.HubRouteTable; +import com.azure.resourcemanager.network.generated.models.HubRouteTables; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class HubRouteTablesImpl implements HubRouteTables { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubRouteTablesImpl.class); + + private final HubRouteTablesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public HubRouteTablesImpl( + HubRouteTablesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public HubRouteTable get(String resourceGroupName, String virtualHubName, String routeTableName) { + HubRouteTableInner inner = this.serviceClient().get(resourceGroupName, virtualHubName, routeTableName); + if (inner != null) { + return new HubRouteTableImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, routeTableName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HubRouteTableImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String routeTableName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeTableName); + } + + public void delete(String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeTableName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new HubRouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new HubRouteTableImpl(inner1, this.manager())); + } + + public HubRouteTable 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routeTableName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routeTableName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routeTableName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routeTableName, context); + } + + private HubRouteTablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public HubRouteTableImpl define(String name) { + return new HubRouteTableImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.java new file mode 100644 index 0000000000000..3abf014d6dbb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.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.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.azure.resourcemanager.network.generated.models.HubVirtualNetworkConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; + +public final class HubVirtualNetworkConnectionImpl implements HubVirtualNetworkConnection { + private HubVirtualNetworkConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + HubVirtualNetworkConnectionImpl( + HubVirtualNetworkConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SubResource remoteVirtualNetwork() { + return this.innerModel().remoteVirtualNetwork(); + } + + public Boolean allowHubToRemoteVnetTransit() { + return this.innerModel().allowHubToRemoteVnetTransit(); + } + + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.innerModel().allowRemoteVnetToUseHubVnetGateways(); + } + + public Boolean enableInternetSecurity() { + return this.innerModel().enableInternetSecurity(); + } + + public RoutingConfiguration routingConfiguration() { + return this.innerModel().routingConfiguration(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HubVirtualNetworkConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java new file mode 100644 index 0000000000000..518f75c290439 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java @@ -0,0 +1,1178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.HubVirtualNetworkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.azure.resourcemanager.network.generated.models.ListHubVirtualNetworkConnectionsResult; +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 HubVirtualNetworkConnectionsClient. */ +public final class HubVirtualNetworkConnectionsClientImpl implements HubVirtualNetworkConnectionsClient { + private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final HubVirtualNetworkConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of HubVirtualNetworkConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HubVirtualNetworkConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + HubVirtualNetworkConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientHubVirtualNetworkConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface HubVirtualNetworkConnectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubVirtualNetworkConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @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); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (hubVirtualNetworkConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter hubVirtualNetworkConnectionParameters is required and cannot be null.")); + } else { + hubVirtualNetworkConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + hubVirtualNetworkConnectionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (hubVirtualNetworkConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter hubVirtualNetworkConnectionParameters is required and cannot be null.")); + } else { + hubVirtualNetworkConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + hubVirtualNetworkConnectionParameters, + accept, + context); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, HubVirtualNetworkConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + HubVirtualNetworkConnectionInner.class, + HubVirtualNetworkConnectionInner.class, + Context.NONE); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, HubVirtualNetworkConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + HubVirtualNetworkConnectionInner.class, + HubVirtualNetworkConnectionInner.class, + context); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, HubVirtualNetworkConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters) + .getSyncPoller(); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, HubVirtualNetworkConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, context) + .getSyncPoller(); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubVirtualNetworkConnectionInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters) { + return createOrUpdateAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters) + .block(); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubVirtualNetworkConnectionInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, context) + .block(); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + accept, + context); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, connectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, connectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName).getSyncPoller(); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName, String connectionName) { + deleteAsync(resourceGroupName, virtualHubName, connectionName).block(); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName, String connectionName, Context context) { + deleteAsync(resourceGroupName, virtualHubName, connectionName, context).block(); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String connectionName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String virtualHubName, String connectionName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, connectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubVirtualNetworkConnectionInner get( + String resourceGroupName, String virtualHubName, String connectionName) { + return getAsync(resourceGroupName, virtualHubName, connectionName).block(); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, connectionName, context).block(); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + 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())); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, 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 list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @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 list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsImpl.java new file mode 100644 index 0000000000000..9bdd427e62a5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsImpl.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.network.generated.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.network.generated.fluent.HubVirtualNetworkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.azure.resourcemanager.network.generated.models.HubVirtualNetworkConnection; +import com.azure.resourcemanager.network.generated.models.HubVirtualNetworkConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class HubVirtualNetworkConnectionsImpl implements HubVirtualNetworkConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionsImpl.class); + + private final HubVirtualNetworkConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public HubVirtualNetworkConnectionsImpl( + HubVirtualNetworkConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public HubVirtualNetworkConnection createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters) { + HubVirtualNetworkConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters); + if (inner != null) { + return new HubVirtualNetworkConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public HubVirtualNetworkConnection createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context) { + HubVirtualNetworkConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, context); + if (inner != null) { + return new HubVirtualNetworkConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String connectionName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, connectionName); + } + + public void delete(String resourceGroupName, String virtualHubName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, connectionName, context); + } + + public HubVirtualNetworkConnection get(String resourceGroupName, String virtualHubName, String connectionName) { + HubVirtualNetworkConnectionInner inner = + this.serviceClient().get(resourceGroupName, virtualHubName, connectionName); + if (inner != null) { + return new HubVirtualNetworkConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HubVirtualNetworkConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new HubVirtualNetworkConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new HubVirtualNetworkConnectionImpl(inner1, this.manager())); + } + + private HubVirtualNetworkConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.java new file mode 100644 index 0000000000000..00b6181887da5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.InboundNatRule; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; + +public final class InboundNatRuleImpl implements InboundNatRule, InboundNatRule.Definition, InboundNatRule.Update { + private InboundNatRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource frontendIpConfiguration() { + return this.innerModel().frontendIpConfiguration(); + } + + public NetworkInterfaceIpConfiguration backendIpConfiguration() { + NetworkInterfaceIpConfigurationInner inner = this.innerModel().backendIpConfiguration(); + if (inner != null) { + return new NetworkInterfaceIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public TransportProtocol protocol() { + return this.innerModel().protocol(); + } + + public Integer frontendPort() { + return this.innerModel().frontendPort(); + } + + public Integer backendPort() { + return this.innerModel().backendPort(); + } + + public Integer idleTimeoutInMinutes() { + return this.innerModel().idleTimeoutInMinutes(); + } + + public Boolean enableFloatingIp() { + return this.innerModel().enableFloatingIp(); + } + + public Boolean enableTcpReset() { + return this.innerModel().enableTcpReset(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public InboundNatRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String loadBalancerName; + + private String inboundNatRuleName; + + public InboundNatRuleImpl withExistingLoadBalancer(String resourceGroupName, String loadBalancerName) { + this.resourceGroupName = resourceGroupName; + this.loadBalancerName = loadBalancerName; + return this; + } + + public InboundNatRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getInboundNatRules() + .createOrUpdate( + resourceGroupName, loadBalancerName, inboundNatRuleName, this.innerModel(), Context.NONE); + return this; + } + + public InboundNatRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getInboundNatRules() + .createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.innerModel(), context); + return this; + } + + InboundNatRuleImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new InboundNatRuleInner(); + this.serviceManager = serviceManager; + this.inboundNatRuleName = name; + } + + public InboundNatRuleImpl update() { + return this; + } + + public InboundNatRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getInboundNatRules() + .createOrUpdate( + resourceGroupName, loadBalancerName, inboundNatRuleName, this.innerModel(), Context.NONE); + return this; + } + + public InboundNatRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getInboundNatRules() + .createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.innerModel(), context); + return this; + } + + InboundNatRuleImpl( + InboundNatRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = Utils.getValueFromIdByName(innerObject.id(), "loadBalancers"); + this.inboundNatRuleName = Utils.getValueFromIdByName(innerObject.id(), "inboundNatRules"); + } + + public InboundNatRule refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getInboundNatRules() + .getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public InboundNatRule refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getInboundNatRules() + .getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, localExpand, context) + .getValue(); + return this; + } + + public InboundNatRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public InboundNatRuleImpl withFrontendIpConfiguration(SubResource frontendIpConfiguration) { + this.innerModel().withFrontendIpConfiguration(frontendIpConfiguration); + return this; + } + + public InboundNatRuleImpl withProtocol(TransportProtocol protocol) { + this.innerModel().withProtocol(protocol); + return this; + } + + public InboundNatRuleImpl withFrontendPort(Integer frontendPort) { + this.innerModel().withFrontendPort(frontendPort); + return this; + } + + public InboundNatRuleImpl withBackendPort(Integer backendPort) { + this.innerModel().withBackendPort(backendPort); + return this; + } + + public InboundNatRuleImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.innerModel().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + public InboundNatRuleImpl withEnableFloatingIp(Boolean enableFloatingIp) { + this.innerModel().withEnableFloatingIp(enableFloatingIp); + return this; + } + + public InboundNatRuleImpl withEnableTcpReset(Boolean enableTcpReset) { + this.innerModel().withEnableTcpReset(enableTcpReset); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesClientImpl.java new file mode 100644 index 0000000000000..98fd47109ae0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesClientImpl.java @@ -0,0 +1,1200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.InboundNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.models.InboundNatRuleListResult; +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 InboundNatRulesClient. */ +public final class InboundNatRulesClientImpl implements InboundNatRulesClient { + private final ClientLogger logger = new ClientLogger(InboundNatRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final InboundNatRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of InboundNatRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InboundNatRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(InboundNatRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientInboundNatRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface InboundNatRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/inboundNatRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("inboundNatRuleName") String inboundNatRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("inboundNatRuleName") String inboundNatRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("inboundNatRuleName") String inboundNatRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") InboundNatRuleInner inboundNatRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String inboundNatRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (inboundNatRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter inboundNatRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + inboundNatRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String inboundNatRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (inboundNatRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter inboundNatRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + inboundNatRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String inboundNatRuleName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String inboundNatRuleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String inboundNatRuleName) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).getSyncPoller(); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String inboundNatRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, context).getSyncPoller(); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String inboundNatRuleName) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String inboundNatRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 loadBalancerName, String inboundNatRuleName) { + deleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).block(); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 loadBalancerName, String inboundNatRuleName, Context context) { + deleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, context).block(); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (inboundNatRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter inboundNatRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + inboundNatRuleName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (inboundNatRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter inboundNatRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + inboundNatRuleName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + final String expand = null; + return getAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).block(); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, context).block(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (inboundNatRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (inboundNatRuleParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null.")); + } else { + inboundNatRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + inboundNatRuleName, + apiVersion, + this.client.getSubscriptionId(), + inboundNatRuleParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (inboundNatRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (inboundNatRuleParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null.")); + } else { + inboundNatRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + inboundNatRuleName, + apiVersion, + this.client.getSubscriptionId(), + inboundNatRuleParameters, + accept, + context); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, InboundNatRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + InboundNatRuleInner.class, + InboundNatRuleInner.class, + Context.NONE); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, InboundNatRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), InboundNatRuleInner.class, InboundNatRuleInner.class, context); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InboundNatRuleInner createOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters) { + return createOrUpdateAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) + .block(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InboundNatRuleInner createOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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 response for ListInboundNatRule API service call. + */ + @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 response for ListInboundNatRule API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesImpl.java new file mode 100644 index 0000000000000..33caeb153e52f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.InboundNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.models.InboundNatRule; +import com.azure.resourcemanager.network.generated.models.InboundNatRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class InboundNatRulesImpl implements InboundNatRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRulesImpl.class); + + private final InboundNatRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public InboundNatRulesImpl( + InboundNatRulesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new InboundNatRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new InboundNatRuleImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, inboundNatRuleName); + } + + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, inboundNatRuleName, context); + } + + public InboundNatRule get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRuleInner inner = this.serviceClient().get(resourceGroupName, loadBalancerName, inboundNatRuleName); + if (inner != null) { + return new InboundNatRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new InboundNatRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public InboundNatRule 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + String localExpand = null; + return this + .getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + return this.getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, context); + } + + private InboundNatRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public InboundNatRuleImpl define(String name) { + return new InboundNatRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.java new file mode 100644 index 0000000000000..c74da03335f5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRule; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class InboundSecurityRuleImpl + implements InboundSecurityRule, InboundSecurityRule.Definition, InboundSecurityRule.Update { + private InboundSecurityRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List rules() { + List inner = this.innerModel().rules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public InboundSecurityRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkVirtualApplianceName; + + private String ruleCollectionName; + + public InboundSecurityRuleImpl withExistingNetworkVirtualAppliance( + String resourceGroupName, String networkVirtualApplianceName) { + this.resourceGroupName = resourceGroupName; + this.networkVirtualApplianceName = networkVirtualApplianceName; + return this; + } + + public InboundSecurityRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getInboundSecurityRuleOperations() + .createOrUpdate( + resourceGroupName, + networkVirtualApplianceName, + ruleCollectionName, + this.innerModel(), + Context.NONE); + return this; + } + + public InboundSecurityRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getInboundSecurityRuleOperations() + .createOrUpdate( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, this.innerModel(), context); + return this; + } + + InboundSecurityRuleImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new InboundSecurityRuleInner(); + this.serviceManager = serviceManager; + this.ruleCollectionName = name; + } + + public InboundSecurityRuleImpl update() { + return this; + } + + public InboundSecurityRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getInboundSecurityRuleOperations() + .createOrUpdate( + resourceGroupName, + networkVirtualApplianceName, + ruleCollectionName, + this.innerModel(), + Context.NONE); + return this; + } + + public InboundSecurityRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getInboundSecurityRuleOperations() + .createOrUpdate( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, this.innerModel(), context); + return this; + } + + InboundSecurityRuleImpl( + InboundSecurityRuleInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName = Utils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + this.ruleCollectionName = Utils.getValueFromIdByName(innerObject.id(), "inboundSecurityRules"); + } + + public InboundSecurityRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public InboundSecurityRuleImpl withRules(List rules) { + this.innerModel().withRules(rules); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java new file mode 100644 index 0000000000000..5353b899b10fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.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.network.generated.fluent.InboundSecurityRuleOperationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; +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 InboundSecurityRuleOperationsClient. */ +public final class InboundSecurityRuleOperationsClientImpl implements InboundSecurityRuleOperationsClient { + private final ClientLogger logger = new ClientLogger(InboundSecurityRuleOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final InboundSecurityRuleOperationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of InboundSecurityRuleOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InboundSecurityRuleOperationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + InboundSecurityRuleOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientInboundSecurityRuleOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface InboundSecurityRuleOperationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("ruleCollectionName") String ruleCollectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") InboundSecurityRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + ruleCollectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + ruleCollectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, InboundSecurityRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + InboundSecurityRuleInner.class, + InboundSecurityRuleInner.class, + Context.NONE); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, InboundSecurityRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + InboundSecurityRuleInner.class, + InboundSecurityRuleInner.class, + context); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, InboundSecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, InboundSecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InboundSecurityRuleInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters) + .block(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InboundSecurityRuleInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, context) + .block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsImpl.java new file mode 100644 index 0000000000000..9ccf042163699 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsImpl.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.network.generated.implementation; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.InboundSecurityRuleOperationsClient; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleOperations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class InboundSecurityRuleOperationsImpl implements InboundSecurityRuleOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundSecurityRuleOperationsImpl.class); + + private final InboundSecurityRuleOperationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public InboundSecurityRuleOperationsImpl( + InboundSecurityRuleOperationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + private InboundSecurityRuleOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public InboundSecurityRuleImpl define(String name) { + return new InboundSecurityRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.java new file mode 100644 index 0000000000000..9acfd5a78fa45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.models.IpAddressAvailabilityResult; +import java.util.Collections; +import java.util.List; + +public final class IpAddressAvailabilityResultImpl implements IpAddressAvailabilityResult { + private IpAddressAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpAddressAvailabilityResultImpl( + IpAddressAvailabilityResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean available() { + return this.innerModel().available(); + } + + public List availableIpAddresses() { + List inner = this.innerModel().availableIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean isPlatformReserved() { + return this.innerModel().isPlatformReserved(); + } + + public IpAddressAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.java new file mode 100644 index 0000000000000..1ef6a796f7a4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.azure.resourcemanager.network.generated.models.IpAllocation; +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class IpAllocationImpl implements IpAllocation, IpAllocation.Definition, IpAllocation.Update { + private IpAllocationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public SubResource subnet() { + return this.innerModel().subnet(); + } + + public SubResource virtualNetwork() { + return this.innerModel().virtualNetwork(); + } + + public IpAllocationType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String prefix() { + return this.innerModel().prefix(); + } + + public Integer prefixLength() { + return this.innerModel().prefixLength(); + } + + public IpVersion prefixType() { + return this.innerModel().prefixType(); + } + + public String ipamAllocationId() { + return this.innerModel().ipamAllocationId(); + } + + public Map allocationTags() { + Map inner = this.innerModel().allocationTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public IpAllocationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ipAllocationName; + + private TagsObject updateParameters; + + public IpAllocationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IpAllocation create() { + this.innerObject = + serviceManager + .serviceClient() + .getIpAllocations() + .createOrUpdate(resourceGroupName, ipAllocationName, this.innerModel(), Context.NONE); + return this; + } + + public IpAllocation create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpAllocations() + .createOrUpdate(resourceGroupName, ipAllocationName, this.innerModel(), context); + return this; + } + + IpAllocationImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new IpAllocationInner(); + this.serviceManager = serviceManager; + this.ipAllocationName = name; + } + + public IpAllocationImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public IpAllocation apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIpAllocations() + .updateTagsWithResponse(resourceGroupName, ipAllocationName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public IpAllocation apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpAllocations() + .updateTagsWithResponse(resourceGroupName, ipAllocationName, updateParameters, context) + .getValue(); + return this; + } + + IpAllocationImpl( + IpAllocationInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipAllocationName = Utils.getValueFromIdByName(innerObject.id(), "IpAllocations"); + } + + public IpAllocation refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getIpAllocations() + .getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public IpAllocation refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getIpAllocations() + .getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, localExpand, context) + .getValue(); + return this; + } + + public IpAllocationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IpAllocationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IpAllocationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public IpAllocationImpl withTypePropertiesType(IpAllocationType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public IpAllocationImpl withPrefix(String prefix) { + this.innerModel().withPrefix(prefix); + return this; + } + + public IpAllocationImpl withPrefixLength(Integer prefixLength) { + this.innerModel().withPrefixLength(prefixLength); + return this; + } + + public IpAllocationImpl withPrefixType(IpVersion prefixType) { + this.innerModel().withPrefixType(prefixType); + return this; + } + + public IpAllocationImpl withIpamAllocationId(String ipamAllocationId) { + this.innerModel().withIpamAllocationId(ipamAllocationId); + return this; + } + + public IpAllocationImpl withAllocationTags(Map allocationTags) { + this.innerModel().withAllocationTags(allocationTags); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsClientImpl.java new file mode 100644 index 0000000000000..72302c3af2833 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsClientImpl.java @@ -0,0 +1,1477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.IpAllocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.azure.resourcemanager.network.generated.models.IpAllocationListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 IpAllocationsClient. */ +public final class IpAllocationsClientImpl implements IpAllocationsClient { + private final ClientLogger logger = new ClientLogger(IpAllocationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IpAllocationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of IpAllocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpAllocationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(IpAllocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientIpAllocations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface IpAllocationsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations/{ipAllocationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipAllocationName") String ipAllocationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations/{ipAllocationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipAllocationName") String ipAllocationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations/{ipAllocationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipAllocationName") String ipAllocationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IpAllocationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations/{ipAllocationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipAllocationName") String ipAllocationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipAllocationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAllocationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipAllocationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipAllocationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAllocationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipAllocationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipAllocationName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, ipAllocationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipAllocationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, ipAllocationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipAllocationName) { + return beginDeleteAsync(resourceGroupName, ipAllocationName).getSyncPoller(); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipAllocationName, Context context) { + return beginDeleteAsync(resourceGroupName, ipAllocationName, context).getSyncPoller(); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipAllocationName) { + return beginDeleteAsync(resourceGroupName, ipAllocationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipAllocationName, Context context) { + return beginDeleteAsync(resourceGroupName, ipAllocationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ipAllocationName) { + deleteAsync(resourceGroupName, ipAllocationName).block(); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ipAllocationName, Context context) { + deleteAsync(resourceGroupName, ipAllocationName, context).block(); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ipAllocationName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAllocationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipAllocationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ipAllocationName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAllocationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipAllocationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String ipAllocationName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipAllocationName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ipAllocationName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, ipAllocationName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpAllocationInner getByResourceGroup(String resourceGroupName, String ipAllocationName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, ipAllocationName, expand).block(); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipAllocationName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipAllocationName, expand, context).block(); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAllocationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipAllocationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAllocationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipAllocationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IpAllocationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, ipAllocationName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IpAllocationInner.class, IpAllocationInner.class, Context.NONE); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IpAllocationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, ipAllocationName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IpAllocationInner.class, IpAllocationInner.class, context); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IpAllocationInner> beginCreateOrUpdate( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IpAllocationInner> beginCreateOrUpdate( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpAllocationInner createOrUpdate( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters) { + return createOrUpdateAsync(resourceGroupName, ipAllocationName, parameters).block(); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpAllocationInner createOrUpdate( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, ipAllocationName, parameters, context).block(); + } + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String ipAllocationName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAllocationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipAllocationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String ipAllocationName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipAllocationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipAllocationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String ipAllocationName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, ipAllocationName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpAllocationInner updateTags(String resourceGroupName, String ipAllocationName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, ipAllocationName, parameters).block(); + } + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String ipAllocationName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, ipAllocationName, parameters, context).block(); + } + + /** + * Gets all IpAllocations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all IpAllocations 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 all IpAllocations in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all IpAllocations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all IpAllocations 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 all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all IpAllocations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all IpAllocations 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 all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for the ListIpAllocations API service call. + */ + @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 response for the ListIpAllocations API service call. + */ + @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 response for the ListIpAllocations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for the ListIpAllocations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsImpl.java new file mode 100644 index 0000000000000..4d36daab979ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsImpl.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.network.generated.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.network.generated.fluent.IpAllocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.azure.resourcemanager.network.generated.models.IpAllocation; +import com.azure.resourcemanager.network.generated.models.IpAllocations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IpAllocationsImpl implements IpAllocations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAllocationsImpl.class); + + private final IpAllocationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public IpAllocationsImpl( + IpAllocationsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String ipAllocationName) { + this.serviceClient().delete(resourceGroupName, ipAllocationName); + } + + public void delete(String resourceGroupName, String ipAllocationName, Context context) { + this.serviceClient().delete(resourceGroupName, ipAllocationName, context); + } + + public IpAllocation getByResourceGroup(String resourceGroupName, String ipAllocationName) { + IpAllocationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ipAllocationName); + if (inner != null) { + return new IpAllocationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipAllocationName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpAllocationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public IpAllocation 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 ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, expand, 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 ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + this.delete(resourceGroupName, ipAllocationName, 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 ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + this.delete(resourceGroupName, ipAllocationName, context); + } + + private IpAllocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public IpAllocationImpl define(String name) { + return new IpAllocationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.java new file mode 100644 index 0000000000000..94b3d94e69eff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class IpConfigurationImpl implements IpConfiguration { + private IpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpConfigurationImpl( + IpConfigurationInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public IpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java new file mode 100644 index 0000000000000..cf80d21f457c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.IpConfigurationProfile; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class IpConfigurationProfileImpl implements IpConfigurationProfile { + private IpConfigurationProfileInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpConfigurationProfileImpl( + IpConfigurationProfileInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager 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 etag() { + return this.innerModel().etag(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public IpConfigurationProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupImpl.java new file mode 100644 index 0000000000000..6223561cb3992 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.azure.resourcemanager.network.generated.models.IpGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class IpGroupImpl implements IpGroup, IpGroup.Definition, IpGroup.Update { + private IpGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List ipAddresses() { + List inner = this.innerModel().ipAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List firewalls() { + List inner = this.innerModel().firewalls(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List firewallPolicies() { + List inner = this.innerModel().firewallPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public IpGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ipGroupsName; + + private TagsObject updateParameters; + + public IpGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IpGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getIpGroups() + .createOrUpdate(resourceGroupName, ipGroupsName, this.innerModel(), Context.NONE); + return this; + } + + public IpGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpGroups() + .createOrUpdate(resourceGroupName, ipGroupsName, this.innerModel(), context); + return this; + } + + IpGroupImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new IpGroupInner(); + this.serviceManager = serviceManager; + this.ipGroupsName = name; + } + + public IpGroupImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public IpGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIpGroups() + .updateGroupsWithResponse(resourceGroupName, ipGroupsName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public IpGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpGroups() + .updateGroupsWithResponse(resourceGroupName, ipGroupsName, updateParameters, context) + .getValue(); + return this; + } + + IpGroupImpl(IpGroupInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipGroupsName = Utils.getValueFromIdByName(innerObject.id(), "ipGroups"); + } + + public IpGroup refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getIpGroups() + .getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public IpGroup refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getIpGroups() + .getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, localExpand, context) + .getValue(); + return this; + } + + public IpGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IpGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IpGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public IpGroupImpl withIpAddresses(List ipAddresses) { + this.innerModel().withIpAddresses(ipAddresses); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsClientImpl.java new file mode 100644 index 0000000000000..6aa2c851875bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsClientImpl.java @@ -0,0 +1,1463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.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.network.generated.fluent.IpGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.IpGroupListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 IpGroupsClient. */ +public final class IpGroupsClientImpl implements IpGroupsClient { + private final ClientLogger logger = new ClientLogger(IpGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IpGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of IpGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(IpGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientIpGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface IpGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" + + "/{ipGroupsName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipGroupsName") String ipGroupsName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" + + "/{ipGroupsName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipGroupsName") String ipGroupsName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IpGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" + + "/{ipGroupsName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> updateGroups( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipGroupsName") String ipGroupsName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" + + "/{ipGroupsName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipGroupsName") String ipGroupsName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroupNext( + @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(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ipGroupsName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipGroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipGroupsName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ipGroupsName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipGroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipGroupsName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ipGroupsName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipGroupsName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ipGroupsName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, ipGroupsName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpGroupInner getByResourceGroup(String resourceGroupName, String ipGroupsName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, ipGroupsName, expand).block(); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipGroupsName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipGroupsName, expand, context).block(); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipGroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipGroupsName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipGroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipGroupsName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IpGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, ipGroupsName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IpGroupInner.class, IpGroupInner.class, Context.NONE); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IpGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, ipGroupsName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IpGroupInner.class, IpGroupInner.class, context); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IpGroupInner> beginCreateOrUpdate( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IpGroupInner> beginCreateOrUpdate( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpGroupInner createOrUpdate(String resourceGroupName, String ipGroupsName, IpGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, ipGroupsName, parameters).block(); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpGroupInner createOrUpdate( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, ipGroupsName, parameters, context).block(); + } + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateGroupsWithResponseAsync( + String resourceGroupName, String ipGroupsName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipGroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipGroupsName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateGroups( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateGroupsWithResponseAsync( + String resourceGroupName, String ipGroupsName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipGroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipGroupsName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateGroups( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateGroupsAsync(String resourceGroupName, String ipGroupsName, TagsObject parameters) { + return updateGroupsWithResponseAsync(resourceGroupName, ipGroupsName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpGroupInner updateGroups(String resourceGroupName, String ipGroupsName, TagsObject parameters) { + return updateGroupsAsync(resourceGroupName, ipGroupsName, parameters).block(); + } + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateGroupsWithResponse( + String resourceGroupName, String ipGroupsName, TagsObject parameters, Context context) { + return updateGroupsWithResponseAsync(resourceGroupName, ipGroupsName, parameters, context).block(); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipGroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipGroupsName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ipGroupsName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipGroupsName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, ipGroupsName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, ipGroupsName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName) { + return beginDeleteAsync(resourceGroupName, ipGroupsName).getSyncPoller(); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName, Context context) { + return beginDeleteAsync(resourceGroupName, ipGroupsName, context).getSyncPoller(); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName) { + return beginDeleteAsync(resourceGroupName, ipGroupsName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName, Context context) { + return beginDeleteAsync(resourceGroupName, ipGroupsName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName) { + deleteAsync(resourceGroupName, ipGroupsName).block(); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 ipGroupsName, Context context) { + deleteAsync(resourceGroupName, ipGroupsName, context).block(); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all IpGroups in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all IpGroups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all IpGroups in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all IpGroups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all IpGroups in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all IpGroups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListIpGroups API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListIpGroups API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListIpGroups API service call. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListIpGroups API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsImpl.java new file mode 100644 index 0000000000000..da85761bfb02d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsImpl.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.network.generated.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.network.generated.fluent.IpGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.azure.resourcemanager.network.generated.models.IpGroup; +import com.azure.resourcemanager.network.generated.models.IpGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IpGroupsImpl implements IpGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpGroupsImpl.class); + + private final IpGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public IpGroupsImpl( + IpGroupsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public IpGroup getByResourceGroup(String resourceGroupName, String ipGroupsName) { + IpGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ipGroupsName); + if (inner != null) { + return new IpGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipGroupsName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String ipGroupsName) { + this.serviceClient().delete(resourceGroupName, ipGroupsName); + } + + public void delete(String resourceGroupName, String ipGroupsName, Context context) { + this.serviceClient().delete(resourceGroupName, ipGroupsName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public IpGroup 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 ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, expand, 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 ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + this.delete(resourceGroupName, ipGroupsName, 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 ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + this.delete(resourceGroupName, ipGroupsName, context); + } + + private IpGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public IpGroupImpl define(String name) { + return new IpGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsClientImpl.java new file mode 100644 index 0000000000000..61d64ea960928 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsClientImpl.java @@ -0,0 +1,1174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancerBackendAddressPoolsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddressPoolListResult; +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 LoadBalancerBackendAddressPoolsClient. */ +public final class LoadBalancerBackendAddressPoolsClientImpl implements LoadBalancerBackendAddressPoolsClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerBackendAddressPoolsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerBackendAddressPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerBackendAddressPoolsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerBackendAddressPoolsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerBackendAddressPools to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerBackendAddressPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/backendAddressPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("backendAddressPoolName") String backendAddressPoolName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("backendAddressPoolName") String backendAddressPoolName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackendAddressPoolInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("backendAddressPoolName") String backendAddressPoolName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (backendAddressPoolName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter backendAddressPoolName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + backendAddressPoolName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (backendAddressPoolName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter backendAddressPoolName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + backendAddressPoolName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackendAddressPoolInner get( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).block(); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, context).block(); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (backendAddressPoolName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter backendAddressPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + backendAddressPoolName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (backendAddressPoolName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter backendAddressPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + backendAddressPoolName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BackendAddressPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BackendAddressPoolInner.class, + BackendAddressPoolInner.class, + Context.NONE); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BackendAddressPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BackendAddressPoolInner.class, + BackendAddressPoolInner.class, + context); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BackendAddressPoolInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BackendAddressPoolInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackendAddressPoolInner createOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters) { + return createOrUpdateAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters).block(); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackendAddressPoolInner createOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, context) + .block(); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String backendAddressPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (backendAddressPoolName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter backendAddressPoolName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + backendAddressPoolName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String backendAddressPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (backendAddressPoolName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter backendAddressPoolName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + backendAddressPoolName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String backendAddressPoolName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String backendAddressPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String backendAddressPoolName) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).getSyncPoller(); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String backendAddressPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, context).getSyncPoller(); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String backendAddressPoolName) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, String backendAddressPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 loadBalancerName, String backendAddressPoolName) { + deleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).block(); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 loadBalancerName, String backendAddressPoolName, Context context) { + deleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, 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 response for ListBackendAddressPool API service call. + */ + @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 response for ListBackendAddressPool API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsImpl.java new file mode 100644 index 0000000000000..e8406f1049d91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancerBackendAddressPoolsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddressPools; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerBackendAddressPoolsImpl implements LoadBalancerBackendAddressPools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPoolsImpl.class); + + private final LoadBalancerBackendAddressPoolsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerBackendAddressPoolsImpl( + LoadBalancerBackendAddressPoolsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new BackendAddressPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new BackendAddressPoolImpl(inner1, this.manager())); + } + + public BackendAddressPool get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + BackendAddressPoolInner inner = + this.serviceClient().get(resourceGroupName, loadBalancerName, backendAddressPoolName); + if (inner != null) { + return new BackendAddressPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackendAddressPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, backendAddressPoolName); + } + + public void delete( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + } + + public BackendAddressPool 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + return this + .getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + return this.getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, backendAddressPoolName, 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + } + + private LoadBalancerBackendAddressPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public BackendAddressPoolImpl define(String name) { + return new BackendAddressPoolImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java new file mode 100644 index 0000000000000..2709ef8c483cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java @@ -0,0 +1,541 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancerFrontendIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerFrontendIpConfigurationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * LoadBalancerFrontendIpConfigurationsClient. + */ +public final class LoadBalancerFrontendIpConfigurationsClientImpl + implements LoadBalancerFrontendIpConfigurationsClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerFrontendIpConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerFrontendIpConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerFrontendIpConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerFrontendIpConfigurationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerFrontendIpConfigurations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerFrontendIpConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/frontendIPConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("frontendIPConfigurationName") String frontendIpConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (frontendIpConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter frontendIpConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + frontendIpConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (frontendIpConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter frontendIpConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + frontendIpConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, frontendIpConfigurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FrontendIpConfigurationInner get( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName) { + return getAsync(resourceGroupName, loadBalancerName, frontendIpConfigurationName).block(); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, frontendIpConfigurationName, 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 response for ListFrontendIPConfiguration API service call. + */ + @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 response for ListFrontendIPConfiguration API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsImpl.java new file mode 100644 index 0000000000000..1c72bee41b6ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsImpl.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancerFrontendIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.LoadBalancerFrontendIpConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerFrontendIpConfigurationsImpl implements LoadBalancerFrontendIpConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfigurationsImpl.class); + + private final LoadBalancerFrontendIpConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerFrontendIpConfigurationsImpl( + LoadBalancerFrontendIpConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new FrontendIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new FrontendIpConfigurationImpl(inner1, this.manager())); + } + + public FrontendIpConfiguration get( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName) { + FrontendIpConfigurationInner inner = + this.serviceClient().get(resourceGroupName, loadBalancerName, frontendIpConfigurationName); + if (inner != null) { + return new FrontendIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, loadBalancerName, frontendIpConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FrontendIpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LoadBalancerFrontendIpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerImpl.java new file mode 100644 index 0000000000000..c63a36c4344ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerImpl.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.InboundNatRule; +import com.azure.resourcemanager.network.generated.models.LoadBalancer; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.network.generated.models.LoadBalancingRule; +import com.azure.resourcemanager.network.generated.models.OutboundRule; +import com.azure.resourcemanager.network.generated.models.Probe; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class LoadBalancerImpl implements LoadBalancer, LoadBalancer.Definition, LoadBalancer.Update { + private LoadBalancerInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public LoadBalancerSku sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List frontendIpConfigurations() { + List inner = this.innerModel().frontendIpConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new FrontendIpConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List backendAddressPools() { + List inner = this.innerModel().backendAddressPools(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new BackendAddressPoolImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new LoadBalancingRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List probes() { + List inner = this.innerModel().probes(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new ProbeImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new InboundNatRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List inboundNatPools() { + List inner = this.innerModel().inboundNatPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List outboundRules() { + List inner = this.innerModel().outboundRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new OutboundRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public LoadBalancerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String loadBalancerName; + + private TagsObject updateParameters; + + public LoadBalancerImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LoadBalancer create() { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancers() + .createOrUpdate(resourceGroupName, loadBalancerName, this.innerModel(), Context.NONE); + return this; + } + + public LoadBalancer create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancers() + .createOrUpdate(resourceGroupName, loadBalancerName, this.innerModel(), context); + return this; + } + + LoadBalancerImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new LoadBalancerInner(); + this.serviceManager = serviceManager; + this.loadBalancerName = name; + } + + public LoadBalancerImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public LoadBalancer apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancers() + .updateTagsWithResponse(resourceGroupName, loadBalancerName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public LoadBalancer apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancers() + .updateTagsWithResponse(resourceGroupName, loadBalancerName, updateParameters, context) + .getValue(); + return this; + } + + LoadBalancerImpl( + LoadBalancerInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = Utils.getValueFromIdByName(innerObject.id(), "loadBalancers"); + } + + public LoadBalancer refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancers() + .getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public LoadBalancer refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancers() + .getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, localExpand, context) + .getValue(); + return this; + } + + public LoadBalancerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LoadBalancerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LoadBalancerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public LoadBalancerImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public LoadBalancerImpl withSku(LoadBalancerSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public LoadBalancerImpl withFrontendIpConfigurations(List frontendIpConfigurations) { + this.innerModel().withFrontendIpConfigurations(frontendIpConfigurations); + return this; + } + + public LoadBalancerImpl withBackendAddressPools(List backendAddressPools) { + this.innerModel().withBackendAddressPools(backendAddressPools); + return this; + } + + public LoadBalancerImpl withLoadBalancingRules(List loadBalancingRules) { + this.innerModel().withLoadBalancingRules(loadBalancingRules); + return this; + } + + public LoadBalancerImpl withProbes(List probes) { + this.innerModel().withProbes(probes); + return this; + } + + public LoadBalancerImpl withInboundNatRules(List inboundNatRules) { + this.innerModel().withInboundNatRules(inboundNatRules); + return this; + } + + public LoadBalancerImpl withInboundNatPools(List inboundNatPools) { + this.innerModel().withInboundNatPools(inboundNatPools); + return this; + } + + public LoadBalancerImpl withOutboundRules(List outboundRules) { + this.innerModel().withOutboundRules(outboundRules); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesClientImpl.java new file mode 100644 index 0000000000000..3de2659faef2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesClientImpl.java @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancerLoadBalancingRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerLoadBalancingRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerLoadBalancingRulesClient. */ +public final class LoadBalancerLoadBalancingRulesClientImpl implements LoadBalancerLoadBalancingRulesClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerLoadBalancingRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerLoadBalancingRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerLoadBalancingRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerLoadBalancingRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerLoadBalancingRulesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerLoadBalancingRules to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerLoadBalancingRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/loadBalancingRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("loadBalancingRuleName") String loadBalancingRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (loadBalancingRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancingRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + loadBalancingRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (loadBalancingRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancingRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + loadBalancingRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).block(); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName, 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 response for ListLoadBalancingRule API service call. + */ + @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 response for ListLoadBalancingRule API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesImpl.java new file mode 100644 index 0000000000000..d37b6a319e205 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancerLoadBalancingRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerLoadBalancingRules; +import com.azure.resourcemanager.network.generated.models.LoadBalancingRule; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerLoadBalancingRulesImpl implements LoadBalancerLoadBalancingRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerLoadBalancingRulesImpl.class); + + private final LoadBalancerLoadBalancingRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerLoadBalancingRulesImpl( + LoadBalancerLoadBalancingRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new LoadBalancingRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new LoadBalancingRuleImpl(inner1, this.manager())); + } + + public LoadBalancingRule get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + LoadBalancingRuleInner inner = + this.serviceClient().get(resourceGroupName, loadBalancerName, loadBalancingRuleName); + if (inner != null) { + return new LoadBalancingRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, loadBalancerName, loadBalancingRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LoadBalancingRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LoadBalancerLoadBalancingRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesClientImpl.java new file mode 100644 index 0000000000000..6bd13eac95f11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesClientImpl.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancerNetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerNetworkInterfacesClient. */ +public final class LoadBalancerNetworkInterfacesClientImpl implements LoadBalancerNetworkInterfacesClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerNetworkInterfacesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerNetworkInterfacesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerNetworkInterfacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerNetworkInterfacesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerNetworkInterfacesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerNetworkInterfaces to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerNetworkInterfacesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, 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 response for the ListNetworkInterface API service call. + */ + @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 response for the ListNetworkInterface API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesImpl.java new file mode 100644 index 0000000000000..ca008886637a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesImpl.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.network.generated.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.network.generated.fluent.LoadBalancerNetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerNetworkInterfaces; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerNetworkInterfacesImpl implements LoadBalancerNetworkInterfaces { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerNetworkInterfacesImpl.class); + + private final LoadBalancerNetworkInterfacesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerNetworkInterfacesImpl( + LoadBalancerNetworkInterfacesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + private LoadBalancerNetworkInterfacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java new file mode 100644 index 0000000000000..1514c9a2197b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancerOutboundRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerOutboundRulesClient. */ +public final class LoadBalancerOutboundRulesClientImpl implements LoadBalancerOutboundRulesClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerOutboundRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerOutboundRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerOutboundRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerOutboundRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerOutboundRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerOutboundRules to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerOutboundRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/outboundRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("outboundRuleName") String outboundRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String outboundRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (outboundRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter outboundRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + outboundRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (outboundRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter outboundRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + outboundRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String loadBalancerName, String outboundRuleName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleInner get(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + return getAsync(resourceGroupName, loadBalancerName, outboundRuleName).block(); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName, 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 response for ListOutboundRule API service call. + */ + @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 response for ListOutboundRule API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesImpl.java new file mode 100644 index 0000000000000..61b110d09617a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesImpl.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.network.generated.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.network.generated.fluent.LoadBalancerOutboundRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRules; +import com.azure.resourcemanager.network.generated.models.OutboundRule; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerOutboundRulesImpl implements LoadBalancerOutboundRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerOutboundRulesImpl.class); + + private final LoadBalancerOutboundRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerOutboundRulesImpl( + LoadBalancerOutboundRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new OutboundRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new OutboundRuleImpl(inner1, this.manager())); + } + + public OutboundRule get(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + OutboundRuleInner inner = this.serviceClient().get(resourceGroupName, loadBalancerName, outboundRuleName); + if (inner != null) { + return new OutboundRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, loadBalancerName, outboundRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OutboundRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LoadBalancerOutboundRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesClientImpl.java new file mode 100644 index 0000000000000..06d961087ad9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesClientImpl.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancerProbesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerProbeListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerProbesClient. */ +public final class LoadBalancerProbesClientImpl implements LoadBalancerProbesClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerProbesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerProbesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerProbesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerProbesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(LoadBalancerProbesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerProbes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerProbesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/probes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/probes/{probeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("probeName") String probeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String loadBalancerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String loadBalancerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String probeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (probeName == null) { + return Mono.error(new IllegalArgumentException("Parameter probeName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + probeName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String loadBalancerName, String probeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (probeName == null) { + return Mono.error(new IllegalArgumentException("Parameter probeName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + probeName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, probeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName) { + return getAsync(resourceGroupName, loadBalancerName, probeName).block(); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String probeName, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, probeName, 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 response for ListProbe API service call. + */ + @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 response for ListProbe API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesImpl.java new file mode 100644 index 0000000000000..3a65b5be97f4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesImpl.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.network.generated.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.network.generated.fluent.LoadBalancerProbesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerProbes; +import com.azure.resourcemanager.network.generated.models.Probe; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerProbesImpl implements LoadBalancerProbes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerProbesImpl.class); + + private final LoadBalancerProbesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerProbesImpl( + LoadBalancerProbesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new ProbeImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new ProbeImpl(inner1, this.manager())); + } + + public Probe get(String resourceGroupName, String loadBalancerName, String probeName) { + ProbeInner inner = this.serviceClient().get(resourceGroupName, loadBalancerName, probeName); + if (inner != null) { + return new ProbeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String probeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, loadBalancerName, probeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProbeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LoadBalancerProbesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersClientImpl.java new file mode 100644 index 0000000000000..00075c8f172fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersClientImpl.java @@ -0,0 +1,1727 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerListResult; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequest; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 LoadBalancersClient. */ +public final class LoadBalancersClientImpl implements LoadBalancersClient { + private final ClientLogger logger = new ClientLogger(LoadBalancersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(LoadBalancersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancers to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancersService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LoadBalancerInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/setLoadBalancerFrontendPublicIpAddresses") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> swapPublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LoadBalancerVipSwapRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, loadBalancerName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, loadBalancerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName) { + return beginDeleteAsync(resourceGroupName, loadBalancerName).getSyncPoller(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, Context context) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, context).getSyncPoller(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName) { + return beginDeleteAsync(resourceGroupName, loadBalancerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 loadBalancerName, Context context) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 loadBalancerName) { + deleteAsync(resourceGroupName, loadBalancerName).block(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 loadBalancerName, Context context) { + deleteAsync(resourceGroupName, loadBalancerName, context).block(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String loadBalancerName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String loadBalancerName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, loadBalancerName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String loadBalancerName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, loadBalancerName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, loadBalancerName, expand).block(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String loadBalancerName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, loadBalancerName, expand, context).block(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LoadBalancerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, loadBalancerName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LoadBalancerInner.class, LoadBalancerInner.class, Context.NONE); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LoadBalancerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, loadBalancerName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LoadBalancerInner.class, LoadBalancerInner.class, context); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LoadBalancerInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LoadBalancerInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadBalancerInner createOrUpdate( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).block(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadBalancerInner createOrUpdate( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, loadBalancerName, parameters, context).block(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String loadBalancerName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String loadBalancerName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, loadBalancerName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, loadBalancerName, parameters).block(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, loadBalancerName, parameters, context).block(); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the load balancers 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 all the load balancers in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancers 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 all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the load balancers 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 all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> swapPublicIpAddressesWithResponseAsync( + String location, LoadBalancerVipSwapRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .swapPublicIpAddresses( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> swapPublicIpAddressesWithResponseAsync( + String location, LoadBalancerVipSwapRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .swapPublicIpAddresses( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginSwapPublicIpAddressesAsync( + String location, LoadBalancerVipSwapRequest parameters) { + Mono>> mono = swapPublicIpAddressesWithResponseAsync(location, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginSwapPublicIpAddressesAsync( + String location, LoadBalancerVipSwapRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = swapPublicIpAddressesWithResponseAsync(location, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginSwapPublicIpAddresses( + String location, LoadBalancerVipSwapRequest parameters) { + return beginSwapPublicIpAddressesAsync(location, parameters).getSyncPoller(); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginSwapPublicIpAddresses( + String location, LoadBalancerVipSwapRequest parameters, Context context) { + return beginSwapPublicIpAddressesAsync(location, parameters, context).getSyncPoller(); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 swapPublicIpAddressesAsync(String location, LoadBalancerVipSwapRequest parameters) { + return beginSwapPublicIpAddressesAsync(location, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 swapPublicIpAddressesAsync( + String location, LoadBalancerVipSwapRequest parameters, Context context) { + return beginSwapPublicIpAddressesAsync(location, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters) { + swapPublicIpAddressesAsync(location, parameters).block(); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters, Context context) { + swapPublicIpAddressesAsync(location, parameters, 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 response for ListLoadBalancers API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListLoadBalancers API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for ListLoadBalancers API service call. + */ + @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 response for ListLoadBalancers API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersImpl.java new file mode 100644 index 0000000000000..310f30473f259 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersImpl.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.network.generated.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.network.generated.fluent.LoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancer; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequest; +import com.azure.resourcemanager.network.generated.models.LoadBalancers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancersImpl implements LoadBalancers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancersImpl.class); + + private final LoadBalancersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancersImpl( + LoadBalancersClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String loadBalancerName) { + this.serviceClient().delete(resourceGroupName, loadBalancerName); + } + + public void delete(String resourceGroupName, String loadBalancerName, Context context) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, context); + } + + public LoadBalancer getByResourceGroup(String resourceGroupName, String loadBalancerName) { + LoadBalancerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, loadBalancerName); + if (inner != null) { + return new LoadBalancerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String loadBalancerName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LoadBalancerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public void swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters) { + this.serviceClient().swapPublicIpAddresses(location, parameters); + } + + public void swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters, Context context) { + this.serviceClient().swapPublicIpAddresses(location, parameters, context); + } + + public LoadBalancer 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, expand, 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, 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 loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, context); + } + + private LoadBalancersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public LoadBalancerImpl define(String name) { + return new LoadBalancerImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancingRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancingRuleImpl.java new file mode 100644 index 0000000000000..fd1f2813fee64 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancingRuleImpl.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancingRule; +import com.azure.resourcemanager.network.generated.models.LoadDistribution; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import java.util.Collections; +import java.util.List; + +public final class LoadBalancingRuleImpl implements LoadBalancingRule { + private LoadBalancingRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + LoadBalancingRuleImpl( + LoadBalancingRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource frontendIpConfiguration() { + return this.innerModel().frontendIpConfiguration(); + } + + public SubResource backendAddressPool() { + return this.innerModel().backendAddressPool(); + } + + public List backendAddressPools() { + List inner = this.innerModel().backendAddressPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource probe() { + return this.innerModel().probe(); + } + + public TransportProtocol protocol() { + return this.innerModel().protocol(); + } + + public LoadDistribution loadDistribution() { + return this.innerModel().loadDistribution(); + } + + public Integer frontendPort() { + return this.innerModel().frontendPort(); + } + + public Integer backendPort() { + return this.innerModel().backendPort(); + } + + public Integer idleTimeoutInMinutes() { + return this.innerModel().idleTimeoutInMinutes(); + } + + public Boolean enableFloatingIp() { + return this.innerModel().enableFloatingIp(); + } + + public Boolean enableTcpReset() { + return this.innerModel().enableTcpReset(); + } + + public Boolean disableOutboundSnat() { + return this.innerModel().disableOutboundSnat(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public LoadBalancingRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewayImpl.java new file mode 100644 index 0000000000000..20a7c99f46412 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewayImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class LocalNetworkGatewayImpl + implements LocalNetworkGateway, LocalNetworkGateway.Definition, LocalNetworkGateway.Update { + private LocalNetworkGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public AddressSpace localNetworkAddressSpace() { + return this.innerModel().localNetworkAddressSpace(); + } + + public String gatewayIpAddress() { + return this.innerModel().gatewayIpAddress(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public BgpSettings bgpSettings() { + return this.innerModel().bgpSettings(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public LocalNetworkGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String localNetworkGatewayName; + + private TagsObject updateParameters; + + public LocalNetworkGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LocalNetworkGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getLocalNetworkGateways() + .createOrUpdate(resourceGroupName, localNetworkGatewayName, this.innerModel(), Context.NONE); + return this; + } + + public LocalNetworkGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLocalNetworkGateways() + .createOrUpdate(resourceGroupName, localNetworkGatewayName, this.innerModel(), context); + return this; + } + + LocalNetworkGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new LocalNetworkGatewayInner(); + this.serviceManager = serviceManager; + this.localNetworkGatewayName = name; + } + + public LocalNetworkGatewayImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public LocalNetworkGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLocalNetworkGateways() + .updateTagsWithResponse(resourceGroupName, localNetworkGatewayName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public LocalNetworkGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLocalNetworkGateways() + .updateTagsWithResponse(resourceGroupName, localNetworkGatewayName, updateParameters, context) + .getValue(); + return this; + } + + LocalNetworkGatewayImpl( + LocalNetworkGatewayInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.localNetworkGatewayName = Utils.getValueFromIdByName(innerObject.id(), "localNetworkGateways"); + } + + public LocalNetworkGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLocalNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, Context.NONE) + .getValue(); + return this; + } + + public LocalNetworkGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLocalNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, context) + .getValue(); + return this; + } + + public LocalNetworkGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LocalNetworkGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LocalNetworkGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public LocalNetworkGatewayImpl withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.innerModel().withLocalNetworkAddressSpace(localNetworkAddressSpace); + return this; + } + + public LocalNetworkGatewayImpl withGatewayIpAddress(String gatewayIpAddress) { + this.innerModel().withGatewayIpAddress(gatewayIpAddress); + return this; + } + + public LocalNetworkGatewayImpl withFqdn(String fqdn) { + this.innerModel().withFqdn(fqdn); + return this; + } + + public LocalNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.innerModel().withBgpSettings(bgpSettings); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysClientImpl.java new file mode 100644 index 0000000000000..9ca52fc87ecf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysClientImpl.java @@ -0,0 +1,1254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LocalNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGatewayListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 LocalNetworkGatewaysClient. */ +public final class LocalNetworkGatewaysClientImpl implements LocalNetworkGatewaysClient { + private final ClientLogger logger = new ClientLogger(LocalNetworkGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LocalNetworkGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LocalNetworkGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocalNetworkGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(LocalNetworkGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLocalNetworkGateways to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LocalNetworkGatewaysService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways/{localNetworkGatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("localNetworkGatewayName") String localNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LocalNetworkGatewayInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways/{localNetworkGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("localNetworkGatewayName") String localNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways/{localNetworkGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("localNetworkGatewayName") String localNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways/{localNetworkGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("localNetworkGatewayName") String localNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (localNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + localNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String localNetworkGatewayName, + LocalNetworkGatewayInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (localNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + localNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LocalNetworkGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LocalNetworkGatewayInner.class, + LocalNetworkGatewayInner.class, + Context.NONE); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LocalNetworkGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String localNetworkGatewayName, + LocalNetworkGatewayInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LocalNetworkGatewayInner.class, + LocalNetworkGatewayInner.class, + context); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String localNetworkGatewayName, + LocalNetworkGatewayInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String localNetworkGatewayName, + LocalNetworkGatewayInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalNetworkGatewayInner createOrUpdate( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).block(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalNetworkGatewayInner createOrUpdate( + String resourceGroupName, + String localNetworkGatewayName, + LocalNetworkGatewayInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters, context).block(); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String localNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (localNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter localNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + localNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String localNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (localNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter localNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + localNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, localNetworkGatewayName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupAsync(resourceGroupName, localNetworkGatewayName).block(); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String localNetworkGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, localNetworkGatewayName, context).block(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 localNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (localNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter localNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + localNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 localNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (localNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter localNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + localNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 localNetworkGatewayName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, localNetworkGatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 localNetworkGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, localNetworkGatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 localNetworkGatewayName) { + return beginDeleteAsync(resourceGroupName, localNetworkGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 localNetworkGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, localNetworkGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 localNetworkGatewayName) { + return beginDeleteAsync(resourceGroupName, localNetworkGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 localNetworkGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, localNetworkGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 localNetworkGatewayName) { + deleteAsync(resourceGroupName, localNetworkGatewayName).block(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 localNetworkGatewayName, Context context) { + deleteAsync(resourceGroupName, localNetworkGatewayName, context).block(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (localNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + localNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (localNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + localNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalNetworkGatewayInner updateTags( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters).block(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters, context).block(); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for ListLocalNetworkGateways API service call. + */ + @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 response for ListLocalNetworkGateways API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysImpl.java new file mode 100644 index 0000000000000..33958fd348e81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.LocalNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateway; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LocalNetworkGatewaysImpl implements LocalNetworkGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewaysImpl.class); + + private final LocalNetworkGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LocalNetworkGatewaysImpl( + LocalNetworkGatewaysClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public LocalNetworkGateway getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + LocalNetworkGatewayInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, localNetworkGatewayName); + if (inner != null) { + return new LocalNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String localNetworkGatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LocalNetworkGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + this.serviceClient().delete(resourceGroupName, localNetworkGatewayName); + } + + public void delete(String resourceGroupName, String localNetworkGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, localNetworkGatewayName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new LocalNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LocalNetworkGatewayImpl(inner1, this.manager())); + } + + public LocalNetworkGateway 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 localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, 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 localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, 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 localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, localNetworkGatewayName, 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 localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, localNetworkGatewayName, context); + } + + private LocalNetworkGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public LocalNetworkGatewayImpl define(String name) { + return new LocalNetworkGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewayImpl.java new file mode 100644 index 0000000000000..2fae83be87716 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewayImpl.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.models.NatGateway; +import com.azure.resourcemanager.network.generated.models.NatGatewaySku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NatGatewayImpl implements NatGateway, NatGateway.Definition, NatGateway.Update { + private NatGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 NatGatewaySku sku() { + return this.innerModel().sku(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Integer idleTimeoutInMinutes() { + return this.innerModel().idleTimeoutInMinutes(); + } + + public List publicIpAddresses() { + List inner = this.innerModel().publicIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List publicIpPrefixes() { + List inner = this.innerModel().publicIpPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List subnets() { + List inner = this.innerModel().subnets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NatGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String natGatewayName; + + private TagsObject updateParameters; + + public NatGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NatGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getNatGateways() + .createOrUpdate(resourceGroupName, natGatewayName, this.innerModel(), Context.NONE); + return this; + } + + public NatGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNatGateways() + .createOrUpdate(resourceGroupName, natGatewayName, this.innerModel(), context); + return this; + } + + NatGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NatGatewayInner(); + this.serviceManager = serviceManager; + this.natGatewayName = name; + } + + public NatGatewayImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NatGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNatGateways() + .updateTagsWithResponse(resourceGroupName, natGatewayName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NatGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNatGateways() + .updateTagsWithResponse(resourceGroupName, natGatewayName, updateParameters, context) + .getValue(); + return this; + } + + NatGatewayImpl( + NatGatewayInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.natGatewayName = Utils.getValueFromIdByName(innerObject.id(), "natGateways"); + } + + public NatGateway refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNatGateways() + .getByResourceGroupWithResponse(resourceGroupName, natGatewayName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NatGateway refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNatGateways() + .getByResourceGroupWithResponse(resourceGroupName, natGatewayName, localExpand, context) + .getValue(); + return this; + } + + public NatGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NatGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NatGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NatGatewayImpl withSku(NatGatewaySku sku) { + this.innerModel().withSku(sku); + return this; + } + + public NatGatewayImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public NatGatewayImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.innerModel().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + public NatGatewayImpl withPublicIpAddresses(List publicIpAddresses) { + this.innerModel().withPublicIpAddresses(publicIpAddresses); + return this; + } + + public NatGatewayImpl withPublicIpPrefixes(List publicIpPrefixes) { + this.innerModel().withPublicIpPrefixes(publicIpPrefixes); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysClientImpl.java new file mode 100644 index 0000000000000..96c625a93bd57 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysClientImpl.java @@ -0,0 +1,1464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NatGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.models.NatGatewayListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 NatGatewaysClient. */ +public final class NatGatewaysClientImpl implements NatGatewaysClient { + private final ClientLogger logger = new ClientLogger(NatGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NatGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NatGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NatGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(NatGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNatGateways to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NatGatewaysService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" + + "/{natGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("natGatewayName") String natGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" + + "/{natGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("natGatewayName") String natGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" + + "/{natGatewayName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("natGatewayName") String natGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NatGatewayInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" + + "/{natGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("natGatewayName") String natGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/natGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 natGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (natGatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter natGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 natGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (natGatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter natGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 natGatewayName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, natGatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 natGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, natGatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 natGatewayName) { + return beginDeleteAsync(resourceGroupName, natGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 natGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, natGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 natGatewayName) { + return beginDeleteAsync(resourceGroupName, natGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 natGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, natGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 natGatewayName) { + deleteAsync(resourceGroupName, natGatewayName).block(); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 natGatewayName, Context context) { + deleteAsync(resourceGroupName, natGatewayName, context).block(); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String natGatewayName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (natGatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter natGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String natGatewayName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (natGatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter natGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String natGatewayName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, natGatewayName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String natGatewayName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, natGatewayName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NatGatewayInner getByResourceGroup(String resourceGroupName, String natGatewayName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, natGatewayName, expand).block(); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String natGatewayName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, natGatewayName, expand, context).block(); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (natGatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter natGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (natGatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter natGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NatGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, natGatewayName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NatGatewayInner.class, NatGatewayInner.class, Context.NONE); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NatGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, natGatewayName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NatGatewayInner.class, NatGatewayInner.class, context); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NatGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NatGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NatGatewayInner createOrUpdate(String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + return createOrUpdateAsync(resourceGroupName, natGatewayName, parameters).block(); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NatGatewayInner createOrUpdate( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, natGatewayName, parameters, context).block(); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String natGatewayName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (natGatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter natGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String natGatewayName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (natGatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter natGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String natGatewayName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, natGatewayName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NatGatewayInner updateTags(String resourceGroupName, String natGatewayName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, natGatewayName, parameters).block(); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String natGatewayName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, natGatewayName, parameters, context).block(); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Nat Gateways 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 all the Nat Gateways in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Nat Gateways 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 all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Nat Gateways 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 all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for ListNatGateways API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListNatGateways API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for ListNatGateways API service call. + */ + @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 response for ListNatGateways API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysImpl.java new file mode 100644 index 0000000000000..fedd6cbe0e9ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysImpl.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.network.generated.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.network.generated.fluent.NatGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.models.NatGateway; +import com.azure.resourcemanager.network.generated.models.NatGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NatGatewaysImpl implements NatGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatGatewaysImpl.class); + + private final NatGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NatGatewaysImpl( + NatGatewaysClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String natGatewayName) { + this.serviceClient().delete(resourceGroupName, natGatewayName); + } + + public void delete(String resourceGroupName, String natGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, natGatewayName, context); + } + + public NatGateway getByResourceGroup(String resourceGroupName, String natGatewayName) { + NatGatewayInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, natGatewayName); + if (inner != null) { + return new NatGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String natGatewayName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, natGatewayName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NatGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public NatGateway 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 natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, natGatewayName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, natGatewayName, expand, 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 natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + this.delete(resourceGroupName, natGatewayName, 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 natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + this.delete(resourceGroupName, natGatewayName, context); + } + + private NatGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NatGatewayImpl define(String name) { + return new NatGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java new file mode 100644 index 0000000000000..40bb203132ad7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java @@ -0,0 +1,1127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.ListVpnGatewayNatRulesResult; +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 NatRulesClient. */ +public final class NatRulesClientImpl implements NatRulesClient { + private final ClientLogger logger = new ClientLogger(NatRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NatRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NatRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NatRulesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(NatRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNatRules to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NatRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnGatewayNatRuleInner natRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/natRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnGateway( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnGatewayNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String gatewayName, String natRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + natRuleName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String gatewayName, String natRuleName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + natRuleName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String gatewayName, String natRuleName) { + return getWithResponseAsync(resourceGroupName, gatewayName, natRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayNatRuleInner get(String resourceGroupName, String gatewayName, String natRuleName) { + return getAsync(resourceGroupName, gatewayName, natRuleName).block(); + } + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String gatewayName, String natRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, gatewayName, natRuleName, context).block(); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + if (natRuleParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter natRuleParameters is required and cannot be null.")); + } else { + natRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + natRuleName, + apiVersion, + natRuleParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String gatewayName, + String natRuleName, + VpnGatewayNatRuleInner natRuleParameters, + 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + if (natRuleParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter natRuleParameters is required and cannot be null.")); + } else { + natRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + natRuleName, + apiVersion, + natRuleParameters, + accept, + context); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnGatewayNatRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnGatewayNatRuleInner.class, + VpnGatewayNatRuleInner.class, + Context.NONE); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnGatewayNatRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String gatewayName, + String natRuleName, + VpnGatewayNatRuleInner natRuleParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnGatewayNatRuleInner.class, + VpnGatewayNatRuleInner.class, + context); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters).getSyncPoller(); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String gatewayName, + String natRuleName, + VpnGatewayNatRuleInner natRuleParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String gatewayName, + String natRuleName, + VpnGatewayNatRuleInner natRuleParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayNatRuleInner createOrUpdate( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters) { + return createOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters).block(); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayNatRuleInner createOrUpdate( + String resourceGroupName, + String gatewayName, + String natRuleName, + VpnGatewayNatRuleInner natRuleParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, context).block(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String natRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + natRuleName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String natRuleName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + natRuleName, + apiVersion, + accept, + context); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String natRuleName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName, natRuleName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String natRuleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, gatewayName, natRuleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String natRuleName) { + return beginDeleteAsync(resourceGroupName, gatewayName, natRuleName).getSyncPoller(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String natRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, natRuleName, context).getSyncPoller(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String natRuleName) { + return beginDeleteAsync(resourceGroupName, gatewayName, natRuleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String natRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, natRuleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 gatewayName, String natRuleName) { + deleteAsync(resourceGroupName, gatewayName, natRuleName).block(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 gatewayName, String natRuleName, Context context) { + deleteAsync(resourceGroupName, gatewayName, natRuleName, context).block(); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnGatewaySinglePageAsync( + String resourceGroupName, String gatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByVpnGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + 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())); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnGatewaySinglePageAsync( + String resourceGroupName, String gatewayName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVpnGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnGatewayAsync(String resourceGroupName, String gatewayName) { + return new PagedFlux<>( + () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), + nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnGatewayAsync( + String resourceGroupName, String gatewayName, Context context) { + return new PagedFlux<>( + () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName, context), + nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName) { + return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName)); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName, 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 result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnGatewayNextSinglePageAsync(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.listByVpnGatewayNext(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 result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnGatewayNextSinglePageAsync( + 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 + .listByVpnGatewayNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesImpl.java new file mode 100644 index 0000000000000..a6bd50d3917b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesImpl.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.network.generated.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.network.generated.fluent.NatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.NatRules; +import com.azure.resourcemanager.network.generated.models.VpnGatewayNatRule; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NatRulesImpl implements NatRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatRulesImpl.class); + + private final NatRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NatRulesImpl( + NatRulesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnGatewayNatRule get(String resourceGroupName, String gatewayName, String natRuleName) { + VpnGatewayNatRuleInner inner = this.serviceClient().get(resourceGroupName, gatewayName, natRuleName); + if (inner != null) { + return new VpnGatewayNatRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String gatewayName, String natRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, gatewayName, natRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnGatewayNatRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String gatewayName, String natRuleName) { + this.serviceClient().delete(resourceGroupName, gatewayName, natRuleName); + } + + public void delete(String resourceGroupName, String gatewayName, String natRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, gatewayName, natRuleName, context); + } + + public PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName) { + PagedIterable inner = + this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName); + return Utils.mapPage(inner, inner1 -> new VpnGatewayNatRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName, context); + return Utils.mapPage(inner, inner1 -> new VpnGatewayNatRuleImpl(inner1, this.manager())); + } + + public VpnGatewayNatRule 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 gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, gatewayName, natRuleName, 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 gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, gatewayName, natRuleName, 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 gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, gatewayName, natRuleName, 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 gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, gatewayName, natRuleName, context); + } + + private NatRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnGatewayNatRuleImpl define(String name) { + return new VpnGatewayNatRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java new file mode 100644 index 0000000000000..b82442ab8e941 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResponse; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResult; +import java.util.Collections; +import java.util.List; + +public final class NetworkConfigurationDiagnosticResponseImpl implements NetworkConfigurationDiagnosticResponse { + private NetworkConfigurationDiagnosticResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkConfigurationDiagnosticResponseImpl( + NetworkConfigurationDiagnosticResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkConfigurationDiagnosticResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceImpl.java new file mode 100644 index 0000000000000..22bb31249bfc5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceImpl.java @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroupListResult; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteListResult; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceDnsSettings; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceMigrationPhase; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceNicType; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateLinkService; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class NetworkInterfaceImpl + implements NetworkInterface, NetworkInterface.Definition, NetworkInterface.Update { + private NetworkInterfaceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SubResource virtualMachine() { + return this.innerModel().virtualMachine(); + } + + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.innerModel().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpoint privateEndpoint() { + PrivateEndpointInner inner = this.innerModel().privateEndpoint(); + if (inner != null) { + return new PrivateEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List tapConfigurations() { + List inner = this.innerModel().tapConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkInterfaceTapConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public NetworkInterfaceDnsSettings dnsSettings() { + return this.innerModel().dnsSettings(); + } + + public String macAddress() { + return this.innerModel().macAddress(); + } + + public Boolean primary() { + return this.innerModel().primary(); + } + + public Boolean enableAcceleratedNetworking() { + return this.innerModel().enableAcceleratedNetworking(); + } + + public Boolean enableIpForwarding() { + return this.innerModel().enableIpForwarding(); + } + + public List hostedWorkloads() { + List inner = this.innerModel().hostedWorkloads(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource dscpConfiguration() { + return this.innerModel().dscpConfiguration(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String workloadType() { + return this.innerModel().workloadType(); + } + + public NetworkInterfaceNicType nicType() { + return this.innerModel().nicType(); + } + + public PrivateLinkService privateLinkService() { + PrivateLinkServiceInner inner = this.innerModel().privateLinkService(); + if (inner != null) { + return new PrivateLinkServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkInterfaceMigrationPhase migrationPhase() { + return this.innerModel().migrationPhase(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkInterfaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkInterfaceName; + + private TagsObject updateParameters; + + public NetworkInterfaceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkInterface create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .createOrUpdate(resourceGroupName, networkInterfaceName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkInterface create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .createOrUpdate(resourceGroupName, networkInterfaceName, this.innerModel(), context); + return this; + } + + NetworkInterfaceImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkInterfaceInner(); + this.serviceManager = serviceManager; + this.networkInterfaceName = name; + } + + public NetworkInterfaceImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkInterface apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .updateTagsWithResponse(resourceGroupName, networkInterfaceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterface apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .updateTagsWithResponse(resourceGroupName, networkInterfaceName, updateParameters, context) + .getValue(); + return this; + } + + NetworkInterfaceImpl( + NetworkInterfaceInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = Utils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + } + + public NetworkInterface refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterface refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, localExpand, context) + .getValue(); + return this; + } + + public EffectiveRouteListResult getEffectiveRouteTable() { + return serviceManager.networkInterfaces().getEffectiveRouteTable(resourceGroupName, networkInterfaceName); + } + + public EffectiveRouteListResult getEffectiveRouteTable(Context context) { + return serviceManager + .networkInterfaces() + .getEffectiveRouteTable(resourceGroupName, networkInterfaceName, context); + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups() { + return serviceManager + .networkInterfaces() + .listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName); + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups(Context context) { + return serviceManager + .networkInterfaces() + .listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, context); + } + + public NetworkInterfaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkInterfaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkInterfaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkInterfaceImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public NetworkInterfaceImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.innerModel().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + public NetworkInterfaceImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public NetworkInterfaceImpl withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + public NetworkInterfaceImpl withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.innerModel().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + public NetworkInterfaceImpl withEnableIpForwarding(Boolean enableIpForwarding) { + this.innerModel().withEnableIpForwarding(enableIpForwarding); + return this; + } + + public NetworkInterfaceImpl withWorkloadType(String workloadType) { + this.innerModel().withWorkloadType(workloadType); + return this; + } + + public NetworkInterfaceImpl withNicType(NetworkInterfaceNicType nicType) { + this.innerModel().withNicType(nicType); + return this; + } + + public NetworkInterfaceImpl withPrivateLinkService(PrivateLinkServiceInner privateLinkService) { + this.innerModel().withPrivateLinkService(privateLinkService); + return this; + } + + public NetworkInterfaceImpl withMigrationPhase(NetworkInterfaceMigrationPhase migrationPhase) { + this.innerModel().withMigrationPhase(migrationPhase); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java new file mode 100644 index 0000000000000..8c5e4fb7af7a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.InboundNatRule; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class NetworkInterfaceIpConfigurationImpl implements NetworkInterfaceIpConfiguration { + private NetworkInterfaceIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkInterfaceIpConfigurationImpl( + NetworkInterfaceIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource gatewayLoadBalancer() { + return this.innerModel().gatewayLoadBalancer(); + } + + public List virtualNetworkTaps() { + List inner = this.innerModel().virtualNetworkTaps(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List applicationGatewayBackendAddressPools() { + List inner = this.innerModel().applicationGatewayBackendAddressPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancerBackendAddressPools() { + List inner = this.innerModel().loadBalancerBackendAddressPools(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new BackendAddressPoolImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancerInboundNatRules() { + List inner = this.innerModel().loadBalancerInboundNatRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new InboundNatRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public IpVersion privateIpAddressVersion() { + return this.innerModel().privateIpAddressVersion(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean primary() { + return this.innerModel().primary(); + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public List applicationSecurityGroups() { + List inner = this.innerModel().applicationSecurityGroups(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties() { + return this.innerModel().privateLinkConnectionProperties(); + } + + public NetworkInterfaceIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsClientImpl.java new file mode 100644 index 0000000000000..b94d80cc13760 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsClientImpl.java @@ -0,0 +1,537 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkInterfaceIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in NetworkInterfaceIpConfigurationsClient. + */ +public final class NetworkInterfaceIpConfigurationsClientImpl implements NetworkInterfaceIpConfigurationsClient { + private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkInterfaceIpConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceIpConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfaceIpConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkInterfaceIpConfigurationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkInterfaceIpConfigurations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkInterfaceIpConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/ipConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkInterfaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName)); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName, context)); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + ipConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + ipConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getWithResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceIpConfigurationInner get( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).block(); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName, 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 response for list ip configurations API service call. + */ + @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 response for list ip configurations API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsImpl.java new file mode 100644 index 0000000000000..90659d71642b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkInterfaceIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkInterfaceIpConfigurationsImpl implements NetworkInterfaceIpConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationsImpl.class); + + private final NetworkInterfaceIpConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkInterfaceIpConfigurationsImpl( + NetworkInterfaceIpConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkInterfaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public NetworkInterfaceIpConfiguration get( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfaceIpConfigurationInner inner = + this.serviceClient().get(resourceGroupName, networkInterfaceName, ipConfigurationName); + if (inner != null) { + return new NetworkInterfaceIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkInterfaceName, ipConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceIpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private NetworkInterfaceIpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersClientImpl.java new file mode 100644 index 0000000000000..501a4e1880f83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersClientImpl.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkInterfaceLoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceLoadBalancerListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkInterfaceLoadBalancersClient. */ +public final class NetworkInterfaceLoadBalancersClientImpl implements NetworkInterfaceLoadBalancersClient { + private final ClientLogger logger = new ClientLogger(NetworkInterfaceLoadBalancersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkInterfaceLoadBalancersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceLoadBalancersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfaceLoadBalancersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkInterfaceLoadBalancersService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkInterfaceLoadBalancers to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkInterfaceLoadBalancersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/loadBalancers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkInterfaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkInterfaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkInterfaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName)); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName, 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 response for list ip configurations API service call. + */ + @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 response for list ip configurations API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersImpl.java new file mode 100644 index 0000000000000..99a52c74310b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersImpl.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.network.generated.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.network.generated.fluent.NetworkInterfaceLoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancer; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceLoadBalancers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkInterfaceLoadBalancersImpl implements NetworkInterfaceLoadBalancers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceLoadBalancersImpl.class); + + private final NetworkInterfaceLoadBalancersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkInterfaceLoadBalancersImpl( + NetworkInterfaceLoadBalancersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkInterfaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkInterfaceName); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkInterfaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName, context); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + private NetworkInterfaceLoadBalancersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationImpl.java new file mode 100644 index 0000000000000..9d8b2ffe2825c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; + +public final class NetworkInterfaceTapConfigurationImpl + implements NetworkInterfaceTapConfiguration, + NetworkInterfaceTapConfiguration.Definition, + NetworkInterfaceTapConfiguration.Update { + private NetworkInterfaceTapConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public VirtualNetworkTap virtualNetworkTap() { + VirtualNetworkTapInner inner = this.innerModel().virtualNetworkTap(); + if (inner != null) { + return new VirtualNetworkTapImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkInterfaceTapConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkInterfaceName; + + private String tapConfigurationName; + + public NetworkInterfaceTapConfigurationImpl withExistingNetworkInterface( + String resourceGroupName, String networkInterfaceName) { + this.resourceGroupName = resourceGroupName; + this.networkInterfaceName = networkInterfaceName; + return this; + } + + public NetworkInterfaceTapConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .createOrUpdate( + resourceGroupName, networkInterfaceName, tapConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkInterfaceTapConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .createOrUpdate( + resourceGroupName, networkInterfaceName, tapConfigurationName, this.innerModel(), context); + return this; + } + + NetworkInterfaceTapConfigurationImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkInterfaceTapConfigurationInner(); + this.serviceManager = serviceManager; + this.tapConfigurationName = name; + } + + public NetworkInterfaceTapConfigurationImpl update() { + return this; + } + + public NetworkInterfaceTapConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .createOrUpdate( + resourceGroupName, networkInterfaceName, tapConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkInterfaceTapConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .createOrUpdate( + resourceGroupName, networkInterfaceName, tapConfigurationName, this.innerModel(), context); + return this; + } + + NetworkInterfaceTapConfigurationImpl( + NetworkInterfaceTapConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = Utils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + this.tapConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "tapConfigurations"); + } + + public NetworkInterfaceTapConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterfaceTapConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, context) + .getValue(); + return this; + } + + public NetworkInterfaceTapConfigurationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public NetworkInterfaceTapConfigurationImpl withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap) { + this.innerModel().withVirtualNetworkTap(virtualNetworkTap); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsClientImpl.java new file mode 100644 index 0000000000000..834818e3d45e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsClientImpl.java @@ -0,0 +1,1189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkInterfaceTapConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfigurationListResult; +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 NetworkInterfaceTapConfigurationsClient. + */ +public final class NetworkInterfaceTapConfigurationsClientImpl implements NetworkInterfaceTapConfigurationsClient { + private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkInterfaceTapConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceTapConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfaceTapConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkInterfaceTapConfigurationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkInterfaceTapConfigurations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkInterfaceTapConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("tapConfigurationName") String tapConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("tapConfigurationName") String tapConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("tapConfigurationName") String tapConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/tapConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (tapConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter tapConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + tapConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (tapConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter tapConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + tapConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).getSyncPoller(); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context).getSyncPoller(); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + deleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).block(); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + deleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context).block(); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (tapConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter tapConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + tapConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (tapConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter tapConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + tapConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return getWithResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceTapConfigurationInner get( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return getAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).block(); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context).block(); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (tapConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tapConfigurationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter tapConfigurationParameters is required and cannot be null.")); + } else { + tapConfigurationParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + tapConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + tapConfigurationParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (tapConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tapConfigurationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter tapConfigurationParameters is required and cannot be null.")); + } else { + tapConfigurationParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + tapConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + tapConfigurationParameters, + accept, + context); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkInterfaceTapConfigurationInner.class, + NetworkInterfaceTapConfigurationInner.class, + Context.NONE); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkInterfaceTapConfigurationInner.class, + NetworkInterfaceTapConfigurationInner.class, + context); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceTapConfigurationInner createOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return createOrUpdateAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters) + .block(); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceTapConfigurationInner createOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, context) + .block(); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkInterfaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName)); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName, 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 response for list tap configurations API service call. + */ + @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 response for list tap configurations API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsImpl.java new file mode 100644 index 0000000000000..18327ead1d1a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkInterfaceTapConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkInterfaceTapConfigurationsImpl implements NetworkInterfaceTapConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationsImpl.class); + + private final NetworkInterfaceTapConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkInterfaceTapConfigurationsImpl( + NetworkInterfaceTapConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName, tapConfigurationName); + } + + public void delete( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + } + + public NetworkInterfaceTapConfiguration get( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + NetworkInterfaceTapConfigurationInner inner = + this.serviceClient().get(resourceGroupName, networkInterfaceName, tapConfigurationName); + if (inner != null) { + return new NetworkInterfaceTapConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceTapConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkInterfaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceTapConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceTapConfigurationImpl(inner1, this.manager())); + } + + public NetworkInterfaceTapConfiguration 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, tapConfigurationName, 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + } + + private NetworkInterfaceTapConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkInterfaceTapConfigurationImpl define(String name) { + return new NetworkInterfaceTapConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java new file mode 100644 index 0000000000000..e6380f9b41818 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java @@ -0,0 +1,4507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationListResult; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 NetworkInterfacesClient. */ +public final class NetworkInterfacesClientImpl implements NetworkInterfacesClient { + private final ClientLogger logger = new ClientLogger(NetworkInterfacesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkInterfacesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfacesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(NetworkInterfacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkInterfaces to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkInterfacesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceRoleInstanceNetworkInterfaces( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("roleInstanceName") String roleInstanceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceNetworkInterfaces( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" + + "/{networkInterfaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCloudServiceNetworkInterface( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkInterfaceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getEffectiveRouteTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listEffectiveNetworkSecurityGroups( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetVMNetworkInterfaces( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetNetworkInterfaces( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualMachineScaleSetNetworkInterface( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}/ipConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetIpConfigurations( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualMachineScaleSetIpConfiguration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceRoleInstanceNetworkInterfacesNext( + @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> listCloudServiceNetworkInterfacesNext( + @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> listAllNext( + @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> 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> listVirtualMachineScaleSetVMNetworkInterfacesNext( + @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> listVirtualMachineScaleSetNetworkInterfacesNext( + @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> listVirtualMachineScaleSetIpConfigurationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceRoleInstanceNetworkInterfacesSinglePageAsync( + String resourceGroupName, String cloudServiceName, String roleInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listCloudServiceRoleInstanceNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceRoleInstanceNetworkInterfacesSinglePageAsync( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCloudServiceRoleInstanceNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceRoleInstanceNetworkInterfacesAsync( + String resourceGroupName, String cloudServiceName, String roleInstanceName) { + return new PagedFlux<>( + () -> + listCloudServiceRoleInstanceNetworkInterfacesSinglePageAsync( + resourceGroupName, cloudServiceName, roleInstanceName), + nextLink -> listCloudServiceRoleInstanceNetworkInterfacesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceRoleInstanceNetworkInterfacesAsync( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context) { + return new PagedFlux<>( + () -> + listCloudServiceRoleInstanceNetworkInterfacesSinglePageAsync( + resourceGroupName, cloudServiceName, roleInstanceName, context), + nextLink -> listCloudServiceRoleInstanceNetworkInterfacesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName) { + return new PagedIterable<>( + listCloudServiceRoleInstanceNetworkInterfacesAsync(resourceGroupName, cloudServiceName, roleInstanceName)); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context) { + return new PagedIterable<>( + listCloudServiceRoleInstanceNetworkInterfacesAsync( + resourceGroupName, cloudServiceName, roleInstanceName, context)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceNetworkInterfacesSinglePageAsync( + String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listCloudServiceNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceNetworkInterfacesSinglePageAsync( + String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCloudServiceNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceNetworkInterfacesAsync( + String resourceGroupName, String cloudServiceName) { + return new PagedFlux<>( + () -> listCloudServiceNetworkInterfacesSinglePageAsync(resourceGroupName, cloudServiceName), + nextLink -> listCloudServiceNetworkInterfacesNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceNetworkInterfacesAsync( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedFlux<>( + () -> listCloudServiceNetworkInterfacesSinglePageAsync(resourceGroupName, cloudServiceName, context), + nextLink -> listCloudServiceNetworkInterfacesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName) { + return new PagedIterable<>(listCloudServiceNetworkInterfacesAsync(resourceGroupName, cloudServiceName)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedIterable<>( + listCloudServiceNetworkInterfacesAsync(resourceGroupName, cloudServiceName, context)); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCloudServiceNetworkInterfaceWithResponseAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getCloudServiceNetworkInterface( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCloudServiceNetworkInterfaceWithResponseAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getCloudServiceNetworkInterface( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCloudServiceNetworkInterfaceAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand) { + return getCloudServiceNetworkInterfaceWithResponseAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCloudServiceNetworkInterfaceAsync( + String resourceGroupName, String cloudServiceName, String roleInstanceName, String networkInterfaceName) { + final String expand = null; + return getCloudServiceNetworkInterfaceWithResponseAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner getCloudServiceNetworkInterface( + String resourceGroupName, String cloudServiceName, String roleInstanceName, String networkInterfaceName) { + final String expand = null; + return getCloudServiceNetworkInterfaceAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand) + .block(); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCloudServiceNetworkInterfaceWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand, + Context context) { + return getCloudServiceNetworkInterfaceWithResponseAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand, context) + .block(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkInterfaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkInterfaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkInterfaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkInterfaceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkInterfaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkInterfaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkInterfaceName) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkInterfaceName, Context context) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, context).getSyncPoller(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkInterfaceName) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkInterfaceName, Context context) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkInterfaceName) { + deleteAsync(resourceGroupName, networkInterfaceName).block(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkInterfaceName, Context context) { + deleteAsync(resourceGroupName, networkInterfaceName, context).block(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkInterfaceName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkInterfaceName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, networkInterfaceName, expand).block(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, expand, context).block(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkInterfaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkInterfaceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkInterfaceInner.class, + NetworkInterfaceInner.class, + Context.NONE); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkInterfaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkInterfaceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkInterfaceInner.class, NetworkInterfaceInner.class, context); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner createOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).block(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner createOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters, context).block(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkInterfaceName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String networkInterfaceName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkInterfaceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner updateTags( + String resourceGroupName, String networkInterfaceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkInterfaceName, parameters).block(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, networkInterfaceName, parameters, context).block(); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network interfaces 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 all network interfaces in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network interfaces 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 all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all network interfaces 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 all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getEffectiveRouteTableWithResponseAsync( + String resourceGroupName, String networkInterfaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEffectiveRouteTable( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getEffectiveRouteTableWithResponseAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEffectiveRouteTable( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EffectiveRouteListResultInner> + beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + Mono>> mono = + getEffectiveRouteTableWithResponseAsync(resourceGroupName, networkInterfaceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EffectiveRouteListResultInner.class, + EffectiveRouteListResultInner.class, + Context.NONE); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EffectiveRouteListResultInner> + beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getEffectiveRouteTableWithResponseAsync(resourceGroupName, networkInterfaceName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EffectiveRouteListResultInner.class, + EffectiveRouteListResultInner.class, + context); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EffectiveRouteListResultInner> + beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EffectiveRouteListResultInner> + beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName, Context context) { + return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName, context).getSyncPoller(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEffectiveRouteTableAsync( + String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEffectiveRouteTableAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).block(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EffectiveRouteListResultInner getEffectiveRouteTable( + String resourceGroupName, String networkInterfaceName, Context context) { + return getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName, context).block(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listEffectiveNetworkSecurityGroupsWithResponseAsync( + String resourceGroupName, String networkInterfaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listEffectiveNetworkSecurityGroups( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listEffectiveNetworkSecurityGroupsWithResponseAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listEffectiveNetworkSecurityGroups( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + Mono>> mono = + listEffectiveNetworkSecurityGroupsWithResponseAsync(resourceGroupName, networkInterfaceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EffectiveNetworkSecurityGroupListResultInner.class, + EffectiveNetworkSecurityGroupListResultInner.class, + Context.NONE); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroupsAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listEffectiveNetworkSecurityGroupsWithResponseAsync(resourceGroupName, networkInterfaceName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EffectiveNetworkSecurityGroupListResultInner.class, + EffectiveNetworkSecurityGroupListResultInner.class, + context); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName, Context context) { + return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName, context) + .getSyncPoller(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listEffectiveNetworkSecurityGroupsAsync( + String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listEffectiveNetworkSecurityGroupsAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).block(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName, Context context) { + return listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName, context).block(); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVirtualMachineScaleSetVMNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVirtualMachineScaleSetVMNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetVMNetworkInterfacesAsync( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), + nextLink -> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetVMNetworkInterfacesAsync( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, context), + nextLink -> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { + return new PagedIterable<>( + listVirtualMachineScaleSetVMNetworkInterfacesAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex)); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetVMNetworkInterfacesAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, context)); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( + String resourceGroupName, String virtualMachineScaleSetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVirtualMachineScaleSetNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVirtualMachineScaleSetNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetNetworkInterfacesAsync( + String resourceGroupName, String virtualMachineScaleSetName) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName), + nextLink -> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetNetworkInterfacesAsync( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, context), + nextLink -> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName) { + return new PagedIterable<>( + listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName)); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, context)); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVirtualMachineScaleSetNetworkInterface( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVirtualMachineScaleSetNetworkInterface( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineScaleSetNetworkInterfaceAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineScaleSetNetworkInterfaceAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + final String expand = null; + return getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + final String expand = null; + return getVirtualMachineScaleSetNetworkInterfaceAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .block(); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVirtualMachineScaleSetNetworkInterfaceWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + return getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context) + .block(); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVirtualMachineScaleSetIpConfigurations( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVirtualMachineScaleSetIpConfigurations( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), + nextLink -> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextLink)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + final String expand = null; + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), + nextLink -> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextLink)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context), + nextLink -> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + final String expand = null; + return new PagedIterable<>( + listVirtualMachineScaleSetIpConfigurationsAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetIpConfigurationsAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getVirtualMachineScaleSetIpConfigurationWithResponseAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVirtualMachineScaleSetIpConfiguration( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getVirtualMachineScaleSetIpConfigurationWithResponseAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVirtualMachineScaleSetIpConfiguration( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineScaleSetIpConfigurationAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand) { + return getVirtualMachineScaleSetIpConfigurationWithResponseAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineScaleSetIpConfigurationAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + final String expand = null; + return getVirtualMachineScaleSetIpConfigurationWithResponseAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceIpConfigurationInner getVirtualMachineScaleSetIpConfiguration( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + final String expand = null; + return getVirtualMachineScaleSetIpConfigurationAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + expand) + .block(); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVirtualMachineScaleSetIpConfigurationWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand, + Context context) { + return getVirtualMachineScaleSetIpConfigurationWithResponseAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + expand, + 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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceRoleInstanceNetworkInterfacesNextSinglePageAsync( + 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 + .listCloudServiceRoleInstanceNetworkInterfacesNext( + 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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceRoleInstanceNetworkInterfacesNextSinglePageAsync( + 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 + .listCloudServiceRoleInstanceNetworkInterfacesNext(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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceNetworkInterfacesNextSinglePageAsync( + 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.listCloudServiceNetworkInterfacesNext(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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceNetworkInterfacesNextSinglePageAsync( + 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 + .listCloudServiceNetworkInterfacesNext(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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for the ListNetworkInterface API service call. + */ + @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 response for the ListNetworkInterface API service call. + */ + @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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync( + 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 + .listVirtualMachineScaleSetVMNetworkInterfacesNext( + 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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync( + 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 + .listVirtualMachineScaleSetVMNetworkInterfacesNext(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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync( + 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 + .listVirtualMachineScaleSetNetworkInterfacesNext( + 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 response for the ListNetworkInterface API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync( + 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 + .listVirtualMachineScaleSetNetworkInterfacesNext(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 response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(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 + .listVirtualMachineScaleSetIpConfigurationsNext( + 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 response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(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 + .listVirtualMachineScaleSetIpConfigurationsNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesImpl.java new file mode 100644 index 0000000000000..60fd2c4c6ea5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesImpl.java @@ -0,0 +1,472 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroupListResult; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteListResult; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaces; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkInterfacesImpl implements NetworkInterfaces { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfacesImpl.class); + + private final NetworkInterfacesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkInterfacesImpl( + NetworkInterfacesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstanceNetworkInterfaces(resourceGroupName, cloudServiceName, roleInstanceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstanceNetworkInterfaces( + resourceGroupName, cloudServiceName, roleInstanceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName) { + PagedIterable inner = + this.serviceClient().listCloudServiceNetworkInterfaces(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listCloudServiceNetworkInterfaces(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public NetworkInterface getCloudServiceNetworkInterface( + String resourceGroupName, String cloudServiceName, String roleInstanceName, String networkInterfaceName) { + NetworkInterfaceInner inner = + this + .serviceClient() + .getCloudServiceNetworkInterface( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName); + if (inner != null) { + return new NetworkInterfaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCloudServiceNetworkInterfaceWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getCloudServiceNetworkInterfaceWithResponse( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkInterfaceName) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName); + } + + public void delete(String resourceGroupName, String networkInterfaceName, Context context) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName, context); + } + + public NetworkInterface getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + NetworkInterfaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkInterfaceName); + if (inner != null) { + return new NetworkInterfaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public EffectiveRouteListResult getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + EffectiveRouteListResultInner inner = + this.serviceClient().getEffectiveRouteTable(resourceGroupName, networkInterfaceName); + if (inner != null) { + return new EffectiveRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveRouteListResult getEffectiveRouteTable( + String resourceGroupName, String networkInterfaceName, Context context) { + EffectiveRouteListResultInner inner = + this.serviceClient().getEffectiveRouteTable(resourceGroupName, networkInterfaceName, context); + if (inner != null) { + return new EffectiveRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName) { + EffectiveNetworkSecurityGroupListResultInner inner = + this.serviceClient().listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName); + if (inner != null) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName, Context context) { + EffectiveNetworkSecurityGroupListResultInner inner = + this.serviceClient().listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, context); + if (inner != null) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMNetworkInterfaces( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMNetworkInterfaces( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public NetworkInterface getVirtualMachineScaleSetNetworkInterface( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + NetworkInterfaceInner inner = + this + .serviceClient() + .getVirtualMachineScaleSetNetworkInterface( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName); + if (inner != null) { + return new NetworkInterfaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVirtualMachineScaleSetNetworkInterfaceWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getVirtualMachineScaleSetNetworkInterfaceWithResponse( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetIpConfigurations( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetIpConfigurations( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public NetworkInterfaceIpConfiguration getVirtualMachineScaleSetIpConfiguration( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + NetworkInterfaceIpConfigurationInner inner = + this + .serviceClient() + .getVirtualMachineScaleSetIpConfiguration( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName); + if (inner != null) { + return new NetworkInterfaceIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVirtualMachineScaleSetIpConfigurationWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getVirtualMachineScaleSetIpConfigurationWithResponse( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + expand, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceIpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkInterface 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, expand, 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, 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 networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, context); + } + + private NetworkInterfacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkInterfaceImpl define(String name) { + return new NetworkInterfaceImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.java new file mode 100644 index 0000000000000..9acc93ddc894e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 NetworkManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {NetworkManagementClientImpl.class}) +public final class NetworkManagementClientBuilder { + /* + * The subscription credentials which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder 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 NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder 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 NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder 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 NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder 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 NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of NetworkManagementClientImpl with the provided parameters. + * + * @return an instance of NetworkManagementClientImpl. + */ + public NetworkManagementClientImpl 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(); + } + NetworkManagementClientImpl client = + new NetworkManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientImpl.java new file mode 100644 index 0000000000000..0b8a33c52d4f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientImpl.java @@ -0,0 +1,1773 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ApplicationGatewayPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayPrivateLinkResourcesClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.AvailableDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.AvailableEndpointServicesClient; +import com.azure.resourcemanager.network.generated.fluent.AvailablePrivateEndpointTypesClient; +import com.azure.resourcemanager.network.generated.fluent.AvailableResourceGroupDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.AvailableServiceAliasesClient; +import com.azure.resourcemanager.network.generated.fluent.AzureFirewallFqdnTagsClient; +import com.azure.resourcemanager.network.generated.fluent.AzureFirewallsClient; +import com.azure.resourcemanager.network.generated.fluent.BastionHostsClient; +import com.azure.resourcemanager.network.generated.fluent.BgpServiceCommunitiesClient; +import com.azure.resourcemanager.network.generated.fluent.ConnectionMonitorsClient; +import com.azure.resourcemanager.network.generated.fluent.CustomIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.DdosCustomPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.DdosProtectionPlansClient; +import com.azure.resourcemanager.network.generated.fluent.DefaultSecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.DscpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCrossConnectionPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCrossConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteServiceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyRuleCollectionGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.FlowLogsClient; +import com.azure.resourcemanager.network.generated.fluent.HubRouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.HubVirtualNetworkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.InboundNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.InboundSecurityRuleOperationsClient; +import com.azure.resourcemanager.network.generated.fluent.IpAllocationsClient; +import com.azure.resourcemanager.network.generated.fluent.IpGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerBackendAddressPoolsClient; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerFrontendIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerLoadBalancingRulesClient; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerNetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerOutboundRulesClient; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerProbesClient; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.LocalNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.NatGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.NatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceLoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceTapConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagementClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkWatchersClient; +import com.azure.resourcemanager.network.generated.fluent.OperationsClient; +import com.azure.resourcemanager.network.generated.fluent.P2SVpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.PacketCapturesClient; +import com.azure.resourcemanager.network.generated.fluent.PeerExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.PrivateDnsZoneGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.network.generated.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.network.generated.fluent.PublicIpAddressesClient; +import com.azure.resourcemanager.network.generated.fluent.PublicIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.ResourceNavigationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.RouteFilterRulesClient; +import com.azure.resourcemanager.network.generated.fluent.RouteFiltersClient; +import com.azure.resourcemanager.network.generated.fluent.RouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.RoutesClient; +import com.azure.resourcemanager.network.generated.fluent.SecurityPartnerProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.SecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.ServiceAssociationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.ServiceEndpointPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.ServiceEndpointPolicyDefinitionsClient; +import com.azure.resourcemanager.network.generated.fluent.ServiceTagsClient; +import com.azure.resourcemanager.network.generated.fluent.SubnetsClient; +import com.azure.resourcemanager.network.generated.fluent.UsagesClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualApplianceSitesClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualApplianceSkusClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubRouteTableV2SClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewayConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewayNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkTapsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworksClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualRouterPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualRoutersClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.VpnConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VpnServerConfigurationsAssociatedWithVirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.VpnServerConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.VpnSiteLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VpnSiteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.VpnSitesClient; +import com.azure.resourcemanager.network.generated.fluent.VpnSitesConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.WebApplicationFirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.WebCategoriesClient; +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 NetworkManagementClientImpl type. */ +@ServiceClient(builder = NetworkManagementClientBuilder.class) +public final class NetworkManagementClientImpl implements NetworkManagementClient { + private final ClientLogger logger = new ClientLogger(NetworkManagementClientImpl.class); + + /** + * The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @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; + } + + /** 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 ApplicationGatewaysClient object to access its operations. */ + private final ApplicationGatewaysClient applicationGateways; + + /** + * Gets the ApplicationGatewaysClient object to access its operations. + * + * @return the ApplicationGatewaysClient object. + */ + public ApplicationGatewaysClient getApplicationGateways() { + return this.applicationGateways; + } + + /** The ApplicationGatewayPrivateLinkResourcesClient object to access its operations. */ + private final ApplicationGatewayPrivateLinkResourcesClient applicationGatewayPrivateLinkResources; + + /** + * Gets the ApplicationGatewayPrivateLinkResourcesClient object to access its operations. + * + * @return the ApplicationGatewayPrivateLinkResourcesClient object. + */ + public ApplicationGatewayPrivateLinkResourcesClient getApplicationGatewayPrivateLinkResources() { + return this.applicationGatewayPrivateLinkResources; + } + + /** The ApplicationGatewayPrivateEndpointConnectionsClient object to access its operations. */ + private final ApplicationGatewayPrivateEndpointConnectionsClient applicationGatewayPrivateEndpointConnections; + + /** + * Gets the ApplicationGatewayPrivateEndpointConnectionsClient object to access its operations. + * + * @return the ApplicationGatewayPrivateEndpointConnectionsClient object. + */ + public ApplicationGatewayPrivateEndpointConnectionsClient getApplicationGatewayPrivateEndpointConnections() { + return this.applicationGatewayPrivateEndpointConnections; + } + + /** The ApplicationSecurityGroupsClient object to access its operations. */ + private final ApplicationSecurityGroupsClient applicationSecurityGroups; + + /** + * Gets the ApplicationSecurityGroupsClient object to access its operations. + * + * @return the ApplicationSecurityGroupsClient object. + */ + public ApplicationSecurityGroupsClient getApplicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** The AvailableDelegationsClient object to access its operations. */ + private final AvailableDelegationsClient availableDelegations; + + /** + * Gets the AvailableDelegationsClient object to access its operations. + * + * @return the AvailableDelegationsClient object. + */ + public AvailableDelegationsClient getAvailableDelegations() { + return this.availableDelegations; + } + + /** The AvailableResourceGroupDelegationsClient object to access its operations. */ + private final AvailableResourceGroupDelegationsClient availableResourceGroupDelegations; + + /** + * Gets the AvailableResourceGroupDelegationsClient object to access its operations. + * + * @return the AvailableResourceGroupDelegationsClient object. + */ + public AvailableResourceGroupDelegationsClient getAvailableResourceGroupDelegations() { + return this.availableResourceGroupDelegations; + } + + /** The AvailableServiceAliasesClient object to access its operations. */ + private final AvailableServiceAliasesClient availableServiceAliases; + + /** + * Gets the AvailableServiceAliasesClient object to access its operations. + * + * @return the AvailableServiceAliasesClient object. + */ + public AvailableServiceAliasesClient getAvailableServiceAliases() { + return this.availableServiceAliases; + } + + /** The AzureFirewallsClient object to access its operations. */ + private final AzureFirewallsClient azureFirewalls; + + /** + * Gets the AzureFirewallsClient object to access its operations. + * + * @return the AzureFirewallsClient object. + */ + public AzureFirewallsClient getAzureFirewalls() { + return this.azureFirewalls; + } + + /** The AzureFirewallFqdnTagsClient object to access its operations. */ + private final AzureFirewallFqdnTagsClient azureFirewallFqdnTags; + + /** + * Gets the AzureFirewallFqdnTagsClient object to access its operations. + * + * @return the AzureFirewallFqdnTagsClient object. + */ + public AzureFirewallFqdnTagsClient getAzureFirewallFqdnTags() { + return this.azureFirewallFqdnTags; + } + + /** The WebCategoriesClient object to access its operations. */ + private final WebCategoriesClient webCategories; + + /** + * Gets the WebCategoriesClient object to access its operations. + * + * @return the WebCategoriesClient object. + */ + public WebCategoriesClient getWebCategories() { + return this.webCategories; + } + + /** The BastionHostsClient object to access its operations. */ + private final BastionHostsClient bastionHosts; + + /** + * Gets the BastionHostsClient object to access its operations. + * + * @return the BastionHostsClient object. + */ + public BastionHostsClient getBastionHosts() { + return this.bastionHosts; + } + + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The NetworkInterfacesClient object to access its operations. */ + private final NetworkInterfacesClient networkInterfaces; + + /** + * Gets the NetworkInterfacesClient object to access its operations. + * + * @return the NetworkInterfacesClient object. + */ + public NetworkInterfacesClient getNetworkInterfaces() { + return this.networkInterfaces; + } + + /** The PublicIpAddressesClient object to access its operations. */ + private final PublicIpAddressesClient publicIpAddresses; + + /** + * Gets the PublicIpAddressesClient object to access its operations. + * + * @return the PublicIpAddressesClient object. + */ + public PublicIpAddressesClient getPublicIpAddresses() { + return this.publicIpAddresses; + } + + /** The CustomIpPrefixesClient object to access its operations. */ + private final CustomIpPrefixesClient customIpPrefixes; + + /** + * Gets the CustomIpPrefixesClient object to access its operations. + * + * @return the CustomIpPrefixesClient object. + */ + public CustomIpPrefixesClient getCustomIpPrefixes() { + return this.customIpPrefixes; + } + + /** The DdosCustomPoliciesClient object to access its operations. */ + private final DdosCustomPoliciesClient ddosCustomPolicies; + + /** + * Gets the DdosCustomPoliciesClient object to access its operations. + * + * @return the DdosCustomPoliciesClient object. + */ + public DdosCustomPoliciesClient getDdosCustomPolicies() { + return this.ddosCustomPolicies; + } + + /** The DdosProtectionPlansClient object to access its operations. */ + private final DdosProtectionPlansClient ddosProtectionPlans; + + /** + * Gets the DdosProtectionPlansClient object to access its operations. + * + * @return the DdosProtectionPlansClient object. + */ + public DdosProtectionPlansClient getDdosProtectionPlans() { + return this.ddosProtectionPlans; + } + + /** The DscpConfigurationsClient object to access its operations. */ + private final DscpConfigurationsClient dscpConfigurations; + + /** + * Gets the DscpConfigurationsClient object to access its operations. + * + * @return the DscpConfigurationsClient object. + */ + public DscpConfigurationsClient getDscpConfigurations() { + return this.dscpConfigurations; + } + + /** The AvailableEndpointServicesClient object to access its operations. */ + private final AvailableEndpointServicesClient availableEndpointServices; + + /** + * Gets the AvailableEndpointServicesClient object to access its operations. + * + * @return the AvailableEndpointServicesClient object. + */ + public AvailableEndpointServicesClient getAvailableEndpointServices() { + return this.availableEndpointServices; + } + + /** The ExpressRouteCircuitAuthorizationsClient object to access its operations. */ + private final ExpressRouteCircuitAuthorizationsClient expressRouteCircuitAuthorizations; + + /** + * Gets the ExpressRouteCircuitAuthorizationsClient object to access its operations. + * + * @return the ExpressRouteCircuitAuthorizationsClient object. + */ + public ExpressRouteCircuitAuthorizationsClient getExpressRouteCircuitAuthorizations() { + return this.expressRouteCircuitAuthorizations; + } + + /** The ExpressRouteCircuitPeeringsClient object to access its operations. */ + private final ExpressRouteCircuitPeeringsClient expressRouteCircuitPeerings; + + /** + * Gets the ExpressRouteCircuitPeeringsClient object to access its operations. + * + * @return the ExpressRouteCircuitPeeringsClient object. + */ + public ExpressRouteCircuitPeeringsClient getExpressRouteCircuitPeerings() { + return this.expressRouteCircuitPeerings; + } + + /** The ExpressRouteCircuitConnectionsClient object to access its operations. */ + private final ExpressRouteCircuitConnectionsClient expressRouteCircuitConnections; + + /** + * Gets the ExpressRouteCircuitConnectionsClient object to access its operations. + * + * @return the ExpressRouteCircuitConnectionsClient object. + */ + public ExpressRouteCircuitConnectionsClient getExpressRouteCircuitConnections() { + return this.expressRouteCircuitConnections; + } + + /** The PeerExpressRouteCircuitConnectionsClient object to access its operations. */ + private final PeerExpressRouteCircuitConnectionsClient peerExpressRouteCircuitConnections; + + /** + * Gets the PeerExpressRouteCircuitConnectionsClient object to access its operations. + * + * @return the PeerExpressRouteCircuitConnectionsClient object. + */ + public PeerExpressRouteCircuitConnectionsClient getPeerExpressRouteCircuitConnections() { + return this.peerExpressRouteCircuitConnections; + } + + /** The ExpressRouteCircuitsClient object to access its operations. */ + private final ExpressRouteCircuitsClient expressRouteCircuits; + + /** + * Gets the ExpressRouteCircuitsClient object to access its operations. + * + * @return the ExpressRouteCircuitsClient object. + */ + public ExpressRouteCircuitsClient getExpressRouteCircuits() { + return this.expressRouteCircuits; + } + + /** The ExpressRouteServiceProvidersClient object to access its operations. */ + private final ExpressRouteServiceProvidersClient expressRouteServiceProviders; + + /** + * Gets the ExpressRouteServiceProvidersClient object to access its operations. + * + * @return the ExpressRouteServiceProvidersClient object. + */ + public ExpressRouteServiceProvidersClient getExpressRouteServiceProviders() { + return this.expressRouteServiceProviders; + } + + /** The ExpressRouteCrossConnectionsClient object to access its operations. */ + private final ExpressRouteCrossConnectionsClient expressRouteCrossConnections; + + /** + * Gets the ExpressRouteCrossConnectionsClient object to access its operations. + * + * @return the ExpressRouteCrossConnectionsClient object. + */ + public ExpressRouteCrossConnectionsClient getExpressRouteCrossConnections() { + return this.expressRouteCrossConnections; + } + + /** The ExpressRouteCrossConnectionPeeringsClient object to access its operations. */ + private final ExpressRouteCrossConnectionPeeringsClient expressRouteCrossConnectionPeerings; + + /** + * Gets the ExpressRouteCrossConnectionPeeringsClient object to access its operations. + * + * @return the ExpressRouteCrossConnectionPeeringsClient object. + */ + public ExpressRouteCrossConnectionPeeringsClient getExpressRouteCrossConnectionPeerings() { + return this.expressRouteCrossConnectionPeerings; + } + + /** The ExpressRoutePortsLocationsClient object to access its operations. */ + private final ExpressRoutePortsLocationsClient expressRoutePortsLocations; + + /** + * Gets the ExpressRoutePortsLocationsClient object to access its operations. + * + * @return the ExpressRoutePortsLocationsClient object. + */ + public ExpressRoutePortsLocationsClient getExpressRoutePortsLocations() { + return this.expressRoutePortsLocations; + } + + /** The ExpressRoutePortsClient object to access its operations. */ + private final ExpressRoutePortsClient expressRoutePorts; + + /** + * Gets the ExpressRoutePortsClient object to access its operations. + * + * @return the ExpressRoutePortsClient object. + */ + public ExpressRoutePortsClient getExpressRoutePorts() { + return this.expressRoutePorts; + } + + /** The ExpressRouteLinksClient object to access its operations. */ + private final ExpressRouteLinksClient expressRouteLinks; + + /** + * Gets the ExpressRouteLinksClient object to access its operations. + * + * @return the ExpressRouteLinksClient object. + */ + public ExpressRouteLinksClient getExpressRouteLinks() { + return this.expressRouteLinks; + } + + /** The FirewallPoliciesClient object to access its operations. */ + private final FirewallPoliciesClient firewallPolicies; + + /** + * Gets the FirewallPoliciesClient object to access its operations. + * + * @return the FirewallPoliciesClient object. + */ + public FirewallPoliciesClient getFirewallPolicies() { + return this.firewallPolicies; + } + + /** The FirewallPolicyRuleCollectionGroupsClient object to access its operations. */ + private final FirewallPolicyRuleCollectionGroupsClient firewallPolicyRuleCollectionGroups; + + /** + * Gets the FirewallPolicyRuleCollectionGroupsClient object to access its operations. + * + * @return the FirewallPolicyRuleCollectionGroupsClient object. + */ + public FirewallPolicyRuleCollectionGroupsClient getFirewallPolicyRuleCollectionGroups() { + return this.firewallPolicyRuleCollectionGroups; + } + + /** The IpAllocationsClient object to access its operations. */ + private final IpAllocationsClient ipAllocations; + + /** + * Gets the IpAllocationsClient object to access its operations. + * + * @return the IpAllocationsClient object. + */ + public IpAllocationsClient getIpAllocations() { + return this.ipAllocations; + } + + /** The IpGroupsClient object to access its operations. */ + private final IpGroupsClient ipGroups; + + /** + * Gets the IpGroupsClient object to access its operations. + * + * @return the IpGroupsClient object. + */ + public IpGroupsClient getIpGroups() { + return this.ipGroups; + } + + /** The LoadBalancersClient object to access its operations. */ + private final LoadBalancersClient loadBalancers; + + /** + * Gets the LoadBalancersClient object to access its operations. + * + * @return the LoadBalancersClient object. + */ + public LoadBalancersClient getLoadBalancers() { + return this.loadBalancers; + } + + /** The LoadBalancerBackendAddressPoolsClient object to access its operations. */ + private final LoadBalancerBackendAddressPoolsClient loadBalancerBackendAddressPools; + + /** + * Gets the LoadBalancerBackendAddressPoolsClient object to access its operations. + * + * @return the LoadBalancerBackendAddressPoolsClient object. + */ + public LoadBalancerBackendAddressPoolsClient getLoadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** The LoadBalancerFrontendIpConfigurationsClient object to access its operations. */ + private final LoadBalancerFrontendIpConfigurationsClient loadBalancerFrontendIpConfigurations; + + /** + * Gets the LoadBalancerFrontendIpConfigurationsClient object to access its operations. + * + * @return the LoadBalancerFrontendIpConfigurationsClient object. + */ + public LoadBalancerFrontendIpConfigurationsClient getLoadBalancerFrontendIpConfigurations() { + return this.loadBalancerFrontendIpConfigurations; + } + + /** The InboundNatRulesClient object to access its operations. */ + private final InboundNatRulesClient inboundNatRules; + + /** + * Gets the InboundNatRulesClient object to access its operations. + * + * @return the InboundNatRulesClient object. + */ + public InboundNatRulesClient getInboundNatRules() { + return this.inboundNatRules; + } + + /** The LoadBalancerLoadBalancingRulesClient object to access its operations. */ + private final LoadBalancerLoadBalancingRulesClient loadBalancerLoadBalancingRules; + + /** + * Gets the LoadBalancerLoadBalancingRulesClient object to access its operations. + * + * @return the LoadBalancerLoadBalancingRulesClient object. + */ + public LoadBalancerLoadBalancingRulesClient getLoadBalancerLoadBalancingRules() { + return this.loadBalancerLoadBalancingRules; + } + + /** The LoadBalancerOutboundRulesClient object to access its operations. */ + private final LoadBalancerOutboundRulesClient loadBalancerOutboundRules; + + /** + * Gets the LoadBalancerOutboundRulesClient object to access its operations. + * + * @return the LoadBalancerOutboundRulesClient object. + */ + public LoadBalancerOutboundRulesClient getLoadBalancerOutboundRules() { + return this.loadBalancerOutboundRules; + } + + /** The LoadBalancerNetworkInterfacesClient object to access its operations. */ + private final LoadBalancerNetworkInterfacesClient loadBalancerNetworkInterfaces; + + /** + * Gets the LoadBalancerNetworkInterfacesClient object to access its operations. + * + * @return the LoadBalancerNetworkInterfacesClient object. + */ + public LoadBalancerNetworkInterfacesClient getLoadBalancerNetworkInterfaces() { + return this.loadBalancerNetworkInterfaces; + } + + /** The LoadBalancerProbesClient object to access its operations. */ + private final LoadBalancerProbesClient loadBalancerProbes; + + /** + * Gets the LoadBalancerProbesClient object to access its operations. + * + * @return the LoadBalancerProbesClient object. + */ + public LoadBalancerProbesClient getLoadBalancerProbes() { + return this.loadBalancerProbes; + } + + /** The NatGatewaysClient object to access its operations. */ + private final NatGatewaysClient natGateways; + + /** + * Gets the NatGatewaysClient object to access its operations. + * + * @return the NatGatewaysClient object. + */ + public NatGatewaysClient getNatGateways() { + return this.natGateways; + } + + /** The NetworkInterfaceIpConfigurationsClient object to access its operations. */ + private final NetworkInterfaceIpConfigurationsClient networkInterfaceIpConfigurations; + + /** + * Gets the NetworkInterfaceIpConfigurationsClient object to access its operations. + * + * @return the NetworkInterfaceIpConfigurationsClient object. + */ + public NetworkInterfaceIpConfigurationsClient getNetworkInterfaceIpConfigurations() { + return this.networkInterfaceIpConfigurations; + } + + /** The NetworkInterfaceLoadBalancersClient object to access its operations. */ + private final NetworkInterfaceLoadBalancersClient networkInterfaceLoadBalancers; + + /** + * Gets the NetworkInterfaceLoadBalancersClient object to access its operations. + * + * @return the NetworkInterfaceLoadBalancersClient object. + */ + public NetworkInterfaceLoadBalancersClient getNetworkInterfaceLoadBalancers() { + return this.networkInterfaceLoadBalancers; + } + + /** The NetworkInterfaceTapConfigurationsClient object to access its operations. */ + private final NetworkInterfaceTapConfigurationsClient networkInterfaceTapConfigurations; + + /** + * Gets the NetworkInterfaceTapConfigurationsClient object to access its operations. + * + * @return the NetworkInterfaceTapConfigurationsClient object. + */ + public NetworkInterfaceTapConfigurationsClient getNetworkInterfaceTapConfigurations() { + return this.networkInterfaceTapConfigurations; + } + + /** The NetworkProfilesClient object to access its operations. */ + private final NetworkProfilesClient networkProfiles; + + /** + * Gets the NetworkProfilesClient object to access its operations. + * + * @return the NetworkProfilesClient object. + */ + public NetworkProfilesClient getNetworkProfiles() { + return this.networkProfiles; + } + + /** The NetworkSecurityGroupsClient object to access its operations. */ + private final NetworkSecurityGroupsClient networkSecurityGroups; + + /** + * Gets the NetworkSecurityGroupsClient object to access its operations. + * + * @return the NetworkSecurityGroupsClient object. + */ + public NetworkSecurityGroupsClient getNetworkSecurityGroups() { + return this.networkSecurityGroups; + } + + /** The SecurityRulesClient object to access its operations. */ + private final SecurityRulesClient securityRules; + + /** + * Gets the SecurityRulesClient object to access its operations. + * + * @return the SecurityRulesClient object. + */ + public SecurityRulesClient getSecurityRules() { + return this.securityRules; + } + + /** The DefaultSecurityRulesClient object to access its operations. */ + private final DefaultSecurityRulesClient defaultSecurityRules; + + /** + * Gets the DefaultSecurityRulesClient object to access its operations. + * + * @return the DefaultSecurityRulesClient object. + */ + public DefaultSecurityRulesClient getDefaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** The NetworkVirtualAppliancesClient object to access its operations. */ + private final NetworkVirtualAppliancesClient networkVirtualAppliances; + + /** + * Gets the NetworkVirtualAppliancesClient object to access its operations. + * + * @return the NetworkVirtualAppliancesClient object. + */ + public NetworkVirtualAppliancesClient getNetworkVirtualAppliances() { + return this.networkVirtualAppliances; + } + + /** The VirtualApplianceSitesClient object to access its operations. */ + private final VirtualApplianceSitesClient virtualApplianceSites; + + /** + * Gets the VirtualApplianceSitesClient object to access its operations. + * + * @return the VirtualApplianceSitesClient object. + */ + public VirtualApplianceSitesClient getVirtualApplianceSites() { + return this.virtualApplianceSites; + } + + /** The VirtualApplianceSkusClient object to access its operations. */ + private final VirtualApplianceSkusClient virtualApplianceSkus; + + /** + * Gets the VirtualApplianceSkusClient object to access its operations. + * + * @return the VirtualApplianceSkusClient object. + */ + public VirtualApplianceSkusClient getVirtualApplianceSkus() { + return this.virtualApplianceSkus; + } + + /** The InboundSecurityRuleOperationsClient object to access its operations. */ + private final InboundSecurityRuleOperationsClient inboundSecurityRuleOperations; + + /** + * Gets the InboundSecurityRuleOperationsClient object to access its operations. + * + * @return the InboundSecurityRuleOperationsClient object. + */ + public InboundSecurityRuleOperationsClient getInboundSecurityRuleOperations() { + return this.inboundSecurityRuleOperations; + } + + /** The NetworkWatchersClient object to access its operations. */ + private final NetworkWatchersClient networkWatchers; + + /** + * Gets the NetworkWatchersClient object to access its operations. + * + * @return the NetworkWatchersClient object. + */ + public NetworkWatchersClient getNetworkWatchers() { + return this.networkWatchers; + } + + /** The PacketCapturesClient object to access its operations. */ + private final PacketCapturesClient packetCaptures; + + /** + * Gets the PacketCapturesClient object to access its operations. + * + * @return the PacketCapturesClient object. + */ + public PacketCapturesClient getPacketCaptures() { + return this.packetCaptures; + } + + /** The ConnectionMonitorsClient object to access its operations. */ + private final ConnectionMonitorsClient connectionMonitors; + + /** + * Gets the ConnectionMonitorsClient object to access its operations. + * + * @return the ConnectionMonitorsClient object. + */ + public ConnectionMonitorsClient getConnectionMonitors() { + return this.connectionMonitors; + } + + /** The FlowLogsClient object to access its operations. */ + private final FlowLogsClient flowLogs; + + /** + * Gets the FlowLogsClient object to access its operations. + * + * @return the FlowLogsClient object. + */ + public FlowLogsClient getFlowLogs() { + return this.flowLogs; + } + + /** 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 PrivateEndpointsClient object to access its operations. */ + private final PrivateEndpointsClient privateEndpoints; + + /** + * Gets the PrivateEndpointsClient object to access its operations. + * + * @return the PrivateEndpointsClient object. + */ + public PrivateEndpointsClient getPrivateEndpoints() { + return this.privateEndpoints; + } + + /** The AvailablePrivateEndpointTypesClient object to access its operations. */ + private final AvailablePrivateEndpointTypesClient availablePrivateEndpointTypes; + + /** + * Gets the AvailablePrivateEndpointTypesClient object to access its operations. + * + * @return the AvailablePrivateEndpointTypesClient object. + */ + public AvailablePrivateEndpointTypesClient getAvailablePrivateEndpointTypes() { + return this.availablePrivateEndpointTypes; + } + + /** The PrivateDnsZoneGroupsClient object to access its operations. */ + private final PrivateDnsZoneGroupsClient privateDnsZoneGroups; + + /** + * Gets the PrivateDnsZoneGroupsClient object to access its operations. + * + * @return the PrivateDnsZoneGroupsClient object. + */ + public PrivateDnsZoneGroupsClient getPrivateDnsZoneGroups() { + return this.privateDnsZoneGroups; + } + + /** The PrivateLinkServicesClient object to access its operations. */ + private final PrivateLinkServicesClient privateLinkServices; + + /** + * Gets the PrivateLinkServicesClient object to access its operations. + * + * @return the PrivateLinkServicesClient object. + */ + public PrivateLinkServicesClient getPrivateLinkServices() { + return this.privateLinkServices; + } + + /** The PublicIpPrefixesClient object to access its operations. */ + private final PublicIpPrefixesClient publicIpPrefixes; + + /** + * Gets the PublicIpPrefixesClient object to access its operations. + * + * @return the PublicIpPrefixesClient object. + */ + public PublicIpPrefixesClient getPublicIpPrefixes() { + return this.publicIpPrefixes; + } + + /** The RouteFiltersClient object to access its operations. */ + private final RouteFiltersClient routeFilters; + + /** + * Gets the RouteFiltersClient object to access its operations. + * + * @return the RouteFiltersClient object. + */ + public RouteFiltersClient getRouteFilters() { + return this.routeFilters; + } + + /** The RouteFilterRulesClient object to access its operations. */ + private final RouteFilterRulesClient routeFilterRules; + + /** + * Gets the RouteFilterRulesClient object to access its operations. + * + * @return the RouteFilterRulesClient object. + */ + public RouteFilterRulesClient getRouteFilterRules() { + return this.routeFilterRules; + } + + /** The RouteTablesClient object to access its operations. */ + private final RouteTablesClient routeTables; + + /** + * Gets the RouteTablesClient object to access its operations. + * + * @return the RouteTablesClient object. + */ + public RouteTablesClient getRouteTables() { + return this.routeTables; + } + + /** The RoutesClient object to access its operations. */ + private final RoutesClient routes; + + /** + * Gets the RoutesClient object to access its operations. + * + * @return the RoutesClient object. + */ + public RoutesClient getRoutes() { + return this.routes; + } + + /** The SecurityPartnerProvidersClient object to access its operations. */ + private final SecurityPartnerProvidersClient securityPartnerProviders; + + /** + * Gets the SecurityPartnerProvidersClient object to access its operations. + * + * @return the SecurityPartnerProvidersClient object. + */ + public SecurityPartnerProvidersClient getSecurityPartnerProviders() { + return this.securityPartnerProviders; + } + + /** The BgpServiceCommunitiesClient object to access its operations. */ + private final BgpServiceCommunitiesClient bgpServiceCommunities; + + /** + * Gets the BgpServiceCommunitiesClient object to access its operations. + * + * @return the BgpServiceCommunitiesClient object. + */ + public BgpServiceCommunitiesClient getBgpServiceCommunities() { + return this.bgpServiceCommunities; + } + + /** The ServiceEndpointPoliciesClient object to access its operations. */ + private final ServiceEndpointPoliciesClient serviceEndpointPolicies; + + /** + * Gets the ServiceEndpointPoliciesClient object to access its operations. + * + * @return the ServiceEndpointPoliciesClient object. + */ + public ServiceEndpointPoliciesClient getServiceEndpointPolicies() { + return this.serviceEndpointPolicies; + } + + /** The ServiceEndpointPolicyDefinitionsClient object to access its operations. */ + private final ServiceEndpointPolicyDefinitionsClient serviceEndpointPolicyDefinitions; + + /** + * Gets the ServiceEndpointPolicyDefinitionsClient object to access its operations. + * + * @return the ServiceEndpointPolicyDefinitionsClient object. + */ + public ServiceEndpointPolicyDefinitionsClient getServiceEndpointPolicyDefinitions() { + return this.serviceEndpointPolicyDefinitions; + } + + /** The ServiceTagsClient object to access its operations. */ + private final ServiceTagsClient serviceTags; + + /** + * Gets the ServiceTagsClient object to access its operations. + * + * @return the ServiceTagsClient object. + */ + public ServiceTagsClient getServiceTags() { + return this.serviceTags; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** The VirtualNetworksClient object to access its operations. */ + private final VirtualNetworksClient virtualNetworks; + + /** + * Gets the VirtualNetworksClient object to access its operations. + * + * @return the VirtualNetworksClient object. + */ + public VirtualNetworksClient getVirtualNetworks() { + return this.virtualNetworks; + } + + /** The SubnetsClient object to access its operations. */ + private final SubnetsClient subnets; + + /** + * Gets the SubnetsClient object to access its operations. + * + * @return the SubnetsClient object. + */ + public SubnetsClient getSubnets() { + return this.subnets; + } + + /** The ResourceNavigationLinksClient object to access its operations. */ + private final ResourceNavigationLinksClient resourceNavigationLinks; + + /** + * Gets the ResourceNavigationLinksClient object to access its operations. + * + * @return the ResourceNavigationLinksClient object. + */ + public ResourceNavigationLinksClient getResourceNavigationLinks() { + return this.resourceNavigationLinks; + } + + /** The ServiceAssociationLinksClient object to access its operations. */ + private final ServiceAssociationLinksClient serviceAssociationLinks; + + /** + * Gets the ServiceAssociationLinksClient object to access its operations. + * + * @return the ServiceAssociationLinksClient object. + */ + public ServiceAssociationLinksClient getServiceAssociationLinks() { + return this.serviceAssociationLinks; + } + + /** The VirtualNetworkPeeringsClient object to access its operations. */ + private final VirtualNetworkPeeringsClient virtualNetworkPeerings; + + /** + * Gets the VirtualNetworkPeeringsClient object to access its operations. + * + * @return the VirtualNetworkPeeringsClient object. + */ + public VirtualNetworkPeeringsClient getVirtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** The VirtualNetworkGatewaysClient object to access its operations. */ + private final VirtualNetworkGatewaysClient virtualNetworkGateways; + + /** + * Gets the VirtualNetworkGatewaysClient object to access its operations. + * + * @return the VirtualNetworkGatewaysClient object. + */ + public VirtualNetworkGatewaysClient getVirtualNetworkGateways() { + return this.virtualNetworkGateways; + } + + /** The VirtualNetworkGatewayConnectionsClient object to access its operations. */ + private final VirtualNetworkGatewayConnectionsClient virtualNetworkGatewayConnections; + + /** + * Gets the VirtualNetworkGatewayConnectionsClient object to access its operations. + * + * @return the VirtualNetworkGatewayConnectionsClient object. + */ + public VirtualNetworkGatewayConnectionsClient getVirtualNetworkGatewayConnections() { + return this.virtualNetworkGatewayConnections; + } + + /** The LocalNetworkGatewaysClient object to access its operations. */ + private final LocalNetworkGatewaysClient localNetworkGateways; + + /** + * Gets the LocalNetworkGatewaysClient object to access its operations. + * + * @return the LocalNetworkGatewaysClient object. + */ + public LocalNetworkGatewaysClient getLocalNetworkGateways() { + return this.localNetworkGateways; + } + + /** The VirtualNetworkGatewayNatRulesClient object to access its operations. */ + private final VirtualNetworkGatewayNatRulesClient virtualNetworkGatewayNatRules; + + /** + * Gets the VirtualNetworkGatewayNatRulesClient object to access its operations. + * + * @return the VirtualNetworkGatewayNatRulesClient object. + */ + public VirtualNetworkGatewayNatRulesClient getVirtualNetworkGatewayNatRules() { + return this.virtualNetworkGatewayNatRules; + } + + /** The VirtualNetworkTapsClient object to access its operations. */ + private final VirtualNetworkTapsClient virtualNetworkTaps; + + /** + * Gets the VirtualNetworkTapsClient object to access its operations. + * + * @return the VirtualNetworkTapsClient object. + */ + public VirtualNetworkTapsClient getVirtualNetworkTaps() { + return this.virtualNetworkTaps; + } + + /** The VirtualRoutersClient object to access its operations. */ + private final VirtualRoutersClient virtualRouters; + + /** + * Gets the VirtualRoutersClient object to access its operations. + * + * @return the VirtualRoutersClient object. + */ + public VirtualRoutersClient getVirtualRouters() { + return this.virtualRouters; + } + + /** The VirtualRouterPeeringsClient object to access its operations. */ + private final VirtualRouterPeeringsClient virtualRouterPeerings; + + /** + * Gets the VirtualRouterPeeringsClient object to access its operations. + * + * @return the VirtualRouterPeeringsClient object. + */ + public VirtualRouterPeeringsClient getVirtualRouterPeerings() { + return this.virtualRouterPeerings; + } + + /** The VirtualWansClient object to access its operations. */ + private final VirtualWansClient virtualWans; + + /** + * Gets the VirtualWansClient object to access its operations. + * + * @return the VirtualWansClient object. + */ + public VirtualWansClient getVirtualWans() { + return this.virtualWans; + } + + /** The VpnSitesClient object to access its operations. */ + private final VpnSitesClient vpnSites; + + /** + * Gets the VpnSitesClient object to access its operations. + * + * @return the VpnSitesClient object. + */ + public VpnSitesClient getVpnSites() { + return this.vpnSites; + } + + /** The VpnSiteLinksClient object to access its operations. */ + private final VpnSiteLinksClient vpnSiteLinks; + + /** + * Gets the VpnSiteLinksClient object to access its operations. + * + * @return the VpnSiteLinksClient object. + */ + public VpnSiteLinksClient getVpnSiteLinks() { + return this.vpnSiteLinks; + } + + /** The VpnSitesConfigurationsClient object to access its operations. */ + private final VpnSitesConfigurationsClient vpnSitesConfigurations; + + /** + * Gets the VpnSitesConfigurationsClient object to access its operations. + * + * @return the VpnSitesConfigurationsClient object. + */ + public VpnSitesConfigurationsClient getVpnSitesConfigurations() { + return this.vpnSitesConfigurations; + } + + /** The VpnServerConfigurationsClient object to access its operations. */ + private final VpnServerConfigurationsClient vpnServerConfigurations; + + /** + * Gets the VpnServerConfigurationsClient object to access its operations. + * + * @return the VpnServerConfigurationsClient object. + */ + public VpnServerConfigurationsClient getVpnServerConfigurations() { + return this.vpnServerConfigurations; + } + + /** The VirtualHubsClient object to access its operations. */ + private final VirtualHubsClient virtualHubs; + + /** + * Gets the VirtualHubsClient object to access its operations. + * + * @return the VirtualHubsClient object. + */ + public VirtualHubsClient getVirtualHubs() { + return this.virtualHubs; + } + + /** The HubVirtualNetworkConnectionsClient object to access its operations. */ + private final HubVirtualNetworkConnectionsClient hubVirtualNetworkConnections; + + /** + * Gets the HubVirtualNetworkConnectionsClient object to access its operations. + * + * @return the HubVirtualNetworkConnectionsClient object. + */ + public HubVirtualNetworkConnectionsClient getHubVirtualNetworkConnections() { + return this.hubVirtualNetworkConnections; + } + + /** The VpnGatewaysClient object to access its operations. */ + private final VpnGatewaysClient vpnGateways; + + /** + * Gets the VpnGatewaysClient object to access its operations. + * + * @return the VpnGatewaysClient object. + */ + public VpnGatewaysClient getVpnGateways() { + return this.vpnGateways; + } + + /** The VpnLinkConnectionsClient object to access its operations. */ + private final VpnLinkConnectionsClient vpnLinkConnections; + + /** + * Gets the VpnLinkConnectionsClient object to access its operations. + * + * @return the VpnLinkConnectionsClient object. + */ + public VpnLinkConnectionsClient getVpnLinkConnections() { + return this.vpnLinkConnections; + } + + /** The VpnConnectionsClient object to access its operations. */ + private final VpnConnectionsClient vpnConnections; + + /** + * Gets the VpnConnectionsClient object to access its operations. + * + * @return the VpnConnectionsClient object. + */ + public VpnConnectionsClient getVpnConnections() { + return this.vpnConnections; + } + + /** The VpnSiteLinkConnectionsClient object to access its operations. */ + private final VpnSiteLinkConnectionsClient vpnSiteLinkConnections; + + /** + * Gets the VpnSiteLinkConnectionsClient object to access its operations. + * + * @return the VpnSiteLinkConnectionsClient object. + */ + public VpnSiteLinkConnectionsClient getVpnSiteLinkConnections() { + return this.vpnSiteLinkConnections; + } + + /** The NatRulesClient object to access its operations. */ + private final NatRulesClient natRules; + + /** + * Gets the NatRulesClient object to access its operations. + * + * @return the NatRulesClient object. + */ + public NatRulesClient getNatRules() { + return this.natRules; + } + + /** The P2SVpnGatewaysClient object to access its operations. */ + private final P2SVpnGatewaysClient p2SVpnGateways; + + /** + * Gets the P2SVpnGatewaysClient object to access its operations. + * + * @return the P2SVpnGatewaysClient object. + */ + public P2SVpnGatewaysClient getP2SVpnGateways() { + return this.p2SVpnGateways; + } + + /** The VpnServerConfigurationsAssociatedWithVirtualWansClient object to access its operations. */ + private final VpnServerConfigurationsAssociatedWithVirtualWansClient + vpnServerConfigurationsAssociatedWithVirtualWans; + + /** + * Gets the VpnServerConfigurationsAssociatedWithVirtualWansClient object to access its operations. + * + * @return the VpnServerConfigurationsAssociatedWithVirtualWansClient object. + */ + public VpnServerConfigurationsAssociatedWithVirtualWansClient + getVpnServerConfigurationsAssociatedWithVirtualWans() { + return this.vpnServerConfigurationsAssociatedWithVirtualWans; + } + + /** The VirtualHubRouteTableV2SClient object to access its operations. */ + private final VirtualHubRouteTableV2SClient virtualHubRouteTableV2S; + + /** + * Gets the VirtualHubRouteTableV2SClient object to access its operations. + * + * @return the VirtualHubRouteTableV2SClient object. + */ + public VirtualHubRouteTableV2SClient getVirtualHubRouteTableV2S() { + return this.virtualHubRouteTableV2S; + } + + /** The ExpressRouteGatewaysClient object to access its operations. */ + private final ExpressRouteGatewaysClient expressRouteGateways; + + /** + * Gets the ExpressRouteGatewaysClient object to access its operations. + * + * @return the ExpressRouteGatewaysClient object. + */ + public ExpressRouteGatewaysClient getExpressRouteGateways() { + return this.expressRouteGateways; + } + + /** The ExpressRouteConnectionsClient object to access its operations. */ + private final ExpressRouteConnectionsClient expressRouteConnections; + + /** + * Gets the ExpressRouteConnectionsClient object to access its operations. + * + * @return the ExpressRouteConnectionsClient object. + */ + public ExpressRouteConnectionsClient getExpressRouteConnections() { + return this.expressRouteConnections; + } + + /** The VirtualHubBgpConnectionsClient object to access its operations. */ + private final VirtualHubBgpConnectionsClient virtualHubBgpConnections; + + /** + * Gets the VirtualHubBgpConnectionsClient object to access its operations. + * + * @return the VirtualHubBgpConnectionsClient object. + */ + public VirtualHubBgpConnectionsClient getVirtualHubBgpConnections() { + return this.virtualHubBgpConnections; + } + + /** The VirtualHubIpConfigurationsClient object to access its operations. */ + private final VirtualHubIpConfigurationsClient virtualHubIpConfigurations; + + /** + * Gets the VirtualHubIpConfigurationsClient object to access its operations. + * + * @return the VirtualHubIpConfigurationsClient object. + */ + public VirtualHubIpConfigurationsClient getVirtualHubIpConfigurations() { + return this.virtualHubIpConfigurations; + } + + /** The HubRouteTablesClient object to access its operations. */ + private final HubRouteTablesClient hubRouteTables; + + /** + * Gets the HubRouteTablesClient object to access its operations. + * + * @return the HubRouteTablesClient object. + */ + public HubRouteTablesClient getHubRouteTables() { + return this.hubRouteTables; + } + + /** The WebApplicationFirewallPoliciesClient object to access its operations. */ + private final WebApplicationFirewallPoliciesClient webApplicationFirewallPolicies; + + /** + * Gets the WebApplicationFirewallPoliciesClient object to access its operations. + * + * @return the WebApplicationFirewallPoliciesClient object. + */ + public WebApplicationFirewallPoliciesClient getWebApplicationFirewallPolicies() { + return this.webApplicationFirewallPolicies; + } + + /** + * Initializes an instance of NetworkManagementClient 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 subscription credentials which uniquely identify the Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + NetworkManagementClientImpl( + 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.applicationGateways = new ApplicationGatewaysClientImpl(this); + this.applicationGatewayPrivateLinkResources = new ApplicationGatewayPrivateLinkResourcesClientImpl(this); + this.applicationGatewayPrivateEndpointConnections = + new ApplicationGatewayPrivateEndpointConnectionsClientImpl(this); + this.applicationSecurityGroups = new ApplicationSecurityGroupsClientImpl(this); + this.availableDelegations = new AvailableDelegationsClientImpl(this); + this.availableResourceGroupDelegations = new AvailableResourceGroupDelegationsClientImpl(this); + this.availableServiceAliases = new AvailableServiceAliasesClientImpl(this); + this.azureFirewalls = new AzureFirewallsClientImpl(this); + this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsClientImpl(this); + this.webCategories = new WebCategoriesClientImpl(this); + this.bastionHosts = new BastionHostsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.networkInterfaces = new NetworkInterfacesClientImpl(this); + this.publicIpAddresses = new PublicIpAddressesClientImpl(this); + this.customIpPrefixes = new CustomIpPrefixesClientImpl(this); + this.ddosCustomPolicies = new DdosCustomPoliciesClientImpl(this); + this.ddosProtectionPlans = new DdosProtectionPlansClientImpl(this); + this.dscpConfigurations = new DscpConfigurationsClientImpl(this); + this.availableEndpointServices = new AvailableEndpointServicesClientImpl(this); + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsClientImpl(this); + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsClientImpl(this); + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsClientImpl(this); + this.peerExpressRouteCircuitConnections = new PeerExpressRouteCircuitConnectionsClientImpl(this); + this.expressRouteCircuits = new ExpressRouteCircuitsClientImpl(this); + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersClientImpl(this); + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsClientImpl(this); + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsClientImpl(this); + this.expressRoutePortsLocations = new ExpressRoutePortsLocationsClientImpl(this); + this.expressRoutePorts = new ExpressRoutePortsClientImpl(this); + this.expressRouteLinks = new ExpressRouteLinksClientImpl(this); + this.firewallPolicies = new FirewallPoliciesClientImpl(this); + this.firewallPolicyRuleCollectionGroups = new FirewallPolicyRuleCollectionGroupsClientImpl(this); + this.ipAllocations = new IpAllocationsClientImpl(this); + this.ipGroups = new IpGroupsClientImpl(this); + this.loadBalancers = new LoadBalancersClientImpl(this); + this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsClientImpl(this); + this.loadBalancerFrontendIpConfigurations = new LoadBalancerFrontendIpConfigurationsClientImpl(this); + this.inboundNatRules = new InboundNatRulesClientImpl(this); + this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesClientImpl(this); + this.loadBalancerOutboundRules = new LoadBalancerOutboundRulesClientImpl(this); + this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesClientImpl(this); + this.loadBalancerProbes = new LoadBalancerProbesClientImpl(this); + this.natGateways = new NatGatewaysClientImpl(this); + this.networkInterfaceIpConfigurations = new NetworkInterfaceIpConfigurationsClientImpl(this); + this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersClientImpl(this); + this.networkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsClientImpl(this); + this.networkProfiles = new NetworkProfilesClientImpl(this); + this.networkSecurityGroups = new NetworkSecurityGroupsClientImpl(this); + this.securityRules = new SecurityRulesClientImpl(this); + this.defaultSecurityRules = new DefaultSecurityRulesClientImpl(this); + this.networkVirtualAppliances = new NetworkVirtualAppliancesClientImpl(this); + this.virtualApplianceSites = new VirtualApplianceSitesClientImpl(this); + this.virtualApplianceSkus = new VirtualApplianceSkusClientImpl(this); + this.inboundSecurityRuleOperations = new InboundSecurityRuleOperationsClientImpl(this); + this.networkWatchers = new NetworkWatchersClientImpl(this); + this.packetCaptures = new PacketCapturesClientImpl(this); + this.connectionMonitors = new ConnectionMonitorsClientImpl(this); + this.flowLogs = new FlowLogsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.privateEndpoints = new PrivateEndpointsClientImpl(this); + this.availablePrivateEndpointTypes = new AvailablePrivateEndpointTypesClientImpl(this); + this.privateDnsZoneGroups = new PrivateDnsZoneGroupsClientImpl(this); + this.privateLinkServices = new PrivateLinkServicesClientImpl(this); + this.publicIpPrefixes = new PublicIpPrefixesClientImpl(this); + this.routeFilters = new RouteFiltersClientImpl(this); + this.routeFilterRules = new RouteFilterRulesClientImpl(this); + this.routeTables = new RouteTablesClientImpl(this); + this.routes = new RoutesClientImpl(this); + this.securityPartnerProviders = new SecurityPartnerProvidersClientImpl(this); + this.bgpServiceCommunities = new BgpServiceCommunitiesClientImpl(this); + this.serviceEndpointPolicies = new ServiceEndpointPoliciesClientImpl(this); + this.serviceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsClientImpl(this); + this.serviceTags = new ServiceTagsClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.virtualNetworks = new VirtualNetworksClientImpl(this); + this.subnets = new SubnetsClientImpl(this); + this.resourceNavigationLinks = new ResourceNavigationLinksClientImpl(this); + this.serviceAssociationLinks = new ServiceAssociationLinksClientImpl(this); + this.virtualNetworkPeerings = new VirtualNetworkPeeringsClientImpl(this); + this.virtualNetworkGateways = new VirtualNetworkGatewaysClientImpl(this); + this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsClientImpl(this); + this.localNetworkGateways = new LocalNetworkGatewaysClientImpl(this); + this.virtualNetworkGatewayNatRules = new VirtualNetworkGatewayNatRulesClientImpl(this); + this.virtualNetworkTaps = new VirtualNetworkTapsClientImpl(this); + this.virtualRouters = new VirtualRoutersClientImpl(this); + this.virtualRouterPeerings = new VirtualRouterPeeringsClientImpl(this); + this.virtualWans = new VirtualWansClientImpl(this); + this.vpnSites = new VpnSitesClientImpl(this); + this.vpnSiteLinks = new VpnSiteLinksClientImpl(this); + this.vpnSitesConfigurations = new VpnSitesConfigurationsClientImpl(this); + this.vpnServerConfigurations = new VpnServerConfigurationsClientImpl(this); + this.virtualHubs = new VirtualHubsClientImpl(this); + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsClientImpl(this); + this.vpnGateways = new VpnGatewaysClientImpl(this); + this.vpnLinkConnections = new VpnLinkConnectionsClientImpl(this); + this.vpnConnections = new VpnConnectionsClientImpl(this); + this.vpnSiteLinkConnections = new VpnSiteLinkConnectionsClientImpl(this); + this.natRules = new NatRulesClientImpl(this); + this.p2SVpnGateways = new P2SVpnGatewaysClientImpl(this); + this.vpnServerConfigurationsAssociatedWithVirtualWans = + new VpnServerConfigurationsAssociatedWithVirtualWansClientImpl(this); + this.virtualHubRouteTableV2S = new VirtualHubRouteTableV2SClientImpl(this); + this.expressRouteGateways = new ExpressRouteGatewaysClientImpl(this); + this.expressRouteConnections = new ExpressRouteConnectionsClientImpl(this); + this.virtualHubBgpConnections = new VirtualHubBgpConnectionsClientImpl(this); + this.virtualHubIpConfigurations = new VirtualHubIpConfigurationsClientImpl(this); + this.hubRouteTables = new HubRouteTablesClientImpl(this); + this.webApplicationFirewallPolicies = new WebApplicationFirewallPoliciesClientImpl(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfileImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfileImpl.java new file mode 100644 index 0000000000000..3344fd4e64804 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfileImpl.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.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterface; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkProfile; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkProfileImpl implements NetworkProfile, NetworkProfile.Definition, NetworkProfile.Update { + private NetworkProfileInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public List containerNetworkInterfaces() { + List inner = this.innerModel().containerNetworkInterfaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List containerNetworkInterfaceConfigurations() { + List inner = + this.innerModel().containerNetworkInterfaceConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkProfileName; + + private TagsObject updateParameters; + + public NetworkProfileImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkProfile create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkProfiles() + .createOrUpdateWithResponse(resourceGroupName, networkProfileName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public NetworkProfile create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkProfiles() + .createOrUpdateWithResponse(resourceGroupName, networkProfileName, this.innerModel(), context) + .getValue(); + return this; + } + + NetworkProfileImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkProfileInner(); + this.serviceManager = serviceManager; + this.networkProfileName = name; + } + + public NetworkProfileImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkProfile apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkProfiles() + .updateTagsWithResponse(resourceGroupName, networkProfileName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkProfile apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkProfiles() + .updateTagsWithResponse(resourceGroupName, networkProfileName, updateParameters, context) + .getValue(); + return this; + } + + NetworkProfileImpl( + NetworkProfileInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkProfileName = Utils.getValueFromIdByName(innerObject.id(), "networkProfiles"); + } + + public NetworkProfile refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkProfiles() + .getByResourceGroupWithResponse(resourceGroupName, networkProfileName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkProfile refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkProfiles() + .getByResourceGroupWithResponse(resourceGroupName, networkProfileName, localExpand, context) + .getValue(); + return this; + } + + public NetworkProfileImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkProfileImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkProfileImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkProfileImpl withContainerNetworkInterfaceConfigurations( + List containerNetworkInterfaceConfigurations) { + this.innerModel().withContainerNetworkInterfaceConfigurations(containerNetworkInterfaceConfigurations); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesClientImpl.java new file mode 100644 index 0000000000000..e94a1abcd5c24 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesClientImpl.java @@ -0,0 +1,1379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.network.generated.models.NetworkProfileListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 NetworkProfilesClient. */ +public final class NetworkProfilesClientImpl implements NetworkProfilesClient { + private final ClientLogger logger = new ClientLogger(NetworkProfilesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkProfilesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkProfilesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(NetworkProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkProfiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkProfilesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles/{networkProfileName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkProfileName") String networkProfileName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles/{networkProfileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkProfileName") String networkProfileName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles/{networkProfileName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkProfileName") String networkProfileName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkProfileInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles/{networkProfileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkProfileName") String networkProfileName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkProfileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkProfileName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkProfileName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkProfileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkProfileName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkProfileName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkProfileName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkProfileName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkProfileName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkProfileName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkProfileName) { + return beginDeleteAsync(resourceGroupName, networkProfileName).getSyncPoller(); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkProfileName, Context context) { + return beginDeleteAsync(resourceGroupName, networkProfileName, context).getSyncPoller(); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkProfileName) { + return beginDeleteAsync(resourceGroupName, networkProfileName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkProfileName, Context context) { + return beginDeleteAsync(resourceGroupName, networkProfileName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkProfileName) { + deleteAsync(resourceGroupName, networkProfileName).block(); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkProfileName, Context context) { + deleteAsync(resourceGroupName, networkProfileName, context).block(); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkProfileName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkProfileName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkProfileName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkProfileName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkProfileName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkProfileName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkProfileName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkProfileName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkProfileName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, networkProfileName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, networkProfileName, expand).block(); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkProfileName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkProfileName, expand, context).block(); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkProfileName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkProfileName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkProfileName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkProfileInner createOrUpdate( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkProfileName, parameters).block(); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkProfileName, parameters, context).block(); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkProfileName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkProfileName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkProfileName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkProfileName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkProfileName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String networkProfileName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkProfileName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkProfileName, parameters).block(); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String networkProfileName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, networkProfileName, parameters, context).block(); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the network profiles 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 all the network profiles in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the network profiles 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 all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the network profiles 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 all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for ListNetworkProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListNetworkProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for ListNetworkProfiles API service call. + */ + @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 response for ListNetworkProfiles API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesImpl.java new file mode 100644 index 0000000000000..4dbeb1964664b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.network.generated.models.NetworkProfile; +import com.azure.resourcemanager.network.generated.models.NetworkProfiles; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkProfilesImpl implements NetworkProfiles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfilesImpl.class); + + private final NetworkProfilesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkProfilesImpl( + NetworkProfilesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String networkProfileName) { + this.serviceClient().delete(resourceGroupName, networkProfileName); + } + + public void delete(String resourceGroupName, String networkProfileName, Context context) { + this.serviceClient().delete(resourceGroupName, networkProfileName, context); + } + + public NetworkProfile getByResourceGroup(String resourceGroupName, String networkProfileName) { + NetworkProfileInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkProfileName); + if (inner != null) { + return new NetworkProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkProfileName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkProfileName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public NetworkProfile 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 networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkProfileName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkProfileName, expand, 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 networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + this.delete(resourceGroupName, networkProfileName, 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 networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + this.delete(resourceGroupName, networkProfileName, context); + } + + private NetworkProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkProfileImpl define(String name) { + return new NetworkProfileImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java new file mode 100644 index 0000000000000..105abc803c772 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.FlowLog; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityRule; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class NetworkSecurityGroupImpl + implements NetworkSecurityGroup, NetworkSecurityGroup.Definition, NetworkSecurityGroup.Update { + private NetworkSecurityGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public List securityRules() { + List inner = this.innerModel().securityRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new SecurityRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List defaultSecurityRules() { + List inner = this.innerModel().defaultSecurityRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new SecurityRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List networkInterfaces() { + List inner = this.innerModel().networkInterfaces(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkInterfaceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List subnets() { + List inner = this.innerModel().subnets(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new SubnetImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List flowLogs() { + List inner = this.innerModel().flowLogs(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new FlowLogImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkSecurityGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkSecurityGroupName; + + private TagsObject updateParameters; + + public NetworkSecurityGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkSecurityGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .createOrUpdate(resourceGroupName, networkSecurityGroupName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkSecurityGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .createOrUpdate(resourceGroupName, networkSecurityGroupName, this.innerModel(), context); + return this; + } + + NetworkSecurityGroupImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkSecurityGroupInner(); + this.serviceManager = serviceManager; + this.networkSecurityGroupName = name; + } + + public NetworkSecurityGroupImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkSecurityGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .updateTagsWithResponse(resourceGroupName, networkSecurityGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkSecurityGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .updateTagsWithResponse(resourceGroupName, networkSecurityGroupName, updateParameters, context) + .getValue(); + return this; + } + + NetworkSecurityGroupImpl( + NetworkSecurityGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkSecurityGroupName = Utils.getValueFromIdByName(innerObject.id(), "networkSecurityGroups"); + } + + public NetworkSecurityGroup refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkSecurityGroup refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, localExpand, context) + .getValue(); + return this; + } + + public NetworkSecurityGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkSecurityGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkSecurityGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkSecurityGroupImpl withSecurityRules(List securityRules) { + this.innerModel().withSecurityRules(securityRules); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsClientImpl.java new file mode 100644 index 0000000000000..5fb554e2fde3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsClientImpl.java @@ -0,0 +1,1514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroupListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 NetworkSecurityGroupsClient. */ +public final class NetworkSecurityGroupsClientImpl implements NetworkSecurityGroupsClient { + private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkSecurityGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkSecurityGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkSecurityGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(NetworkSecurityGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkSecurityGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkSecurityGroupsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkSecurityGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkSecurityGroupName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkSecurityGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkSecurityGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkSecurityGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkSecurityGroupName) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName).getSyncPoller(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, context).getSyncPoller(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkSecurityGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkSecurityGroupName) { + deleteAsync(resourceGroupName, networkSecurityGroupName).block(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkSecurityGroupName, Context context) { + deleteAsync(resourceGroupName, networkSecurityGroupName, context).block(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkSecurityGroupName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkSecurityGroupName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, networkSecurityGroupName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, networkSecurityGroupName, expand).block(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkSecurityGroupName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkSecurityGroupName, expand, context) + .block(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkSecurityGroupName, + NetworkSecurityGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkSecurityGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkSecurityGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkSecurityGroupInner.class, + NetworkSecurityGroupInner.class, + Context.NONE); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkSecurityGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkSecurityGroupName, + NetworkSecurityGroupInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkSecurityGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkSecurityGroupInner.class, + NetworkSecurityGroupInner.class, + context); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + NetworkSecurityGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkSecurityGroupName, + NetworkSecurityGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityGroupInner createOrUpdate( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).block(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityGroupInner createOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + NetworkSecurityGroupInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters, context).block(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkSecurityGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityGroupInner updateTags( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters).block(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, networkSecurityGroupName, parameters, context).block(); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network security groups 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 all network security groups in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network security groups 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 all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all network security groups 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 all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for ListNetworkSecurityGroups API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListNetworkSecurityGroups API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync( + 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 + .listAllNext(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 response for ListNetworkSecurityGroups API service call. + */ + @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 response for ListNetworkSecurityGroups API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsImpl.java new file mode 100644 index 0000000000000..10f0c08ba7a93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsImpl.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.network.generated.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.network.generated.fluent.NetworkSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkSecurityGroupsImpl implements NetworkSecurityGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupsImpl.class); + + private final NetworkSecurityGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkSecurityGroupsImpl( + NetworkSecurityGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + this.serviceClient().delete(resourceGroupName, networkSecurityGroupName); + } + + public void delete(String resourceGroupName, String networkSecurityGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, networkSecurityGroupName, context); + } + + public NetworkSecurityGroup getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + NetworkSecurityGroupInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, networkSecurityGroupName); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkSecurityGroupName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkSecurityGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public NetworkSecurityGroup 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 networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, expand, 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 networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, 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 networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, context); + } + + private NetworkSecurityGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkSecurityGroupImpl define(String name) { + return new NetworkSecurityGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.java new file mode 100644 index 0000000000000..70b1a1a2e3d5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkVirtualApplianceImpl + implements NetworkVirtualAppliance, NetworkVirtualAppliance.Definition, NetworkVirtualAppliance.Update { + private NetworkVirtualApplianceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public VirtualApplianceSkuProperties nvaSku() { + return this.innerModel().nvaSku(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public List bootStrapConfigurationBlobs() { + List inner = this.innerModel().bootStrapConfigurationBlobs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource virtualHub() { + return this.innerModel().virtualHub(); + } + + public List cloudInitConfigurationBlobs() { + List inner = this.innerModel().cloudInitConfigurationBlobs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String cloudInitConfiguration() { + return this.innerModel().cloudInitConfiguration(); + } + + public Long virtualApplianceAsn() { + return this.innerModel().virtualApplianceAsn(); + } + + public List virtualApplianceNics() { + List inner = this.innerModel().virtualApplianceNics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List virtualApplianceSites() { + List inner = this.innerModel().virtualApplianceSites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List inboundSecurityRules() { + List inner = this.innerModel().inboundSecurityRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkVirtualApplianceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkVirtualApplianceName; + + private TagsObject updateParameters; + + public NetworkVirtualApplianceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkVirtualAppliance create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkVirtualAppliance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, this.innerModel(), context); + return this; + } + + NetworkVirtualApplianceImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkVirtualApplianceInner(); + this.serviceManager = serviceManager; + this.networkVirtualApplianceName = name; + } + + public NetworkVirtualApplianceImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkVirtualAppliance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .updateTagsWithResponse(resourceGroupName, networkVirtualApplianceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkVirtualAppliance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .updateTagsWithResponse(resourceGroupName, networkVirtualApplianceName, updateParameters, context) + .getValue(); + return this; + } + + NetworkVirtualApplianceImpl( + NetworkVirtualApplianceInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName = Utils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + } + + public NetworkVirtualAppliance refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .getByResourceGroupWithResponse( + resourceGroupName, networkVirtualApplianceName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkVirtualAppliance refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, localExpand, context) + .getValue(); + return this; + } + + public NetworkVirtualApplianceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkVirtualApplianceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkVirtualApplianceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkVirtualApplianceImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public NetworkVirtualApplianceImpl withNvaSku(VirtualApplianceSkuProperties nvaSku) { + this.innerModel().withNvaSku(nvaSku); + return this; + } + + public NetworkVirtualApplianceImpl withBootStrapConfigurationBlobs(List bootStrapConfigurationBlobs) { + this.innerModel().withBootStrapConfigurationBlobs(bootStrapConfigurationBlobs); + return this; + } + + public NetworkVirtualApplianceImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public NetworkVirtualApplianceImpl withCloudInitConfigurationBlobs(List cloudInitConfigurationBlobs) { + this.innerModel().withCloudInitConfigurationBlobs(cloudInitConfigurationBlobs); + return this; + } + + public NetworkVirtualApplianceImpl withCloudInitConfiguration(String cloudInitConfiguration) { + this.innerModel().withCloudInitConfiguration(cloudInitConfiguration); + return this; + } + + public NetworkVirtualApplianceImpl withVirtualApplianceAsn(Long virtualApplianceAsn) { + this.innerModel().withVirtualApplianceAsn(virtualApplianceAsn); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceSkuImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceSkuImpl.java new file mode 100644 index 0000000000000..87666e5dd3ef3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceSkuImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSku; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuInstances; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkVirtualApplianceSkuImpl implements NetworkVirtualApplianceSku { + private NetworkVirtualApplianceSkuInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkVirtualApplianceSkuImpl( + NetworkVirtualApplianceSkuInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 String etag() { + return this.innerModel().etag(); + } + + public String vendor() { + return this.innerModel().vendor(); + } + + public List availableVersions() { + List inner = this.innerModel().availableVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List availableScaleUnits() { + List inner = this.innerModel().availableScaleUnits(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public NetworkVirtualApplianceSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesClientImpl.java new file mode 100644 index 0000000000000..9fdc8255bbb67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesClientImpl.java @@ -0,0 +1,1528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 NetworkVirtualAppliancesClient. */ +public final class NetworkVirtualAppliancesClientImpl implements NetworkVirtualAppliancesClient { + private final ClientLogger logger = new ClientLogger(NetworkVirtualAppliancesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkVirtualAppliancesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkVirtualAppliancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkVirtualAppliancesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(NetworkVirtualAppliancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkVirtualAppliances to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkVirtualAppliancesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkVirtualApplianceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkVirtualApplianceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkVirtualApplianceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkVirtualApplianceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkVirtualApplianceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkVirtualApplianceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkVirtualApplianceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkVirtualApplianceName) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName).getSyncPoller(); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkVirtualApplianceName, Context context) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, context).getSyncPoller(); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkVirtualApplianceName) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkVirtualApplianceName, Context context) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkVirtualApplianceName) { + deleteAsync(resourceGroupName, networkVirtualApplianceName).block(); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkVirtualApplianceName, Context context) { + deleteAsync(resourceGroupName, networkVirtualApplianceName, context).block(); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkVirtualApplianceName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkVirtualApplianceName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkVirtualApplianceName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkVirtualApplianceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkVirtualApplianceName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, networkVirtualApplianceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceInner getByResourceGroup( + String resourceGroupName, String networkVirtualApplianceName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, networkVirtualApplianceName, expand).block(); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkVirtualApplianceName, expand, context) + .block(); + } + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters, 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 (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkVirtualApplianceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceInner updateTags( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkVirtualApplianceName, parameters).block(); + } + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, networkVirtualApplianceName, parameters, context).block(); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkVirtualApplianceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkVirtualApplianceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkVirtualApplianceInner.class, + NetworkVirtualApplianceInner.class, + Context.NONE); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetworkVirtualApplianceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkVirtualApplianceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkVirtualApplianceInner.class, + NetworkVirtualApplianceInner.class, + context); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkVirtualApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetworkVirtualApplianceInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceInner createOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters).block(); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters, context).block(); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Network Virtual Appliances 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 all Network Virtual Appliances in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Network Virtual Appliances 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 all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all Network Virtual Appliances 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 all Network Virtual Appliances in a subscription. + */ + @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 response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 response for ListNetworkVirtualAppliances API service call. + */ + @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 response for ListNetworkVirtualAppliances API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesImpl.java new file mode 100644 index 0000000000000..48a673afe173a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesImpl.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.network.generated.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.network.generated.fluent.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliances; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkVirtualAppliancesImpl implements NetworkVirtualAppliances { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualAppliancesImpl.class); + + private final NetworkVirtualAppliancesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkVirtualAppliancesImpl( + NetworkVirtualAppliancesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String networkVirtualApplianceName) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName); + } + + public void delete(String resourceGroupName, String networkVirtualApplianceName, Context context) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName, context); + } + + public NetworkVirtualAppliance getByResourceGroup(String resourceGroupName, String networkVirtualApplianceName) { + NetworkVirtualApplianceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, networkVirtualApplianceName); + if (inner != null) { + return new NetworkVirtualApplianceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkVirtualApplianceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public NetworkVirtualAppliance 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 networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, expand, 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 networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, 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 networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, context); + } + + private NetworkVirtualAppliancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkVirtualApplianceImpl define(String name) { + return new NetworkVirtualApplianceImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java new file mode 100644 index 0000000000000..e27dd67626dda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersList; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReport; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters; +import com.azure.resourcemanager.network.generated.models.ConnectivityInformation; +import com.azure.resourcemanager.network.generated.models.ConnectivityParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogInformation; +import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResponse; +import com.azure.resourcemanager.network.generated.models.NetworkWatcher; +import com.azure.resourcemanager.network.generated.models.NextHopParameters; +import com.azure.resourcemanager.network.generated.models.NextHopResult; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.Topology; +import com.azure.resourcemanager.network.generated.models.TopologyParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingResult; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowResult; +import java.util.Collections; +import java.util.Map; + +public final class NetworkWatcherImpl implements NetworkWatcher, NetworkWatcher.Definition, NetworkWatcher.Update { + private NetworkWatcherInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkWatcherInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkWatcherName; + + private TagsObject updateParameters; + + public NetworkWatcherImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkWatcher create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .createOrUpdateWithResponse(resourceGroupName, networkWatcherName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public NetworkWatcher create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .createOrUpdateWithResponse(resourceGroupName, networkWatcherName, this.innerModel(), context) + .getValue(); + return this; + } + + NetworkWatcherImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkWatcherInner(); + this.serviceManager = serviceManager; + this.networkWatcherName = name; + } + + public NetworkWatcherImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkWatcher apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .updateTagsWithResponse(resourceGroupName, networkWatcherName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkWatcher apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .updateTagsWithResponse(resourceGroupName, networkWatcherName, updateParameters, context) + .getValue(); + return this; + } + + NetworkWatcherImpl( + NetworkWatcherInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = Utils.getValueFromIdByName(innerObject.id(), "networkWatchers"); + } + + public NetworkWatcher refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, Context.NONE) + .getValue(); + return this; + } + + public NetworkWatcher refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, context) + .getValue(); + return this; + } + + public Topology getTopology(TopologyParameters parameters) { + return serviceManager.networkWatchers().getTopology(resourceGroupName, networkWatcherName, parameters); + } + + public Response getTopologyWithResponse(TopologyParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getTopologyWithResponse(resourceGroupName, networkWatcherName, parameters, context); + } + + public VerificationIpFlowResult verifyIpFlow(VerificationIpFlowParameters parameters) { + return serviceManager.networkWatchers().verifyIpFlow(resourceGroupName, networkWatcherName, parameters); + } + + public VerificationIpFlowResult verifyIpFlow(VerificationIpFlowParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .verifyIpFlow(resourceGroupName, networkWatcherName, parameters, context); + } + + public NextHopResult getNextHop(NextHopParameters parameters) { + return serviceManager.networkWatchers().getNextHop(resourceGroupName, networkWatcherName, parameters); + } + + public NextHopResult getNextHop(NextHopParameters parameters, Context context) { + return serviceManager.networkWatchers().getNextHop(resourceGroupName, networkWatcherName, parameters, context); + } + + public SecurityGroupViewResult getVMSecurityRules(SecurityGroupViewParameters parameters) { + return serviceManager.networkWatchers().getVMSecurityRules(resourceGroupName, networkWatcherName, parameters); + } + + public SecurityGroupViewResult getVMSecurityRules(SecurityGroupViewParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, context); + } + + public TroubleshootingResult getTroubleshooting(TroubleshootingParameters parameters) { + return serviceManager.networkWatchers().getTroubleshooting(resourceGroupName, networkWatcherName, parameters); + } + + public TroubleshootingResult getTroubleshooting(TroubleshootingParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getTroubleshooting(resourceGroupName, networkWatcherName, parameters, context); + } + + public TroubleshootingResult getTroubleshootingResult(QueryTroubleshootingParameters parameters) { + return serviceManager + .networkWatchers() + .getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters); + } + + public TroubleshootingResult getTroubleshootingResult(QueryTroubleshootingParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, context); + } + + public FlowLogInformation setFlowLogConfiguration(FlowLogInformationInner parameters) { + return serviceManager + .networkWatchers() + .setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters); + } + + public FlowLogInformation setFlowLogConfiguration(FlowLogInformationInner parameters, Context context) { + return serviceManager + .networkWatchers() + .setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, context); + } + + public FlowLogInformation getFlowLogStatus(FlowLogStatusParameters parameters) { + return serviceManager.networkWatchers().getFlowLogStatus(resourceGroupName, networkWatcherName, parameters); + } + + public FlowLogInformation getFlowLogStatus(FlowLogStatusParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, context); + } + + public ConnectivityInformation checkConnectivity(ConnectivityParameters parameters) { + return serviceManager.networkWatchers().checkConnectivity(resourceGroupName, networkWatcherName, parameters); + } + + public ConnectivityInformation checkConnectivity(ConnectivityParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .checkConnectivity(resourceGroupName, networkWatcherName, parameters, context); + } + + public AzureReachabilityReport getAzureReachabilityReport(AzureReachabilityReportParameters parameters) { + return serviceManager + .networkWatchers() + .getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters); + } + + public AzureReachabilityReport getAzureReachabilityReport( + AzureReachabilityReportParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, context); + } + + public AvailableProvidersList listAvailableProviders(AvailableProvidersListParameters parameters) { + return serviceManager + .networkWatchers() + .listAvailableProviders(resourceGroupName, networkWatcherName, parameters); + } + + public AvailableProvidersList listAvailableProviders(AvailableProvidersListParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .listAvailableProviders(resourceGroupName, networkWatcherName, parameters, context); + } + + public NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + NetworkConfigurationDiagnosticParameters parameters) { + return serviceManager + .networkWatchers() + .getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters); + } + + public NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + NetworkConfigurationDiagnosticParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, context); + } + + public NetworkWatcherImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkWatcherImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkWatcherImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java new file mode 100644 index 0000000000000..5806f17b6bb6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java @@ -0,0 +1,4714 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkWatchersClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters; +import com.azure.resourcemanager.network.generated.models.ConnectivityParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters; +import com.azure.resourcemanager.network.generated.models.NetworkWatcherListResult; +import com.azure.resourcemanager.network.generated.models.NextHopParameters; +import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.TopologyParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters; +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 NetworkWatchersClient. */ +public final class NetworkWatchersClientImpl implements NetworkWatchersClient { + private final ClientLogger logger = new ClientLogger(NetworkWatchersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkWatchersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkWatchersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkWatchersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(NetworkWatchersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkWatchers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkWatchersService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkWatcherInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/topology") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getTopology( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TopologyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/ipFlowVerify") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> verifyIpFlow( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VerificationIpFlowParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/nextHop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getNextHop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NextHopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/securityGroupView") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getVMSecurityRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecurityGroupViewParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/troubleshoot") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getTroubleshooting( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TroubleshootingParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getTroubleshootingResult( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") QueryTroubleshootingParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/configureFlowLog") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setFlowLogConfiguration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FlowLogInformationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getFlowLogStatus( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FlowLogStatusParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectivityCheck") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> checkConnectivity( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ConnectivityParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/azureReachabilityReport") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getAzureReachabilityReport( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AzureReachabilityReportParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/availableProvidersList") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listAvailableProviders( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AvailableProvidersListParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getNetworkConfigurationDiagnostic( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkConfigurationDiagnosticParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkWatcherInner createOrUpdate( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkWatcherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkWatcherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkWatcherName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupAsync(resourceGroupName, networkWatcherName).block(); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkWatcherName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkWatcherName, context).block(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkWatcherName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkWatcherName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName).getSyncPoller(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, context).getSyncPoller(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkWatcherName) { + deleteAsync(resourceGroupName, networkWatcherName).block(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkWatcherName, Context context) { + deleteAsync(resourceGroupName, networkWatcherName, context).block(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkWatcherName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String networkWatcherName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String networkWatcherName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String networkWatcherName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all network watchers by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all network watchers by 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 all network watchers by subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets all network watchers by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Gets all network watchers by 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 all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Gets all network watchers by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all network watchers by 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 all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getTopologyWithResponseAsync( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getTopology( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getTopologyWithResponseAsync( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getTopology( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getTopologyAsync( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyWithResponseAsync(resourceGroupName, networkWatcherName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TopologyInner getTopology( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTopologyWithResponse( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context) { + return getTopologyWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> verifyIpFlowWithResponseAsync( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .verifyIpFlow( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> verifyIpFlowWithResponseAsync( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .verifyIpFlow( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VerificationIpFlowResultInner> beginVerifyIpFlowAsync( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { + Mono>> mono = + verifyIpFlowWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VerificationIpFlowResultInner.class, + VerificationIpFlowResultInner.class, + Context.NONE); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VerificationIpFlowResultInner> beginVerifyIpFlowAsync( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + verifyIpFlowWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VerificationIpFlowResultInner.class, + VerificationIpFlowResultInner.class, + context); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { + return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { + return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono verifyIpFlowAsync( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { + return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono verifyIpFlowAsync( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { + return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VerificationIpFlowResultInner verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { + return verifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VerificationIpFlowResultInner verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { + return verifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getNextHopWithResponseAsync( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getNextHop( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getNextHopWithResponseAsync( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getNextHop( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NextHopResultInner> beginGetNextHopAsync( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + Mono>> mono = + getNextHopWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NextHopResultInner.class, NextHopResultInner.class, Context.NONE); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NextHopResultInner> beginGetNextHopAsync( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getNextHopWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NextHopResultInner.class, NextHopResultInner.class, context); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NextHopResultInner> beginGetNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NextHopResultInner> beginGetNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { + return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNextHopAsync( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNextHopAsync( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { + return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NextHopResultInner getNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return getNextHopAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NextHopResultInner getNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { + return getNextHopAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getVMSecurityRulesWithResponseAsync( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVMSecurityRules( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getVMSecurityRulesWithResponseAsync( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVMSecurityRules( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SecurityGroupViewResultInner> + beginGetVMSecurityRulesAsync( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { + Mono>> mono = + getVMSecurityRulesWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SecurityGroupViewResultInner.class, + SecurityGroupViewResultInner.class, + Context.NONE); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SecurityGroupViewResultInner> + beginGetVMSecurityRulesAsync( + String resourceGroupName, + String networkWatcherName, + SecurityGroupViewParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getVMSecurityRulesWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SecurityGroupViewResultInner.class, + SecurityGroupViewResultInner.class, + context); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { + return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { + return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVMSecurityRulesAsync( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { + return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVMSecurityRulesAsync( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { + return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityGroupViewResultInner getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { + return getVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityGroupViewResultInner getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { + return getVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getTroubleshootingWithResponseAsync( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getTroubleshooting( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getTroubleshootingWithResponseAsync( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getTroubleshooting( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TroubleshootingResultInner> beginGetTroubleshootingAsync( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + Mono>> mono = + getTroubleshootingWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TroubleshootingResultInner.class, + TroubleshootingResultInner.class, + Context.NONE); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TroubleshootingResultInner> beginGetTroubleshootingAsync( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getTroubleshootingWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TroubleshootingResultInner.class, + TroubleshootingResultInner.class, + context); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { + return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getTroubleshootingAsync( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getTroubleshootingAsync( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { + return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TroubleshootingResultInner getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return getTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TroubleshootingResultInner getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { + return getTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getTroubleshootingResultWithResponseAsync( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getTroubleshootingResult( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getTroubleshootingResultWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getTroubleshootingResult( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TroubleshootingResultInner> + beginGetTroubleshootingResultAsync( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { + Mono>> mono = + getTroubleshootingResultWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TroubleshootingResultInner.class, + TroubleshootingResultInner.class, + Context.NONE); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TroubleshootingResultInner> + beginGetTroubleshootingResultAsync( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getTroubleshootingResultWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TroubleshootingResultInner.class, + TroubleshootingResultInner.class, + context); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { + return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context) { + return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getTroubleshootingResultAsync( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { + return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getTroubleshootingResultAsync( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context) { + return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TroubleshootingResultInner getTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { + return getTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TroubleshootingResultInner getTroubleshootingResult( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context) { + return getTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setFlowLogConfigurationWithResponseAsync( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setFlowLogConfiguration( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setFlowLogConfigurationWithResponseAsync( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setFlowLogConfiguration( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FlowLogInformationInner> beginSetFlowLogConfigurationAsync( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + Mono>> mono = + setFlowLogConfigurationWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FlowLogInformationInner.class, + FlowLogInformationInner.class, + Context.NONE); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FlowLogInformationInner> beginSetFlowLogConfigurationAsync( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + setFlowLogConfigurationWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FlowLogInformationInner.class, + FlowLogInformationInner.class, + context); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { + return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setFlowLogConfigurationAsync( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setFlowLogConfigurationAsync( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { + return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInformationInner setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return setFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInformationInner setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { + return setFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getFlowLogStatusWithResponseAsync( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getFlowLogStatus( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getFlowLogStatusWithResponseAsync( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getFlowLogStatus( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FlowLogInformationInner> beginGetFlowLogStatusAsync( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { + Mono>> mono = + getFlowLogStatusWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FlowLogInformationInner.class, + FlowLogInformationInner.class, + Context.NONE); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, FlowLogInformationInner> beginGetFlowLogStatusAsync( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getFlowLogStatusWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FlowLogInformationInner.class, + FlowLogInformationInner.class, + context); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { + return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { + return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getFlowLogStatusAsync( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { + return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getFlowLogStatusAsync( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { + return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInformationInner getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { + return getFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInformationInner getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { + return getFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> checkConnectivityWithResponseAsync( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkConnectivity( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> checkConnectivityWithResponseAsync( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkConnectivity( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectivityInformationInner> + beginCheckConnectivityAsync( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + Mono>> mono = + checkConnectivityWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectivityInformationInner.class, + ConnectivityInformationInner.class, + Context.NONE); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectivityInformationInner> + beginCheckConnectivityAsync( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + checkConnectivityWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectivityInformationInner.class, + ConnectivityInformationInner.class, + context); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { + return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkConnectivityAsync( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkConnectivityAsync( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { + return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectivityInformationInner checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return checkConnectivityAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectivityInformationInner checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { + return checkConnectivityAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getAzureReachabilityReportWithResponseAsync( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAzureReachabilityReport( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getAzureReachabilityReportWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAzureReachabilityReport( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AzureReachabilityReportInner> + beginGetAzureReachabilityReportAsync( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + Mono>> mono = + getAzureReachabilityReportWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureReachabilityReportInner.class, + AzureReachabilityReportInner.class, + Context.NONE); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AzureReachabilityReportInner> + beginGetAzureReachabilityReportAsync( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getAzureReachabilityReportWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AzureReachabilityReportInner.class, + AzureReachabilityReportInner.class, + context); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AzureReachabilityReportInner> + beginGetAzureReachabilityReport( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AzureReachabilityReportInner> + beginGetAzureReachabilityReport( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context) { + return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAzureReachabilityReportAsync( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAzureReachabilityReportAsync( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context) { + return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureReachabilityReportInner getAzureReachabilityReport( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return getAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureReachabilityReportInner getAzureReachabilityReport( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context) { + return getAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableProvidersWithResponseAsync( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableProviders( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableProvidersWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableProviders( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AvailableProvidersListInner> + beginListAvailableProvidersAsync( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + Mono>> mono = + listAvailableProvidersWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AvailableProvidersListInner.class, + AvailableProvidersListInner.class, + Context.NONE); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AvailableProvidersListInner> + beginListAvailableProvidersAsync( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listAvailableProvidersWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AvailableProvidersListInner.class, + AvailableProvidersListInner.class, + context); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context) { + return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableProvidersAsync( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableProvidersAsync( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context) { + return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailableProvidersListInner listAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return listAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailableProvidersListInner listAvailableProviders( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context) { + return listAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters, context).block(); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getNetworkConfigurationDiagnosticWithResponseAsync( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getNetworkConfigurationDiagnostic( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getNetworkConfigurationDiagnosticWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getNetworkConfigurationDiagnostic( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnosticAsync( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + Mono>> mono = + getNetworkConfigurationDiagnosticWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkConfigurationDiagnosticResponseInner.class, + NetworkConfigurationDiagnosticResponseInner.class, + Context.NONE); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnosticAsync( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getNetworkConfigurationDiagnosticWithResponseAsync( + resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkConfigurationDiagnosticResponseInner.class, + NetworkConfigurationDiagnosticResponseInner.class, + context); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnostic( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) + .getSyncPoller(); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnostic( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context) { + return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNetworkConfigurationDiagnosticAsync( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNetworkConfigurationDiagnosticAsync( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context) { + return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context) { + return getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters, context) + .block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersImpl.java new file mode 100644 index 0000000000000..f002acb5becde --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersImpl.java @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.NetworkWatchersClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersList; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReport; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters; +import com.azure.resourcemanager.network.generated.models.ConnectivityInformation; +import com.azure.resourcemanager.network.generated.models.ConnectivityParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogInformation; +import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResponse; +import com.azure.resourcemanager.network.generated.models.NetworkWatcher; +import com.azure.resourcemanager.network.generated.models.NetworkWatchers; +import com.azure.resourcemanager.network.generated.models.NextHopParameters; +import com.azure.resourcemanager.network.generated.models.NextHopResult; +import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewResult; +import com.azure.resourcemanager.network.generated.models.Topology; +import com.azure.resourcemanager.network.generated.models.TopologyParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingResult; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkWatchersImpl implements NetworkWatchers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatchersImpl.class); + + private final NetworkWatchersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkWatchersImpl( + NetworkWatchersClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public NetworkWatcher getByResourceGroup(String resourceGroupName, String networkWatcherName) { + NetworkWatcherInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkWatcherName); + if (inner != null) { + return new NetworkWatcherImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkWatcherName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkWatcherImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkWatcherName) { + this.serviceClient().delete(resourceGroupName, networkWatcherName); + } + + public void delete(String resourceGroupName, String networkWatcherName, Context context) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public Topology getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + TopologyInner inner = this.serviceClient().getTopology(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new TopologyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getTopologyWithResponse( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context) { + Response inner = + this.serviceClient().getTopologyWithResponse(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TopologyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VerificationIpFlowResult verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { + VerificationIpFlowResultInner inner = + this.serviceClient().verifyIpFlow(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new VerificationIpFlowResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VerificationIpFlowResult verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { + VerificationIpFlowResultInner inner = + this.serviceClient().verifyIpFlow(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new VerificationIpFlowResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public NextHopResult getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + NextHopResultInner inner = this.serviceClient().getNextHop(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new NextHopResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public NextHopResult getNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { + NextHopResultInner inner = + this.serviceClient().getNextHop(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new NextHopResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SecurityGroupViewResult getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { + SecurityGroupViewResultInner inner = + this.serviceClient().getVMSecurityRules(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new SecurityGroupViewResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SecurityGroupViewResult getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { + SecurityGroupViewResultInner inner = + this.serviceClient().getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new SecurityGroupViewResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public TroubleshootingResult getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + TroubleshootingResultInner inner = + this.serviceClient().getTroubleshooting(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new TroubleshootingResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public TroubleshootingResult getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { + TroubleshootingResultInner inner = + this.serviceClient().getTroubleshooting(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new TroubleshootingResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public TroubleshootingResult getTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { + TroubleshootingResultInner inner = + this.serviceClient().getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new TroubleshootingResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public TroubleshootingResult getTroubleshootingResult( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context) { + TroubleshootingResultInner inner = + this.serviceClient().getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new TroubleshootingResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public FlowLogInformation setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + FlowLogInformationInner inner = + this.serviceClient().setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new FlowLogInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FlowLogInformation setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { + FlowLogInformationInner inner = + this.serviceClient().setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new FlowLogInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FlowLogInformation getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { + FlowLogInformationInner inner = + this.serviceClient().getFlowLogStatus(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new FlowLogInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FlowLogInformation getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { + FlowLogInformationInner inner = + this.serviceClient().getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new FlowLogInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectivityInformation checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + ConnectivityInformationInner inner = + this.serviceClient().checkConnectivity(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new ConnectivityInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectivityInformation checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { + ConnectivityInformationInner inner = + this.serviceClient().checkConnectivity(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new ConnectivityInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public AzureReachabilityReport getAzureReachabilityReport( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + AzureReachabilityReportInner inner = + this.serviceClient().getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new AzureReachabilityReportImpl(inner, this.manager()); + } else { + return null; + } + } + + public AzureReachabilityReport getAzureReachabilityReport( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context) { + AzureReachabilityReportInner inner = + this.serviceClient().getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new AzureReachabilityReportImpl(inner, this.manager()); + } else { + return null; + } + } + + public AvailableProvidersList listAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + AvailableProvidersListInner inner = + this.serviceClient().listAvailableProviders(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new AvailableProvidersListImpl(inner, this.manager()); + } else { + return null; + } + } + + public AvailableProvidersList listAvailableProviders( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context) { + AvailableProvidersListInner inner = + this.serviceClient().listAvailableProviders(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new AvailableProvidersListImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + NetworkConfigurationDiagnosticResponseInner inner = + this.serviceClient().getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new NetworkConfigurationDiagnosticResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context) { + NetworkConfigurationDiagnosticResponseInner inner = + this + .serviceClient() + .getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new NetworkConfigurationDiagnosticResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkWatcher 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, 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 networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, context); + } + + private NetworkWatchersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkWatcherImpl define(String name) { + return new NetworkWatcherImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java new file mode 100644 index 0000000000000..0c4e1ff61a3e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; +import com.azure.resourcemanager.network.generated.models.NextHopResult; +import com.azure.resourcemanager.network.generated.models.NextHopType; + +public final class NextHopResultImpl implements NextHopResult { + private NextHopResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NextHopResultImpl( + NextHopResultInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public NextHopType nextHopType() { + return this.innerModel().nextHopType(); + } + + public String nextHopIpAddress() { + return this.innerModel().nextHopIpAddress(); + } + + public String routeTableId() { + return this.innerModel().routeTableId(); + } + + public NextHopResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..25788ef01c972 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.network.generated.models.Operation; +import com.azure.resourcemanager.network.generated.models.OperationDisplay; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..1b3a2ea331c69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.OperationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.network.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + 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 NetworkManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Network/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 Network Rest API 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 result of the request to list Network 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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 Network Rest API 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 result of the request to list Network 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available Network Rest API 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 result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Network Rest API 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 result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Network Rest API 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 result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Network Rest API 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 result of the request to list Network 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 result of the request to list Network 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 result of the request to list Network 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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..cced5e14b7376 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.OperationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.network.generated.models.Operation; +import com.azure.resourcemanager.network.generated.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.network.generated.NetworkManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager 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.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java new file mode 100644 index 0000000000000..cd6f2369e6839 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.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.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.OutboundRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class OutboundRuleImpl implements OutboundRule { + private OutboundRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + OutboundRuleImpl( + OutboundRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Integer allocatedOutboundPorts() { + return this.innerModel().allocatedOutboundPorts(); + } + + public List frontendIpConfigurations() { + List inner = this.innerModel().frontendIpConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource backendAddressPool() { + return this.innerModel().backendAddressPool(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public LoadBalancerOutboundRuleProtocol protocol() { + return this.innerModel().protocol(); + } + + public Boolean enableTcpReset() { + return this.innerModel().enableTcpReset(); + } + + public Integer idleTimeoutInMinutes() { + return this.innerModel().idleTimeoutInMinutes(); + } + + public OutboundRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java new file mode 100644 index 0000000000000..1d28a813c1849 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealth; + +public final class P2SVpnConnectionHealthImpl implements P2SVpnConnectionHealth { + private P2SVpnConnectionHealthInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + P2SVpnConnectionHealthImpl( + P2SVpnConnectionHealthInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sasUrl() { + return this.innerModel().sasUrl(); + } + + public P2SVpnConnectionHealthInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java new file mode 100644 index 0000000000000..2d7be81e8487e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.azure.resourcemanager.network.generated.models.P2SConnectionConfiguration; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealth; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateway; +import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VpnProfileResponse; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class P2SVpnGatewayImpl implements P2SVpnGateway, P2SVpnGateway.Definition, P2SVpnGateway.Update { + private P2SVpnGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public SubResource virtualHub() { + return this.innerModel().virtualHub(); + } + + public List p2SConnectionConfigurations() { + List inner = this.innerModel().p2SConnectionConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Integer vpnGatewayScaleUnit() { + return this.innerModel().vpnGatewayScaleUnit(); + } + + public SubResource vpnServerConfiguration() { + return this.innerModel().vpnServerConfiguration(); + } + + public VpnClientConnectionHealth vpnClientConnectionHealth() { + return this.innerModel().vpnClientConnectionHealth(); + } + + public List customDnsServers() { + List inner = this.innerModel().customDnsServers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean isRoutingPreferenceInternet() { + return this.innerModel().isRoutingPreferenceInternet(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public P2SVpnGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String gatewayName; + + private TagsObject updateP2SVpnGatewayParameters; + + public P2SVpnGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public P2SVpnGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getP2SVpnGateways() + .createOrUpdate(resourceGroupName, gatewayName, this.innerModel(), Context.NONE); + return this; + } + + public P2SVpnGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getP2SVpnGateways() + .createOrUpdate(resourceGroupName, gatewayName, this.innerModel(), context); + return this; + } + + P2SVpnGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new P2SVpnGatewayInner(); + this.serviceManager = serviceManager; + this.gatewayName = name; + } + + public P2SVpnGatewayImpl update() { + this.updateP2SVpnGatewayParameters = new TagsObject(); + return this; + } + + public P2SVpnGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getP2SVpnGateways() + .updateTags(resourceGroupName, gatewayName, updateP2SVpnGatewayParameters, Context.NONE); + return this; + } + + public P2SVpnGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getP2SVpnGateways() + .updateTags(resourceGroupName, gatewayName, updateP2SVpnGatewayParameters, context); + return this; + } + + P2SVpnGatewayImpl( + P2SVpnGatewayInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "p2svpnGateways"); + } + + public P2SVpnGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getP2SVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE) + .getValue(); + return this; + } + + public P2SVpnGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getP2SVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, context) + .getValue(); + return this; + } + + public P2SVpnGateway reset() { + return serviceManager.p2SVpnGateways().reset(resourceGroupName, gatewayName); + } + + public P2SVpnGateway reset(Context context) { + return serviceManager.p2SVpnGateways().reset(resourceGroupName, gatewayName, context); + } + + public VpnProfileResponse generateVpnProfile(P2SVpnProfileParameters parameters) { + return serviceManager.p2SVpnGateways().generateVpnProfile(resourceGroupName, gatewayName, parameters); + } + + public VpnProfileResponse generateVpnProfile(P2SVpnProfileParameters parameters, Context context) { + return serviceManager.p2SVpnGateways().generateVpnProfile(resourceGroupName, gatewayName, parameters, context); + } + + public P2SVpnGateway getP2SVpnConnectionHealth() { + return serviceManager.p2SVpnGateways().getP2SVpnConnectionHealth(resourceGroupName, gatewayName); + } + + public P2SVpnGateway getP2SVpnConnectionHealth(Context context) { + return serviceManager.p2SVpnGateways().getP2SVpnConnectionHealth(resourceGroupName, gatewayName, context); + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed(P2SVpnConnectionHealthRequest request) { + return serviceManager + .p2SVpnGateways() + .getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request); + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + P2SVpnConnectionHealthRequest request, Context context) { + return serviceManager + .p2SVpnGateways() + .getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request, context); + } + + public P2SVpnGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public P2SVpnGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public P2SVpnGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateP2SVpnGatewayParameters.withTags(tags); + return this; + } + } + + public P2SVpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public P2SVpnGatewayImpl withP2SConnectionConfigurations( + List p2SConnectionConfigurations) { + this.innerModel().withP2SConnectionConfigurations(p2SConnectionConfigurations); + return this; + } + + public P2SVpnGatewayImpl withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.innerModel().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); + return this; + } + + public P2SVpnGatewayImpl withVpnServerConfiguration(SubResource vpnServerConfiguration) { + this.innerModel().withVpnServerConfiguration(vpnServerConfiguration); + return this; + } + + public P2SVpnGatewayImpl withCustomDnsServers(List customDnsServers) { + this.innerModel().withCustomDnsServers(customDnsServers); + return this; + } + + public P2SVpnGatewayImpl withIsRoutingPreferenceInternet(Boolean isRoutingPreferenceInternet) { + this.innerModel().withIsRoutingPreferenceInternet(isRoutingPreferenceInternet); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java new file mode 100644 index 0000000000000..f65b4cfa39552 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java @@ -0,0 +1,2931 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.P2SVpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.ListP2SVpnGatewaysResult; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 P2SVpnGatewaysClient. */ +public final class P2SVpnGatewaysClientImpl implements P2SVpnGatewaysClient { + private final ClientLogger logger = new ClientLogger(P2SVpnGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final P2SVpnGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of P2SVpnGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + P2SVpnGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(P2SVpnGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientP2SVpnGateways to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface P2SVpnGatewaysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") P2SVpnGatewayInner p2SVpnGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject p2SVpnGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways") + @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.Network/p2svpnGateways") + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}/reset") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reset( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}/generatevpnprofile") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateVpnProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") P2SVpnProfileParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getP2SVpnConnectionHealth( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getP2SVpnConnectionHealthDetailed( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") P2SVpnConnectionHealthRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disconnectP2SVpnConnections( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("p2sVpnGatewayName") String p2SVpnGatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") P2SVpnConnectionRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String gatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String gatewayName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (p2SVpnGatewayParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null.")); + } else { + p2SVpnGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + p2SVpnGatewayParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (p2SVpnGatewayParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null.")); + } else { + p2SVpnGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + p2SVpnGatewayParameters, + accept, + context); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, Context.NONE); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, context); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).getSyncPoller(); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context) + .getSyncPoller(); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner createOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return createOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).block(); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner createOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context).block(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (p2SVpnGatewayParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null.")); + } else { + p2SVpnGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + p2SVpnGatewayParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (p2SVpnGatewayParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null.")); + } else { + p2SVpnGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + p2SVpnGatewayParameters, + accept, + context); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnGatewayInner> beginUpdateTagsAsync( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, Context.NONE); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnGatewayInner> beginUpdateTagsAsync( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, context); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).getSyncPoller(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context).getSyncPoller(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner updateTags( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { + return updateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).block(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner updateTags( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { + return updateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context).block(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName) { + return beginDeleteAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName) { + return beginDeleteAsync(resourceGroupName, gatewayName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 gatewayName) { + deleteAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 gatewayName, Context context) { + deleteAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reset( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync( + String resourceGroupName, String gatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reset( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnGatewayInner> beginResetAsync( + String resourceGroupName, String gatewayName) { + Mono>> mono = resetWithResponseAsync(resourceGroupName, gatewayName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, Context.NONE); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnGatewayInner> beginResetAsync( + String resourceGroupName, String gatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = resetWithResponseAsync(resourceGroupName, gatewayName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, context); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName) { + return beginResetAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName, Context context) { + return beginResetAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String gatewayName) { + return beginResetAsync(resourceGroupName, gatewayName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String gatewayName, Context context) { + return beginResetAsync(resourceGroupName, gatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner reset(String resourceGroupName, String gatewayName) { + return resetAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner reset(String resourceGroupName, String gatewayName, Context context) { + return resetAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateVpnProfileWithResponseAsync( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateVpnProfile( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateVpnProfileWithResponseAsync( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateVpnProfile( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnProfileResponseInner> beginGenerateVpnProfileAsync( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + Mono>> mono = + generateVpnProfileWithResponseAsync(resourceGroupName, gatewayName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnProfileResponseInner.class, + VpnProfileResponseInner.class, + Context.NONE); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnProfileResponseInner> beginGenerateVpnProfileAsync( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + generateVpnProfileWithResponseAsync(resourceGroupName, gatewayName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnProfileResponseInner.class, + VpnProfileResponseInner.class, + context); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters).getSyncPoller(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters, context).getSyncPoller(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateVpnProfileAsync( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateVpnProfileAsync( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnProfileResponseInner generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + return generateVpnProfileAsync(resourceGroupName, gatewayName, parameters).block(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnProfileResponseInner generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + return generateVpnProfileAsync(resourceGroupName, gatewayName, parameters, context).block(); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getP2SVpnConnectionHealthWithResponseAsync( + String resourceGroupName, String gatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getP2SVpnConnectionHealth( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getP2SVpnConnectionHealthWithResponseAsync( + String resourceGroupName, String gatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getP2SVpnConnectionHealth( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnGatewayInner> beginGetP2SVpnConnectionHealthAsync( + String resourceGroupName, String gatewayName) { + Mono>> mono = + getP2SVpnConnectionHealthWithResponseAsync(resourceGroupName, gatewayName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, Context.NONE); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnGatewayInner> beginGetP2SVpnConnectionHealthAsync( + String resourceGroupName, String gatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getP2SVpnConnectionHealthWithResponseAsync(resourceGroupName, gatewayName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), P2SVpnGatewayInner.class, P2SVpnGatewayInner.class, context); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnGatewayInner> beginGetP2SVpnConnectionHealth( + String resourceGroupName, String gatewayName) { + return beginGetP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnGatewayInner> beginGetP2SVpnConnectionHealth( + String resourceGroupName, String gatewayName, Context context) { + return beginGetP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getP2SVpnConnectionHealthAsync(String resourceGroupName, String gatewayName) { + return beginGetP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getP2SVpnConnectionHealthAsync( + String resourceGroupName, String gatewayName, Context context) { + return beginGetP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName) { + return getP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName, Context context) { + return getP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getP2SVpnConnectionHealthDetailedWithResponseAsync( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getP2SVpnConnectionHealthDetailed( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + request, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getP2SVpnConnectionHealthDetailedWithResponseAsync( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getP2SVpnConnectionHealthDetailed( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + request, + accept, + context); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailedAsync( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request) { + Mono>> mono = + getP2SVpnConnectionHealthDetailedWithResponseAsync(resourceGroupName, gatewayName, request); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + P2SVpnConnectionHealthInner.class, + P2SVpnConnectionHealthInner.class, + Context.NONE); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailedAsync( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getP2SVpnConnectionHealthDetailedWithResponseAsync(resourceGroupName, gatewayName, request, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + P2SVpnConnectionHealthInner.class, + P2SVpnConnectionHealthInner.class, + context); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request) { + return beginGetP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request).getSyncPoller(); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context) { + return beginGetP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request, context) + .getSyncPoller(); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getP2SVpnConnectionHealthDetailedAsync( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request) { + return beginGetP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getP2SVpnConnectionHealthDetailedAsync( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context) { + return beginGetP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnConnectionHealthInner getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request) { + return getP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request).block(); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnConnectionHealthInner getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context) { + return getP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request, context).block(); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> disconnectP2SVpnConnectionsWithResponseAsync( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (p2SVpnGatewayName == null) { + return Mono + .error(new IllegalArgumentException("Parameter p2SVpnGatewayName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disconnectP2SVpnConnections( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + p2SVpnGatewayName, + apiVersion, + request, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> disconnectP2SVpnConnectionsWithResponseAsync( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, 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 (p2SVpnGatewayName == null) { + return Mono + .error(new IllegalArgumentException("Parameter p2SVpnGatewayName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disconnectP2SVpnConnections( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + p2SVpnGatewayName, + apiVersion, + request, + accept, + context); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisconnectP2SVpnConnectionsAsync( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + Mono>> mono = + disconnectP2SVpnConnectionsWithResponseAsync(resourceGroupName, p2SVpnGatewayName, request); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisconnectP2SVpnConnectionsAsync( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disconnectP2SVpnConnectionsWithResponseAsync(resourceGroupName, p2SVpnGatewayName, request, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + return beginDisconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request).getSyncPoller(); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context) { + return beginDisconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request, context) + .getSyncPoller(); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 disconnectP2SVpnConnectionsAsync( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + return beginDisconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 disconnectP2SVpnConnectionsAsync( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context) { + return beginDisconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + disconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request).block(); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context) { + disconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request, 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 result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 result of the request to list P2SVpnGateways. + */ + @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 result of the request to list P2SVpnGateways. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysImpl.java new file mode 100644 index 0000000000000..b33fd1118e8e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.P2SVpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealth; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateway; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateways; +import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters; +import com.azure.resourcemanager.network.generated.models.VpnProfileResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class P2SVpnGatewaysImpl implements P2SVpnGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnGatewaysImpl.class); + + private final P2SVpnGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public P2SVpnGatewaysImpl( + P2SVpnGatewaysClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public P2SVpnGateway getByResourceGroup(String resourceGroupName, String gatewayName) { + P2SVpnGatewayInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, gatewayName); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, gatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new P2SVpnGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String gatewayName) { + this.serviceClient().delete(resourceGroupName, gatewayName); + } + + public void delete(String resourceGroupName, String gatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, gatewayName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public P2SVpnGateway reset(String resourceGroupName, String gatewayName) { + P2SVpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnGateway reset(String resourceGroupName, String gatewayName, Context context) { + P2SVpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName, context); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + VpnProfileResponseInner inner = + this.serviceClient().generateVpnProfile(resourceGroupName, gatewayName, parameters); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + VpnProfileResponseInner inner = + this.serviceClient().generateVpnProfile(resourceGroupName, gatewayName, parameters, context); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName) { + P2SVpnGatewayInner inner = this.serviceClient().getP2SVpnConnectionHealth(resourceGroupName, gatewayName); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName, Context context) { + P2SVpnGatewayInner inner = + this.serviceClient().getP2SVpnConnectionHealth(resourceGroupName, gatewayName, context); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request) { + P2SVpnConnectionHealthInner inner = + this.serviceClient().getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request); + if (inner != null) { + return new P2SVpnConnectionHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context) { + P2SVpnConnectionHealthInner inner = + this.serviceClient().getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request, context); + if (inner != null) { + return new P2SVpnConnectionHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public void disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + this.serviceClient().disconnectP2SVpnConnections(resourceGroupName, p2SVpnGatewayName, request); + } + + public void disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context) { + this.serviceClient().disconnectP2SVpnConnections(resourceGroupName, p2SVpnGatewayName, request, context); + } + + public P2SVpnGateway 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 gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, 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 gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, 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 gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, 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 gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, context); + } + + private P2SVpnGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public P2SVpnGatewayImpl define(String name) { + return new P2SVpnGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java new file mode 100644 index 0000000000000..a7521f857d909 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCaptureQueryStatusResult; +import com.azure.resourcemanager.network.generated.models.PcError; +import com.azure.resourcemanager.network.generated.models.PcStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class PacketCaptureQueryStatusResultImpl implements PacketCaptureQueryStatusResult { + private PacketCaptureQueryStatusResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PacketCaptureQueryStatusResultImpl( + PacketCaptureQueryStatusResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public OffsetDateTime captureStartTime() { + return this.innerModel().captureStartTime(); + } + + public PcStatus packetCaptureStatus() { + return this.innerModel().packetCaptureStatus(); + } + + public String stopReason() { + return this.innerModel().stopReason(); + } + + public List packetCaptureError() { + List inner = this.innerModel().packetCaptureError(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PacketCaptureQueryStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java new file mode 100644 index 0000000000000..2b3071e63fc33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureResult; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class PacketCaptureResultImpl implements PacketCaptureResult { + private PacketCaptureResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PacketCaptureResultImpl( + PacketCaptureResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String target() { + return this.innerModel().target(); + } + + public Long bytesToCapturePerPacket() { + return this.innerModel().bytesToCapturePerPacket(); + } + + public Long totalBytesPerSession() { + return this.innerModel().totalBytesPerSession(); + } + + public Integer timeLimitInSeconds() { + return this.innerModel().timeLimitInSeconds(); + } + + public PacketCaptureStorageLocation storageLocation() { + return this.innerModel().storageLocation(); + } + + public List filters() { + List inner = this.innerModel().filters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PacketCaptureResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesClientImpl.java new file mode 100644 index 0000000000000..1d49a46a751ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesClientImpl.java @@ -0,0 +1,1614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.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.network.generated.fluent.PacketCapturesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCapture; +import com.azure.resourcemanager.network.generated.models.PacketCaptureListResult; +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 PacketCapturesClient. */ +public final class PacketCapturesClientImpl implements PacketCapturesClient { + private final ClientLogger logger = new ClientLogger(PacketCapturesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PacketCapturesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PacketCapturesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PacketCapturesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PacketCapturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPacketCaptures to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PacketCapturesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PacketCapture parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getStatus( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PacketCaptureResultInner> beginCreateAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PacketCaptureResultInner.class, + PacketCaptureResultInner.class, + Context.NONE); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PacketCaptureResultInner> beginCreateAsync( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PacketCaptureResultInner.class, + PacketCaptureResultInner.class, + context); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PacketCaptureResultInner> beginCreate( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters) { + return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).getSyncPoller(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PacketCaptureResultInner> beginCreate( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context) { + return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context) + .getSyncPoller(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters) { + return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context) { + return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCaptureResultInner create( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters) { + return createAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).block(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCaptureResultInner create( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context) { + return createAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context).block(); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getAsync(resourceGroupName, networkWatcherName, packetCaptureName).block(); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).block(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, String packetCaptureName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, String packetCaptureName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, String packetCaptureName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, String packetCaptureName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, String packetCaptureName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).getSyncPoller(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, String packetCaptureName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).getSyncPoller(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, String packetCaptureName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkWatcherName, String packetCaptureName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkWatcherName, String packetCaptureName) { + deleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).block(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkWatcherName, String packetCaptureName, Context context) { + deleteAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).block(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> stopWithResponseAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> stopWithResponseAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStopAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStopAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStop( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName).getSyncPoller(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStop( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).getSyncPoller(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 stopAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 stop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + stopAsync(resourceGroupName, networkWatcherName, packetCaptureName).block(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 stop(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + stopAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).block(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getStatusWithResponseAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getStatus( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getStatusWithResponseAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.")); + } + if (packetCaptureName == null) { + return Mono + .error(new IllegalArgumentException("Parameter packetCaptureName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getStatus( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PacketCaptureQueryStatusResultInner> + beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + Mono>> mono = + getStatusWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PacketCaptureQueryStatusResultInner.class, + PacketCaptureQueryStatusResultInner.class, + Context.NONE); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PacketCaptureQueryStatusResultInner> + beginGetStatusAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getStatusWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PacketCaptureQueryStatusResultInner.class, + PacketCaptureQueryStatusResultInner.class, + context); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PacketCaptureQueryStatusResultInner> + beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName).getSyncPoller(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PacketCaptureQueryStatusResultInner> + beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).getSyncPoller(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStatusAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStatusAsync( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCaptureQueryStatusResultInner getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName).block(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCaptureQueryStatusResultInner getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return getStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).block(); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkWatcherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkWatcherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkWatcherName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkWatcherName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkWatcherName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkWatcherName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName, context)); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName, context)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.java new file mode 100644 index 0000000000000..6b7d8c8596983 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.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.network.generated.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.network.generated.fluent.PacketCapturesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCapture; +import com.azure.resourcemanager.network.generated.models.PacketCaptureQueryStatusResult; +import com.azure.resourcemanager.network.generated.models.PacketCaptureResult; +import com.azure.resourcemanager.network.generated.models.PacketCaptures; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PacketCapturesImpl implements PacketCaptures { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCapturesImpl.class); + + private final PacketCapturesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PacketCapturesImpl( + PacketCapturesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PacketCaptureResult create( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters) { + PacketCaptureResultInner inner = + this.serviceClient().create(resourceGroupName, networkWatcherName, packetCaptureName, parameters); + if (inner != null) { + return new PacketCaptureResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PacketCaptureResult create( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context) { + PacketCaptureResultInner inner = + this.serviceClient().create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context); + if (inner != null) { + return new PacketCaptureResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PacketCaptureResult get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCaptureResultInner inner = + this.serviceClient().get(resourceGroupName, networkWatcherName, packetCaptureName); + if (inner != null) { + return new PacketCaptureResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkWatcherName, packetCaptureName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PacketCaptureResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, packetCaptureName); + } + + public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, packetCaptureName, context); + } + + public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + this.serviceClient().stop(resourceGroupName, networkWatcherName, packetCaptureName); + } + + public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + this.serviceClient().stop(resourceGroupName, networkWatcherName, packetCaptureName, context); + } + + public PacketCaptureQueryStatusResult getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCaptureQueryStatusResultInner inner = + this.serviceClient().getStatus(resourceGroupName, networkWatcherName, packetCaptureName); + if (inner != null) { + return new PacketCaptureQueryStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PacketCaptureQueryStatusResult getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + PacketCaptureQueryStatusResultInner inner = + this.serviceClient().getStatus(resourceGroupName, networkWatcherName, packetCaptureName, context); + if (inner != null) { + return new PacketCaptureQueryStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName); + return Utils.mapPage(inner, inner1 -> new PacketCaptureResultImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName, context); + return Utils.mapPage(inner, inner1 -> new PacketCaptureResultImpl(inner1, this.manager())); + } + + private PacketCapturesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..9d9c1793395cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.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.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class PeerExpressRouteCircuitConnectionImpl implements PeerExpressRouteCircuitConnection { + private PeerExpressRouteCircuitConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PeerExpressRouteCircuitConnectionImpl( + PeerExpressRouteCircuitConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource expressRouteCircuitPeering() { + return this.innerModel().expressRouteCircuitPeering(); + } + + public SubResource peerExpressRouteCircuitPeering() { + return this.innerModel().peerExpressRouteCircuitPeering(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public CircuitConnectionStatus circuitConnectionStatus() { + return this.innerModel().circuitConnectionStatus(); + } + + public String connectionName() { + return this.innerModel().connectionName(); + } + + public String authResourceGuid() { + return this.innerModel().authResourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PeerExpressRouteCircuitConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java new file mode 100644 index 0000000000000..87b5ff63ea0e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.PeerExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnectionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PeerExpressRouteCircuitConnectionsClient. + */ +public final class PeerExpressRouteCircuitConnectionsClientImpl implements PeerExpressRouteCircuitConnectionsClient { + private final ClientLogger logger = new ClientLogger(PeerExpressRouteCircuitConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PeerExpressRouteCircuitConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PeerExpressRouteCircuitConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PeerExpressRouteCircuitConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + PeerExpressRouteCircuitConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPeerExpressRouteCircuitConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PeerExpressRouteCircuitConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerExpressRouteCircuitConnectionInner get( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getAsync(resourceGroupName, circuitName, peeringName, connectionName).block(); + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, context).block(); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String circuitName, String peeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String circuitName, String peeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (circuitName == null) { + return Mono.error(new IllegalArgumentException("Parameter circuitName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, String peeringName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName)); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName, 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 response for ListPeeredConnections API service call retrieves all global reach peer circuit connections + * that belongs to a Private Peering for an ExpressRouteCircuit. + */ + @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 response for ListPeeredConnections API service call retrieves all global reach peer circuit connections + * that belongs to a Private Peering for an ExpressRouteCircuit. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsImpl.java new file mode 100644 index 0000000000000..156805ff3e35d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.PeerExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PeerExpressRouteCircuitConnectionsImpl implements PeerExpressRouteCircuitConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerExpressRouteCircuitConnectionsImpl.class); + + private final PeerExpressRouteCircuitConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PeerExpressRouteCircuitConnectionsImpl( + PeerExpressRouteCircuitConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PeerExpressRouteCircuitConnection get( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + PeerExpressRouteCircuitConnectionInner inner = + this.serviceClient().get(resourceGroupName, circuitName, peeringName, connectionName); + if (inner != null) { + return new PeerExpressRouteCircuitConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PeerExpressRouteCircuitConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName); + return Utils.mapPage(inner, inner1 -> new PeerExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName, context); + return Utils.mapPage(inner, inner1 -> new PeerExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + private PeerExpressRouteCircuitConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java new file mode 100644 index 0000000000000..9e64973f45636 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import com.azure.resourcemanager.network.generated.models.PeerRoute; +import com.azure.resourcemanager.network.generated.models.PeerRouteList; +import java.util.Collections; +import java.util.List; + +public final class PeerRouteListImpl implements PeerRouteList { + private PeerRouteListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PeerRouteListImpl( + PeerRouteListInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PeerRouteListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java new file mode 100644 index 0000000000000..194f6caac42ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class PrivateDnsZoneGroupImpl implements PrivateDnsZoneGroup { + private PrivateDnsZoneGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateDnsZoneGroupImpl( + PrivateDnsZoneGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List privateDnsZoneConfigs() { + List inner = this.innerModel().privateDnsZoneConfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateDnsZoneGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java new file mode 100644 index 0000000000000..67b4526cc622f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java @@ -0,0 +1,1175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.PrivateDnsZoneGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroupListResult; +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 PrivateDnsZoneGroupsClient. */ +public final class PrivateDnsZoneGroupsClientImpl implements PrivateDnsZoneGroupsClient { + private final ClientLogger logger = new ClientLogger(PrivateDnsZoneGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateDnsZoneGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PrivateDnsZoneGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateDnsZoneGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateDnsZoneGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPrivateDnsZoneGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PrivateDnsZoneGroupsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @PathParam("privateDnsZoneGroupName") String privateDnsZoneGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @PathParam("privateDnsZoneGroupName") String privateDnsZoneGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @PathParam("privateDnsZoneGroupName") String privateDnsZoneGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateDnsZoneGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("privateEndpointName") String privateEndpointName, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (privateDnsZoneGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateDnsZoneGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + privateDnsZoneGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (privateDnsZoneGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateDnsZoneGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + privateDnsZoneGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + return beginDeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).getSyncPoller(); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + return beginDeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + deleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).block(); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + deleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context).block(); + } + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the private dns zone group resource by specified private dns zone group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (privateDnsZoneGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateDnsZoneGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + privateDnsZoneGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the private dns zone group resource by specified private dns zone group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (privateDnsZoneGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateDnsZoneGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + privateDnsZoneGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the private dns zone group resource by specified private dns zone group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + return getWithResponseAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the private dns zone group resource by specified private dns zone group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateDnsZoneGroupInner get( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + return getAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).block(); + } + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the private dns zone group resource by specified private dns zone group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context).block(); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (privateDnsZoneGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateDnsZoneGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + privateDnsZoneGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (privateDnsZoneGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateDnsZoneGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + privateDnsZoneGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateDnsZoneGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateDnsZoneGroupInner.class, + PrivateDnsZoneGroupInner.class, + Context.NONE); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateDnsZoneGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateDnsZoneGroupInner.class, + PrivateDnsZoneGroupInner.class, + context); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateDnsZoneGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateDnsZoneGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateDnsZoneGroupInner createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters).block(); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateDnsZoneGroupInner createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, context) + .block(); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String privateEndpointName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + privateEndpointName, + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String privateEndpointName, 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 (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + privateEndpointName, + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String privateEndpointName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(privateEndpointName, resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String privateEndpointName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(privateEndpointName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String privateEndpointName, String resourceGroupName) { + return new PagedIterable<>(listAsync(privateEndpointName, resourceGroupName)); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String privateEndpointName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(privateEndpointName, resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateDnsZoneGroups API service call. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateDnsZoneGroups API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsImpl.java new file mode 100644 index 0000000000000..a9bb4ac99217c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsImpl.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.PrivateDnsZoneGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroup; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateDnsZoneGroupsImpl implements PrivateDnsZoneGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZoneGroupsImpl.class); + + private final PrivateDnsZoneGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PrivateDnsZoneGroupsImpl( + PrivateDnsZoneGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + this.serviceClient().delete(resourceGroupName, privateEndpointName, privateDnsZoneGroupName); + } + + public void delete( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context); + } + + public PrivateDnsZoneGroup get( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + PrivateDnsZoneGroupInner inner = + this.serviceClient().get(resourceGroupName, privateEndpointName, privateDnsZoneGroupName); + if (inner != null) { + return new PrivateDnsZoneGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateDnsZoneGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateDnsZoneGroup createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters) { + PrivateDnsZoneGroupInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters); + if (inner != null) { + return new PrivateDnsZoneGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateDnsZoneGroup createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context) { + PrivateDnsZoneGroupInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, context); + if (inner != null) { + return new PrivateDnsZoneGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String privateEndpointName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().list(privateEndpointName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PrivateDnsZoneGroupImpl(inner1, this.manager())); + } + + public PagedIterable list( + String privateEndpointName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(privateEndpointName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateDnsZoneGroupImpl(inner1, this.manager())); + } + + private PrivateDnsZoneGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..ca421a59f9b8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager 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 etag() { + return this.innerModel().etag(); + } + + public PrivateEndpoint privateEndpoint() { + PrivateEndpointInner inner = this.innerModel().privateEndpoint(); + if (inner != null) { + return new PrivateEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String linkIdentifier() { + return this.innerModel().linkIdentifier(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointImpl.java new file mode 100644 index 0000000000000..ee9624f6dd731 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointImpl.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.CustomDnsConfigPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class PrivateEndpointImpl implements PrivateEndpoint, PrivateEndpoint.Definition, PrivateEndpoint.Update { + private PrivateEndpointInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public List networkInterfaces() { + List inner = this.innerModel().networkInterfaces(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkInterfaceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List privateLinkServiceConnections() { + List inner = this.innerModel().privateLinkServiceConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List manualPrivateLinkServiceConnections() { + List inner = this.innerModel().manualPrivateLinkServiceConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List customDnsConfigs() { + List inner = this.innerModel().customDnsConfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PrivateEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateEndpointName; + + public PrivateEndpointImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PrivateEndpoint create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpoints() + .createOrUpdate(resourceGroupName, privateEndpointName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpoint create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpoints() + .createOrUpdate(resourceGroupName, privateEndpointName, this.innerModel(), context); + return this; + } + + PrivateEndpointImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new PrivateEndpointInner(); + this.serviceManager = serviceManager; + this.privateEndpointName = name; + } + + public PrivateEndpointImpl update() { + return this; + } + + public PrivateEndpoint apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpoints() + .createOrUpdate(resourceGroupName, privateEndpointName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpoint apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpoints() + .createOrUpdate(resourceGroupName, privateEndpointName, this.innerModel(), context); + return this; + } + + PrivateEndpointImpl( + PrivateEndpointInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateEndpointName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpoints"); + } + + public PrivateEndpoint refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpoints() + .getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpoint refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpoints() + .getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, localExpand, context) + .getValue(); + return this; + } + + public PrivateEndpointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PrivateEndpointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PrivateEndpointImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public PrivateEndpointImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public PrivateEndpointImpl withSubnet(SubnetInner subnet) { + this.innerModel().withSubnet(subnet); + return this; + } + + public PrivateEndpointImpl withPrivateLinkServiceConnections( + List privateLinkServiceConnections) { + this.innerModel().withPrivateLinkServiceConnections(privateLinkServiceConnections); + return this; + } + + public PrivateEndpointImpl withManualPrivateLinkServiceConnections( + List manualPrivateLinkServiceConnections) { + this.innerModel().withManualPrivateLinkServiceConnections(manualPrivateLinkServiceConnections); + return this; + } + + public PrivateEndpointImpl withCustomDnsConfigs(List customDnsConfigs) { + this.innerModel().withCustomDnsConfigs(customDnsConfigs); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsClientImpl.java new file mode 100644 index 0000000000000..bf22917cd3e7b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsClientImpl.java @@ -0,0 +1,1293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.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.network.generated.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointListResult; +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 PrivateEndpointsClient. */ +public final class PrivateEndpointsClientImpl implements PrivateEndpointsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PrivateEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPrivateEndpoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PrivateEndpointsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateEndpointInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.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(ErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateEndpointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName) { + return beginDeleteAsync(resourceGroupName, privateEndpointName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, privateEndpointName, context).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName) { + return beginDeleteAsync(resourceGroupName, privateEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, privateEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName) { + deleteAsync(resourceGroupName, privateEndpointName).block(); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 privateEndpointName, Context context) { + deleteAsync(resourceGroupName, privateEndpointName, context).block(); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String privateEndpointName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String privateEndpointName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String privateEndpointName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateEndpointName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String privateEndpointName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, privateEndpointName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointInner getByResourceGroup(String resourceGroupName, String privateEndpointName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, privateEndpointName, expand).block(); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String privateEndpointName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateEndpointName, expand, context).block(); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateEndpointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointInner.class, + PrivateEndpointInner.class, + Context.NONE); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PrivateEndpointInner.class, PrivateEndpointInner.class, context); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointInner createOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters) { + return createOrUpdateAsync(resourceGroupName, privateEndpointName, parameters).block(); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointInner createOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, privateEndpointName, parameters, context).block(); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all private endpoints in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private endpoints in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private endpoints in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private endpoints in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private endpoints in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all private endpoints in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpoints API service call. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpoints API service call. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpoints API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpoints API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsImpl.java new file mode 100644 index 0000000000000..d824ae267dec8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsImpl.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.network.generated.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.network.generated.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoints; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointsImpl implements PrivateEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointsImpl.class); + + private final PrivateEndpointsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PrivateEndpointsImpl( + PrivateEndpointsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String privateEndpointName) { + this.serviceClient().delete(resourceGroupName, privateEndpointName); + } + + public void delete(String resourceGroupName, String privateEndpointName, Context context) { + this.serviceClient().delete(resourceGroupName, privateEndpointName, context); + } + + public PrivateEndpoint getByResourceGroup(String resourceGroupName, String privateEndpointName) { + PrivateEndpointInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, privateEndpointName); + if (inner != null) { + return new PrivateEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String privateEndpointName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PrivateEndpoint 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 privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, expand, 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 privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + this.delete(resourceGroupName, privateEndpointName, 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 privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + this.delete(resourceGroupName, privateEndpointName, context); + } + + private PrivateEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PrivateEndpointImpl define(String name) { + return new PrivateEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.java new file mode 100644 index 0000000000000..7162227542cf3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.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.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.PrivateLinkService; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesAutoApproval; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class PrivateLinkServiceImpl + implements PrivateLinkService, PrivateLinkService.Definition, PrivateLinkService.Update { + private PrivateLinkServiceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List loadBalancerFrontendIpConfigurations() { + List inner = this.innerModel().loadBalancerFrontendIpConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new FrontendIpConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateLinkServiceIpConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List networkInterfaces() { + List inner = this.innerModel().networkInterfaces(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkInterfaceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkServicePropertiesVisibility visibility() { + return this.innerModel().visibility(); + } + + public PrivateLinkServicePropertiesAutoApproval autoApproval() { + return this.innerModel().autoApproval(); + } + + public List fqdns() { + List inner = this.innerModel().fqdns(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String alias() { + return this.innerModel().alias(); + } + + public Boolean enableProxyProtocol() { + return this.innerModel().enableProxyProtocol(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PrivateLinkServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + public PrivateLinkServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PrivateLinkService create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkServices() + .createOrUpdate(resourceGroupName, serviceName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateLinkService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkServices() + .createOrUpdate(resourceGroupName, serviceName, this.innerModel(), context); + return this; + } + + PrivateLinkServiceImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new PrivateLinkServiceInner(); + this.serviceManager = serviceManager; + this.serviceName = name; + } + + public PrivateLinkServiceImpl update() { + return this; + } + + public PrivateLinkService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkServices() + .createOrUpdate(resourceGroupName, serviceName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateLinkService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkServices() + .createOrUpdate(resourceGroupName, serviceName, this.innerModel(), context); + return this; + } + + PrivateLinkServiceImpl( + PrivateLinkServiceInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "privateLinkServices"); + } + + public PrivateLinkService refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkServices() + .getByResourceGroupWithResponse(resourceGroupName, serviceName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public PrivateLinkService refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkServices() + .getByResourceGroupWithResponse(resourceGroupName, serviceName, localExpand, context) + .getValue(); + return this; + } + + public PrivateLinkServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PrivateLinkServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PrivateLinkServiceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public PrivateLinkServiceImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public PrivateLinkServiceImpl withLoadBalancerFrontendIpConfigurations( + List loadBalancerFrontendIpConfigurations) { + this.innerModel().withLoadBalancerFrontendIpConfigurations(loadBalancerFrontendIpConfigurations); + return this; + } + + public PrivateLinkServiceImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public PrivateLinkServiceImpl withVisibility(PrivateLinkServicePropertiesVisibility visibility) { + this.innerModel().withVisibility(visibility); + return this; + } + + public PrivateLinkServiceImpl withAutoApproval(PrivateLinkServicePropertiesAutoApproval autoApproval) { + this.innerModel().withAutoApproval(autoApproval); + return this; + } + + public PrivateLinkServiceImpl withFqdns(List fqdns) { + this.innerModel().withFqdns(fqdns); + return this; + } + + public PrivateLinkServiceImpl withEnableProxyProtocol(Boolean enableProxyProtocol) { + this.innerModel().withEnableProxyProtocol(enableProxyProtocol); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationImpl.java new file mode 100644 index 0000000000000..f92232e4cd5a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class PrivateLinkServiceIpConfigurationImpl implements PrivateLinkServiceIpConfiguration { + private PrivateLinkServiceIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateLinkServiceIpConfigurationImpl( + PrivateLinkServiceIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean primary() { + return this.innerModel().primary(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public IpVersion privateIpAddressVersion() { + return this.innerModel().privateIpAddressVersion(); + } + + public PrivateLinkServiceIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceVisibilityImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceVisibilityImpl.java new file mode 100644 index 0000000000000..bb86ca2d6ecb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceVisibilityImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceVisibility; + +public final class PrivateLinkServiceVisibilityImpl implements PrivateLinkServiceVisibility { + private PrivateLinkServiceVisibilityInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateLinkServiceVisibilityImpl( + PrivateLinkServiceVisibilityInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean visible() { + return this.innerModel().visible(); + } + + public PrivateLinkServiceVisibilityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesClientImpl.java new file mode 100644 index 0000000000000..db4f94d3c5b36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesClientImpl.java @@ -0,0 +1,3447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.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.network.generated.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; +import com.azure.resourcemanager.network.generated.models.AutoApprovedPrivateLinkServicesResult; +import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceListResult; +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 PrivateLinkServicesClient. */ +public final class PrivateLinkServicesClientImpl implements PrivateLinkServicesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkServicesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkServicesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PrivateLinkServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPrivateLinkServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PrivateLinkServicesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateLinkServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getPrivateEndpointConnection( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("peConnectionName") String peConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> updatePrivateEndpointConnection( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("peConnectionName") String peConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> deletePrivateEndpointConnection( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("peConnectionName") String peConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listPrivateEndpointConnections( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/checkPrivateLinkServiceVisibility") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> checkPrivateLinkServiceVisibility( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckPrivateLinkServiceVisibilityRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" + + "/{location}/checkPrivateLinkServiceVisibility") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> checkPrivateLinkServiceVisibilityByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckPrivateLinkServiceVisibilityRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/autoApprovedPrivateLinkServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAutoApprovedPrivateLinkServices( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" + + "/{location}/autoApprovedPrivateLinkServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAutoApprovedPrivateLinkServicesByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.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(ErrorException.class) + Mono> listBySubscriptionNext( + @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(ErrorException.class) + Mono> listPrivateEndpointConnectionsNext( + @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> listAutoApprovedPrivateLinkServicesNext( + @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> listAutoApprovedPrivateLinkServicesByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).getSyncPoller(); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context).getSyncPoller(); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName) { + deleteAsync(resourceGroupName, serviceName).block(); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 serviceName, Context context) { + deleteAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String serviceName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String serviceName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkServiceInner getByResourceGroup(String resourceGroupName, String serviceName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, serviceName, expand).block(); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, expand, context).block(); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateLinkServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateLinkServiceInner.class, + PrivateLinkServiceInner.class, + Context.NONE); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateLinkServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateLinkServiceInner.class, + PrivateLinkServiceInner.class, + context); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateLinkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateLinkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkServiceInner createOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) { + return createOrUpdateAsync(resourceGroupName, serviceName, parameters).block(); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkServiceInner createOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, parameters, context).block(); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all private link service in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private link service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private link service in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private link service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private link service in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all private link service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, String serviceName, String peConnectionName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (peConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPrivateEndpointConnection( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + peConnectionName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, String serviceName, String peConnectionName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (peConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPrivateEndpointConnection( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + peConnectionName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPrivateEndpointConnectionAsync( + String resourceGroupName, String serviceName, String peConnectionName, String expand) { + return getPrivateEndpointConnectionWithResponseAsync(resourceGroupName, serviceName, peConnectionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPrivateEndpointConnectionAsync( + String resourceGroupName, String serviceName, String peConnectionName) { + final String expand = null; + return getPrivateEndpointConnectionWithResponseAsync(resourceGroupName, serviceName, peConnectionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner getPrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName) { + final String expand = null; + return getPrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, expand).block(); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPrivateEndpointConnectionWithResponse( + String resourceGroupName, String serviceName, String peConnectionName, String expand, Context context) { + return getPrivateEndpointConnectionWithResponseAsync( + resourceGroupName, serviceName, peConnectionName, expand, context) + .block(); + } + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updatePrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (peConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePrivateEndpointConnection( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + peConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updatePrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (peConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePrivateEndpointConnection( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + peConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePrivateEndpointConnectionAsync( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters) { + return updatePrivateEndpointConnectionWithResponseAsync( + resourceGroupName, serviceName, peConnectionName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner updatePrivateEndpointConnection( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters) { + return updatePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, parameters) + .block(); + } + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePrivateEndpointConnectionWithResponse( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return updatePrivateEndpointConnectionWithResponseAsync( + resourceGroupName, serviceName, peConnectionName, parameters, context) + .block(); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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>> deletePrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, String serviceName, String peConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (peConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deletePrivateEndpointConnection( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + peConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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>> deletePrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, String serviceName, String peConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (peConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deletePrivateEndpointConnection( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + peConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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> beginDeletePrivateEndpointConnectionAsync( + String resourceGroupName, String serviceName, String peConnectionName) { + Mono>> mono = + deletePrivateEndpointConnectionWithResponseAsync(resourceGroupName, serviceName, peConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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> beginDeletePrivateEndpointConnectionAsync( + String resourceGroupName, String serviceName, String peConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deletePrivateEndpointConnectionWithResponseAsync(resourceGroupName, serviceName, peConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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> beginDeletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName) { + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName) + .getSyncPoller(); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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> beginDeletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName, Context context) { + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, context) + .getSyncPoller(); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 deletePrivateEndpointConnectionAsync( + String resourceGroupName, String serviceName, String peConnectionName) { + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 deletePrivateEndpointConnectionAsync( + String resourceGroupName, String serviceName, String peConnectionName, Context context) { + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 deletePrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName) { + deletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName).block(); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 deletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName, Context context) { + deletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, context).block(); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateEndpointConnectionsSinglePageAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPrivateEndpointConnections( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateEndpointConnectionsSinglePageAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPrivateEndpointConnections( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateEndpointConnectionsAsync( + String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listPrivateEndpointConnectionsSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listPrivateEndpointConnectionsNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateEndpointConnectionsAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listPrivateEndpointConnectionsSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listPrivateEndpointConnectionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName) { + return new PagedIterable<>(listPrivateEndpointConnectionsAsync(resourceGroupName, serviceName)); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listPrivateEndpointConnectionsAsync(resourceGroupName, serviceName, context)); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> checkPrivateLinkServiceVisibilityWithResponseAsync( + String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkPrivateLinkServiceVisibility( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> checkPrivateLinkServiceVisibilityWithResponseAsync( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkPrivateLinkServiceVisibility( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityAsync( + String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + Mono>> mono = + checkPrivateLinkServiceVisibilityWithResponseAsync(location, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateLinkServiceVisibilityInner.class, + PrivateLinkServiceVisibilityInner.class, + Context.NONE); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityAsync( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + checkPrivateLinkServiceVisibilityWithResponseAsync(location, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateLinkServiceVisibilityInner.class, + PrivateLinkServiceVisibilityInner.class, + context); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibility(String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + return beginCheckPrivateLinkServiceVisibilityAsync(location, parameters).getSyncPoller(); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + return beginCheckPrivateLinkServiceVisibilityAsync(location, parameters, context).getSyncPoller(); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkPrivateLinkServiceVisibilityAsync( + String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + return beginCheckPrivateLinkServiceVisibilityAsync(location, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkPrivateLinkServiceVisibilityAsync( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + return beginCheckPrivateLinkServiceVisibilityAsync(location, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + return checkPrivateLinkServiceVisibilityAsync(location, parameters).block(); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + return checkPrivateLinkServiceVisibilityAsync(location, parameters, context).block(); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> checkPrivateLinkServiceVisibilityByResourceGroupWithResponseAsync( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkPrivateLinkServiceVisibilityByResourceGroup( + this.client.getEndpoint(), + location, + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> checkPrivateLinkServiceVisibilityByResourceGroupWithResponseAsync( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkPrivateLinkServiceVisibilityByResourceGroup( + this.client.getEndpoint(), + location, + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) { + Mono>> mono = + checkPrivateLinkServiceVisibilityByResourceGroupWithResponseAsync(location, resourceGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateLinkServiceVisibilityInner.class, + PrivateLinkServiceVisibilityInner.class, + Context.NONE); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + checkPrivateLinkServiceVisibilityByResourceGroupWithResponseAsync( + location, resourceGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateLinkServiceVisibilityInner.class, + PrivateLinkServiceVisibilityInner.class, + context); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(location, resourceGroupName, parameters) + .getSyncPoller(); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync( + location, resourceGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkPrivateLinkServiceVisibilityByResourceGroupAsync( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(location, resourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkPrivateLinkServiceVisibilityByResourceGroupAsync( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync( + location, resourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) { + return checkPrivateLinkServiceVisibilityByResourceGroupAsync(location, resourceGroupName, parameters).block(); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + return checkPrivateLinkServiceVisibilityByResourceGroupAsync(location, resourceGroupName, parameters, context) + .block(); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAutoApprovedPrivateLinkServicesSinglePageAsync( + String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAutoApprovedPrivateLinkServices( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAutoApprovedPrivateLinkServicesSinglePageAsync( + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAutoApprovedPrivateLinkServices( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAutoApprovedPrivateLinkServicesAsync(String location) { + return new PagedFlux<>( + () -> listAutoApprovedPrivateLinkServicesSinglePageAsync(location), + nextLink -> listAutoApprovedPrivateLinkServicesNextSinglePageAsync(nextLink)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAutoApprovedPrivateLinkServicesAsync( + String location, Context context) { + return new PagedFlux<>( + () -> listAutoApprovedPrivateLinkServicesSinglePageAsync(location, context), + nextLink -> listAutoApprovedPrivateLinkServicesNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAutoApprovedPrivateLinkServices(String location) { + return new PagedIterable<>(listAutoApprovedPrivateLinkServicesAsync(location)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAutoApprovedPrivateLinkServices( + String location, Context context) { + return new PagedIterable<>(listAutoApprovedPrivateLinkServicesAsync(location, context)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAutoApprovedPrivateLinkServicesByResourceGroupSinglePageAsync(String location, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAutoApprovedPrivateLinkServicesByResourceGroup( + this.client.getEndpoint(), + location, + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAutoApprovedPrivateLinkServicesByResourceGroupSinglePageAsync( + String location, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAutoApprovedPrivateLinkServicesByResourceGroup( + this.client.getEndpoint(), + location, + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAutoApprovedPrivateLinkServicesByResourceGroupAsync( + String location, String resourceGroupName) { + return new PagedFlux<>( + () -> listAutoApprovedPrivateLinkServicesByResourceGroupSinglePageAsync(location, resourceGroupName), + nextLink -> listAutoApprovedPrivateLinkServicesByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAutoApprovedPrivateLinkServicesByResourceGroupAsync( + String location, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> + listAutoApprovedPrivateLinkServicesByResourceGroupSinglePageAsync(location, resourceGroupName, context), + nextLink -> listAutoApprovedPrivateLinkServicesByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName) { + return new PagedIterable<>( + listAutoApprovedPrivateLinkServicesByResourceGroupAsync(location, resourceGroupName)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName, Context context) { + return new PagedIterable<>( + listAutoApprovedPrivateLinkServicesByResourceGroupAsync(location, resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateLinkService API service call. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateLinkService API service call. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateLinkService API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateLinkService API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateEndpointConnectionsNextSinglePageAsync( + 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.listPrivateEndpointConnectionsNext(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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateEndpointConnectionsNextSinglePageAsync( + 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 + .listPrivateEndpointConnectionsNext(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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAutoApprovedPrivateLinkServicesNextSinglePageAsync(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 + .listAutoApprovedPrivateLinkServicesNext(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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAutoApprovedPrivateLinkServicesNextSinglePageAsync(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 + .listAutoApprovedPrivateLinkServicesNext(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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAutoApprovedPrivateLinkServicesByResourceGroupNextSinglePageAsync(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 + .listAutoApprovedPrivateLinkServicesByResourceGroupNext( + 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAutoApprovedPrivateLinkServicesByResourceGroupNextSinglePageAsync(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 + .listAutoApprovedPrivateLinkServicesByResourceGroupNext( + 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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesImpl.java new file mode 100644 index 0000000000000..28a3d002bd922 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesImpl.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; +import com.azure.resourcemanager.network.generated.models.AutoApprovedPrivateLinkService; +import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.PrivateLinkService; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceVisibility; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkServicesImpl implements PrivateLinkServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServicesImpl.class); + + private final PrivateLinkServicesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PrivateLinkServicesImpl( + PrivateLinkServicesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String serviceName) { + this.serviceClient().delete(resourceGroupName, serviceName); + } + + public void delete(String resourceGroupName, String serviceName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, context); + } + + public PrivateLinkService getByResourceGroup(String resourceGroupName, String serviceName) { + PrivateLinkServiceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, serviceName); + if (inner != null) { + return new PrivateLinkServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, serviceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection getPrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().getPrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPrivateEndpointConnectionWithResponse( + String resourceGroupName, String serviceName, String peConnectionName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getPrivateEndpointConnectionWithResponse( + resourceGroupName, serviceName, peConnectionName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection updatePrivateEndpointConnection( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters) { + PrivateEndpointConnectionInner inner = + this + .serviceClient() + .updatePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, parameters); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updatePrivateEndpointConnectionWithResponse( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .updatePrivateEndpointConnectionWithResponse( + resourceGroupName, serviceName, peConnectionName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deletePrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName) { + this.serviceClient().deletePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName); + } + + public void deletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName, Context context) { + this.serviceClient().deletePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, context); + } + + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listPrivateEndpointConnections(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listPrivateEndpointConnections(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + PrivateLinkServiceVisibilityInner inner = + this.serviceClient().checkPrivateLinkServiceVisibility(location, parameters); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + PrivateLinkServiceVisibilityInner inner = + this.serviceClient().checkPrivateLinkServiceVisibility(location, parameters, context); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) { + PrivateLinkServiceVisibilityInner inner = + this + .serviceClient() + .checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, parameters); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + PrivateLinkServiceVisibilityInner inner = + this + .serviceClient() + .checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, parameters, context); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAutoApprovedPrivateLinkServices(String location) { + PagedIterable inner = + this.serviceClient().listAutoApprovedPrivateLinkServices(location); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServices( + String location, Context context) { + PagedIterable inner = + this.serviceClient().listAutoApprovedPrivateLinkServices(location, context); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PrivateLinkService 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 serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, serviceName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceName, expand, 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 serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + this.delete(resourceGroupName, serviceName, 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 serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + this.delete(resourceGroupName, serviceName, context); + } + + private PrivateLinkServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PrivateLinkServiceImpl define(String name) { + return new PrivateLinkServiceImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.java new file mode 100644 index 0000000000000..60eb70a8b9171 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.azure.resourcemanager.network.generated.models.Probe; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ProbeImpl implements Probe { + private ProbeInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ProbeImpl(ProbeInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProbeProtocol protocol() { + return this.innerModel().protocol(); + } + + public Integer port() { + return this.innerModel().port(); + } + + public Integer intervalInSeconds() { + return this.innerModel().intervalInSeconds(); + } + + public Integer numberOfProbes() { + return this.innerModel().numberOfProbes(); + } + + public String requestPath() { + return this.innerModel().requestPath(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ProbeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressImpl.java new file mode 100644 index 0000000000000..807e109165a15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressImpl.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.models.DdosSettings; +import com.azure.resourcemanager.network.generated.models.DeleteOptions; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NatGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettings; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressMigrationPhase; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSku; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PublicIpAddressImpl implements PublicIpAddress, PublicIpAddress.Definition, PublicIpAddress.Update { + private PublicIpAddressInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public PublicIpAddressSku sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IpAllocationMethod publicIpAllocationMethod() { + return this.innerModel().publicIpAllocationMethod(); + } + + public IpVersion publicIpAddressVersion() { + return this.innerModel().publicIpAddressVersion(); + } + + public IpConfiguration ipConfiguration() { + IpConfigurationInner inner = this.innerModel().ipConfiguration(); + if (inner != null) { + return new IpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddressDnsSettings dnsSettings() { + return this.innerModel().dnsSettings(); + } + + public DdosSettings ddosSettings() { + return this.innerModel().ddosSettings(); + } + + public List ipTags() { + List inner = this.innerModel().ipTags(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public SubResource publicIpPrefix() { + return this.innerModel().publicIpPrefix(); + } + + public Integer idleTimeoutInMinutes() { + return this.innerModel().idleTimeoutInMinutes(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PublicIpAddress servicePublicIpAddress() { + PublicIpAddressInner inner = this.innerModel().servicePublicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public NatGateway natGateway() { + NatGatewayInner inner = this.innerModel().natGateway(); + if (inner != null) { + return new NatGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddressMigrationPhase migrationPhase() { + return this.innerModel().migrationPhase(); + } + + public PublicIpAddress linkedPublicIpAddress() { + PublicIpAddressInner inner = this.innerModel().linkedPublicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeleteOptions deleteOption() { + return this.innerModel().deleteOption(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PublicIpAddressInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publicIpAddressName; + + private TagsObject updateParameters; + + public PublicIpAddressImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PublicIpAddress create() { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .createOrUpdate(resourceGroupName, publicIpAddressName, this.innerModel(), Context.NONE); + return this; + } + + public PublicIpAddress create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .createOrUpdate(resourceGroupName, publicIpAddressName, this.innerModel(), context); + return this; + } + + PublicIpAddressImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new PublicIpAddressInner(); + this.serviceManager = serviceManager; + this.publicIpAddressName = name; + } + + public PublicIpAddressImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public PublicIpAddress apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .updateTagsWithResponse(resourceGroupName, publicIpAddressName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public PublicIpAddress apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .updateTagsWithResponse(resourceGroupName, publicIpAddressName, updateParameters, context) + .getValue(); + return this; + } + + PublicIpAddressImpl( + PublicIpAddressInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publicIpAddressName = Utils.getValueFromIdByName(innerObject.id(), "publicIPAddresses"); + } + + public PublicIpAddress refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public PublicIpAddress refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, localExpand, context) + .getValue(); + return this; + } + + public PublicIpAddressImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PublicIpAddressImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PublicIpAddressImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public PublicIpAddressImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public PublicIpAddressImpl withSku(PublicIpAddressSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public PublicIpAddressImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public PublicIpAddressImpl withPublicIpAllocationMethod(IpAllocationMethod publicIpAllocationMethod) { + this.innerModel().withPublicIpAllocationMethod(publicIpAllocationMethod); + return this; + } + + public PublicIpAddressImpl withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { + this.innerModel().withPublicIpAddressVersion(publicIpAddressVersion); + return this; + } + + public PublicIpAddressImpl withDnsSettings(PublicIpAddressDnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + public PublicIpAddressImpl withDdosSettings(DdosSettings ddosSettings) { + this.innerModel().withDdosSettings(ddosSettings); + return this; + } + + public PublicIpAddressImpl withIpTags(List ipTags) { + this.innerModel().withIpTags(ipTags); + return this; + } + + public PublicIpAddressImpl withIpAddress(String ipAddress) { + this.innerModel().withIpAddress(ipAddress); + return this; + } + + public PublicIpAddressImpl withPublicIpPrefix(SubResource publicIpPrefix) { + this.innerModel().withPublicIpPrefix(publicIpPrefix); + return this; + } + + public PublicIpAddressImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.innerModel().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + public PublicIpAddressImpl withServicePublicIpAddress(PublicIpAddressInner servicePublicIpAddress) { + this.innerModel().withServicePublicIpAddress(servicePublicIpAddress); + return this; + } + + public PublicIpAddressImpl withNatGateway(NatGatewayInner natGateway) { + this.innerModel().withNatGateway(natGateway); + return this; + } + + public PublicIpAddressImpl withMigrationPhase(PublicIpAddressMigrationPhase migrationPhase) { + this.innerModel().withMigrationPhase(migrationPhase); + return this; + } + + public PublicIpAddressImpl withLinkedPublicIpAddress(PublicIpAddressInner linkedPublicIpAddress) { + this.innerModel().withLinkedPublicIpAddress(linkedPublicIpAddress); + return this; + } + + public PublicIpAddressImpl withDeleteOption(DeleteOptions deleteOption) { + this.innerModel().withDeleteOption(deleteOption); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesClientImpl.java new file mode 100644 index 0000000000000..09dda74567d1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesClientImpl.java @@ -0,0 +1,3543 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.PublicIpAddressesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 PublicIpAddressesClient. */ +public final class PublicIpAddressesClientImpl implements PublicIpAddressesClient { + private final ClientLogger logger = new ClientLogger(PublicIpAddressesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PublicIpAddressesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIpAddressesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublicIpAddressesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PublicIpAddressesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPublicIpAddresses to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PublicIpAddressesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/publicipaddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServicePublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" + + "/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceRoleInstancePublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" + + "/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" + + "/{publicIpAddressName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCloudServicePublicIpAddress( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses/{publicIpAddressName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses/{publicIpAddressName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses/{publicIpAddressName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PublicIpAddressInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses/{publicIpAddressName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetPublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetVMPublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" + + "/{publicIpAddressName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualMachineScaleSetPublicIpAddress( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServicePublicIpAddressesNext( + @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> listCloudServiceRoleInstancePublicIpAddressesNext( + @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> listAllNext( + @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> 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> listVirtualMachineScaleSetPublicIpAddressesNext( + @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> listVirtualMachineScaleSetVMPublicIpAddressesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServicePublicIpAddressesSinglePageAsync( + String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listCloudServicePublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServicePublicIpAddressesSinglePageAsync( + String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCloudServicePublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServicePublicIpAddressesAsync( + String resourceGroupName, String cloudServiceName) { + return new PagedFlux<>( + () -> listCloudServicePublicIpAddressesSinglePageAsync(resourceGroupName, cloudServiceName), + nextLink -> listCloudServicePublicIpAddressesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServicePublicIpAddressesAsync( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedFlux<>( + () -> listCloudServicePublicIpAddressesSinglePageAsync(resourceGroupName, cloudServiceName, context), + nextLink -> listCloudServicePublicIpAddressesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName) { + return new PagedIterable<>(listCloudServicePublicIpAddressesAsync(resourceGroupName, cloudServiceName)); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedIterable<>( + listCloudServicePublicIpAddressesAsync(resourceGroupName, cloudServiceName, context)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceRoleInstancePublicIpAddressesSinglePageAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listCloudServiceRoleInstancePublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceRoleInstancePublicIpAddressesSinglePageAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCloudServiceRoleInstancePublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceRoleInstancePublicIpAddressesAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName) { + return new PagedFlux<>( + () -> + listCloudServiceRoleInstancePublicIpAddressesSinglePageAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName), + nextLink -> listCloudServiceRoleInstancePublicIpAddressesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceRoleInstancePublicIpAddressesAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + return new PagedFlux<>( + () -> + listCloudServiceRoleInstancePublicIpAddressesSinglePageAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + context), + nextLink -> listCloudServiceRoleInstancePublicIpAddressesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName) { + return new PagedIterable<>( + listCloudServiceRoleInstancePublicIpAddressesAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + return new PagedIterable<>( + listCloudServiceRoleInstancePublicIpAddressesAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + context)); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCloudServicePublicIpAddressWithResponseAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getCloudServicePublicIpAddress( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCloudServicePublicIpAddressWithResponseAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getCloudServicePublicIpAddress( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCloudServicePublicIpAddressAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand) { + return getCloudServicePublicIpAddressWithResponseAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCloudServicePublicIpAddressAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + final String expand = null; + return getCloudServicePublicIpAddressWithResponseAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner getCloudServicePublicIpAddress( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + final String expand = null; + return getCloudServicePublicIpAddressAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .block(); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCloudServicePublicIpAddressWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context) { + return getCloudServicePublicIpAddressWithResponseAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand, + context) + .block(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpAddressName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpAddressName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpAddressName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, publicIpAddressName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpAddressName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, publicIpAddressName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpAddressName) { + return beginDeleteAsync(resourceGroupName, publicIpAddressName).getSyncPoller(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpAddressName, Context context) { + return beginDeleteAsync(resourceGroupName, publicIpAddressName, context).getSyncPoller(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpAddressName) { + return beginDeleteAsync(resourceGroupName, publicIpAddressName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpAddressName, Context context) { + return beginDeleteAsync(resourceGroupName, publicIpAddressName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publicIpAddressName) { + deleteAsync(resourceGroupName, publicIpAddressName).block(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publicIpAddressName, Context context) { + deleteAsync(resourceGroupName, publicIpAddressName, context).block(); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String publicIpAddressName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String publicIpAddressName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpAddressName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpAddressName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, publicIpAddressName, expand).block(); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpAddressName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpAddressName, expand, context).block(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PublicIpAddressInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publicIpAddressName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PublicIpAddressInner.class, + PublicIpAddressInner.class, + Context.NONE); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PublicIpAddressInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publicIpAddressName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PublicIpAddressInner.class, PublicIpAddressInner.class, context); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner createOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { + return createOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).block(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner createOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters, context).block(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String publicIpAddressName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String publicIpAddressName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, publicIpAddressName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner updateTags( + String resourceGroupName, String publicIpAddressName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, publicIpAddressName, parameters).block(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, publicIpAddressName, parameters, context).block(); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the public IP addresses 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 all the public IP addresses in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the public IP addresses 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 all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the public IP addresses 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 all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( + String resourceGroupName, String virtualMachineScaleSetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVirtualMachineScaleSetPublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVirtualMachineScaleSetPublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetPublicIpAddressesAsync( + String resourceGroupName, String virtualMachineScaleSetName) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName), + nextLink -> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetPublicIpAddressesAsync( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, context), + nextLink -> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName) { + return new PagedIterable<>( + listVirtualMachineScaleSetPublicIpAddressesAsync(resourceGroupName, virtualMachineScaleSetName)); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetPublicIpAddressesAsync(resourceGroupName, virtualMachineScaleSetName, context)); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVirtualMachineScaleSetVMPublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVirtualMachineScaleSetVMPublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetVMPublicIpAddressesAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName), + nextLink -> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetVMPublicIpAddressesAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + context), + nextLink -> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + return new PagedIterable<>( + listVirtualMachineScaleSetVMPublicIpAddressesAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName)); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetVMPublicIpAddressesAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + context)); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVirtualMachineScaleSetPublicIpAddress( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName is required and cannot be null.")); + } + if (virtualmachineIndex == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (ipConfigurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null.")); + } + if (publicIpAddressName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpAddressName is required 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 apiVersion = "2018-10-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVirtualMachineScaleSetPublicIpAddress( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineScaleSetPublicIpAddressAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand) { + return getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineScaleSetPublicIpAddressAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + final String expand = null; + return getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner getVirtualMachineScaleSetPublicIpAddress( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + final String expand = null; + return getVirtualMachineScaleSetPublicIpAddressAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .block(); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVirtualMachineScaleSetPublicIpAddressWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context) { + return getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand, + 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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServicePublicIpAddressesNextSinglePageAsync( + 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.listCloudServicePublicIpAddressesNext(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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServicePublicIpAddressesNextSinglePageAsync( + 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 + .listCloudServicePublicIpAddressesNext(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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceRoleInstancePublicIpAddressesNextSinglePageAsync( + 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 + .listCloudServiceRoleInstancePublicIpAddressesNext( + 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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCloudServiceRoleInstancePublicIpAddressesNextSinglePageAsync( + 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 + .listCloudServiceRoleInstancePublicIpAddressesNext(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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for ListPublicIpAddresses API service call. + */ + @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 response for ListPublicIpAddresses API service call. + */ + @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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync( + 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 + .listVirtualMachineScaleSetPublicIpAddressesNext( + 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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync( + 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 + .listVirtualMachineScaleSetPublicIpAddressesNext(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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync( + 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 + .listVirtualMachineScaleSetVMPublicIpAddressesNext( + 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 response for ListPublicIpAddresses API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync( + 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 + .listVirtualMachineScaleSetVMPublicIpAddressesNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesImpl.java new file mode 100644 index 0000000000000..e0d5373950bfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesImpl.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.PublicIpAddressesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.PublicIpAddresses; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PublicIpAddressesImpl implements PublicIpAddresses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressesImpl.class); + + private final PublicIpAddressesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PublicIpAddressesImpl( + PublicIpAddressesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName) { + PagedIterable inner = + this.serviceClient().listCloudServicePublicIpAddresses(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listCloudServicePublicIpAddresses(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstancePublicIpAddresses( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstancePublicIpAddresses( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PublicIpAddress getCloudServicePublicIpAddress( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + PublicIpAddressInner inner = + this + .serviceClient() + .getCloudServicePublicIpAddress( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCloudServicePublicIpAddressWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getCloudServicePublicIpAddressWithResponse( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublicIpAddressImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String publicIpAddressName) { + this.serviceClient().delete(resourceGroupName, publicIpAddressName); + } + + public void delete(String resourceGroupName, String publicIpAddressName, Context context) { + this.serviceClient().delete(resourceGroupName, publicIpAddressName, context); + } + + public PublicIpAddress getByResourceGroup(String resourceGroupName, String publicIpAddressName) { + PublicIpAddressInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, publicIpAddressName); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpAddressName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublicIpAddressImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetPublicIpAddresses(resourceGroupName, virtualMachineScaleSetName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetPublicIpAddresses(resourceGroupName, virtualMachineScaleSetName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMPublicIpAddresses( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMPublicIpAddresses( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PublicIpAddress getVirtualMachineScaleSetPublicIpAddress( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + PublicIpAddressInner inner = + this + .serviceClient() + .getVirtualMachineScaleSetPublicIpAddress( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVirtualMachineScaleSetPublicIpAddressWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getVirtualMachineScaleSetPublicIpAddressWithResponse( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublicIpAddressImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PublicIpAddress 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 publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, expand, 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 publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + this.delete(resourceGroupName, publicIpAddressName, 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 publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + this.delete(resourceGroupName, publicIpAddressName, context); + } + + private PublicIpAddressesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PublicIpAddressImpl define(String name) { + return new PublicIpAddressImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixImpl.java new file mode 100644 index 0000000000000..d689c7502c16d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixImpl.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NatGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefix; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSku; +import com.azure.resourcemanager.network.generated.models.ReferencedPublicIpAddress; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PublicIpPrefixImpl implements PublicIpPrefix, PublicIpPrefix.Definition, PublicIpPrefix.Update { + private PublicIpPrefixInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public PublicIpPrefixSku sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IpVersion publicIpAddressVersion() { + return this.innerModel().publicIpAddressVersion(); + } + + public List ipTags() { + List inner = this.innerModel().ipTags(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Integer prefixLength() { + return this.innerModel().prefixLength(); + } + + public String ipPrefix() { + return this.innerModel().ipPrefix(); + } + + public List publicIpAddresses() { + List inner = this.innerModel().publicIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource loadBalancerFrontendIpConfiguration() { + return this.innerModel().loadBalancerFrontendIpConfiguration(); + } + + public SubResource customIpPrefix() { + return this.innerModel().customIpPrefix(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NatGateway natGateway() { + NatGatewayInner inner = this.innerModel().natGateway(); + if (inner != null) { + return new NatGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PublicIpPrefixInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publicIpPrefixName; + + private TagsObject updateParameters; + + public PublicIpPrefixImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PublicIpPrefix create() { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpPrefixes() + .createOrUpdate(resourceGroupName, publicIpPrefixName, this.innerModel(), Context.NONE); + return this; + } + + public PublicIpPrefix create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpPrefixes() + .createOrUpdate(resourceGroupName, publicIpPrefixName, this.innerModel(), context); + return this; + } + + PublicIpPrefixImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new PublicIpPrefixInner(); + this.serviceManager = serviceManager; + this.publicIpPrefixName = name; + } + + public PublicIpPrefixImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public PublicIpPrefix apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpPrefixes() + .updateTagsWithResponse(resourceGroupName, publicIpPrefixName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public PublicIpPrefix apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpPrefixes() + .updateTagsWithResponse(resourceGroupName, publicIpPrefixName, updateParameters, context) + .getValue(); + return this; + } + + PublicIpPrefixImpl( + PublicIpPrefixInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publicIpPrefixName = Utils.getValueFromIdByName(innerObject.id(), "publicIPPrefixes"); + } + + public PublicIpPrefix refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public PublicIpPrefix refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, localExpand, context) + .getValue(); + return this; + } + + public PublicIpPrefixImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PublicIpPrefixImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PublicIpPrefixImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public PublicIpPrefixImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public PublicIpPrefixImpl withSku(PublicIpPrefixSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public PublicIpPrefixImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public PublicIpPrefixImpl withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { + this.innerModel().withPublicIpAddressVersion(publicIpAddressVersion); + return this; + } + + public PublicIpPrefixImpl withIpTags(List ipTags) { + this.innerModel().withIpTags(ipTags); + return this; + } + + public PublicIpPrefixImpl withPrefixLength(Integer prefixLength) { + this.innerModel().withPrefixLength(prefixLength); + return this; + } + + public PublicIpPrefixImpl withCustomIpPrefix(SubResource customIpPrefix) { + this.innerModel().withCustomIpPrefix(customIpPrefix); + return this; + } + + public PublicIpPrefixImpl withNatGateway(NatGatewayInner natGateway) { + this.innerModel().withNatGateway(natGateway); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesClientImpl.java new file mode 100644 index 0000000000000..3ce1559d6958c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesClientImpl.java @@ -0,0 +1,1478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.PublicIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 PublicIpPrefixesClient. */ +public final class PublicIpPrefixesClientImpl implements PublicIpPrefixesClient { + private final ClientLogger logger = new ClientLogger(PublicIpPrefixesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PublicIpPrefixesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIpPrefixesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublicIpPrefixesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PublicIpPrefixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPublicIpPrefixes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PublicIpPrefixesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes/{publicIpPrefixName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpPrefixName") String publicIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes/{publicIpPrefixName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpPrefixName") String publicIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes/{publicIpPrefixName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpPrefixName") String publicIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PublicIpPrefixInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes/{publicIpPrefixName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpPrefixName") String publicIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpPrefixName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpPrefixName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpPrefixName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpPrefixName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpPrefixName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, publicIpPrefixName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpPrefixName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, publicIpPrefixName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpPrefixName) { + return beginDeleteAsync(resourceGroupName, publicIpPrefixName).getSyncPoller(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpPrefixName, Context context) { + return beginDeleteAsync(resourceGroupName, publicIpPrefixName, context).getSyncPoller(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpPrefixName) { + return beginDeleteAsync(resourceGroupName, publicIpPrefixName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publicIpPrefixName, Context context) { + return beginDeleteAsync(resourceGroupName, publicIpPrefixName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publicIpPrefixName) { + deleteAsync(resourceGroupName, publicIpPrefixName).block(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publicIpPrefixName, Context context) { + deleteAsync(resourceGroupName, publicIpPrefixName, context).block(); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String publicIpPrefixName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpPrefixName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String publicIpPrefixName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpPrefixName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String publicIpPrefixName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpPrefixName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpPrefixName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, publicIpPrefixName, expand).block(); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpPrefixName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpPrefixName, expand, context).block(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PublicIpPrefixInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publicIpPrefixName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PublicIpPrefixInner.class, + PublicIpPrefixInner.class, + Context.NONE); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PublicIpPrefixInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, publicIpPrefixName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PublicIpPrefixInner.class, PublicIpPrefixInner.class, context); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpPrefixInner createOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { + return createOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).block(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpPrefixInner createOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters, context).block(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpPrefixName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, publicIpPrefixName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, publicIpPrefixName, parameters).block(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, publicIpPrefixName, parameters, context).block(); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the public IP prefixes 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 all the public IP prefixes in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the public IP prefixes 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 all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the public IP prefixes 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 all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for ListPublicIpPrefixes API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListPublicIpPrefixes API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for ListPublicIpPrefixes API service call. + */ + @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 response for ListPublicIpPrefixes API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesImpl.java new file mode 100644 index 0000000000000..e5ab2e649a52f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.PublicIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefix; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PublicIpPrefixesImpl implements PublicIpPrefixes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixesImpl.class); + + private final PublicIpPrefixesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PublicIpPrefixesImpl( + PublicIpPrefixesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String publicIpPrefixName) { + this.serviceClient().delete(resourceGroupName, publicIpPrefixName); + } + + public void delete(String resourceGroupName, String publicIpPrefixName, Context context) { + this.serviceClient().delete(resourceGroupName, publicIpPrefixName, context); + } + + public PublicIpPrefix getByResourceGroup(String resourceGroupName, String publicIpPrefixName) { + PublicIpPrefixInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, publicIpPrefixName); + if (inner != null) { + return new PublicIpPrefixImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpPrefixName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublicIpPrefixImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PublicIpPrefix 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 publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, expand, 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 publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + this.delete(resourceGroupName, publicIpPrefixName, 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 publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + this.delete(resourceGroupName, publicIpPrefixName, context); + } + + private PublicIpPrefixesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PublicIpPrefixImpl define(String name) { + return new PublicIpPrefixImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksClientImpl.java new file mode 100644 index 0000000000000..7bafcef6c11db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ResourceNavigationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceNavigationLinksClient. */ +public final class ResourceNavigationLinksClientImpl implements ResourceNavigationLinksClient { + private final ClientLogger logger = new ClientLogger(ResourceNavigationLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceNavigationLinksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ResourceNavigationLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceNavigationLinksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ResourceNavigationLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientResourceNavigationLinks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ResourceNavigationLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resource navigation links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String subnetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resource navigation links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resource navigation links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String virtualNetworkName, String subnetName) { + return listWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resource navigation links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceNavigationLinksListResultInner list( + String resourceGroupName, String virtualNetworkName, String subnetName) { + return listAsync(resourceGroupName, virtualNetworkName, subnetName).block(); + } + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resource navigation links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + return listWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksImpl.java new file mode 100644 index 0000000000000..e41140d36ca9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ResourceNavigationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinks; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinksListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceNavigationLinksImpl implements ResourceNavigationLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNavigationLinksImpl.class); + + private final ResourceNavigationLinksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ResourceNavigationLinksImpl( + ResourceNavigationLinksClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ResourceNavigationLinksListResult list( + String resourceGroupName, String virtualNetworkName, String subnetName) { + ResourceNavigationLinksListResultInner inner = + this.serviceClient().list(resourceGroupName, virtualNetworkName, subnetName); + if (inner != null) { + return new ResourceNavigationLinksListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, virtualNetworkName, subnetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceNavigationLinksListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ResourceNavigationLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksListResultImpl.java new file mode 100644 index 0000000000000..bdd3c4cbbed88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksListResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinksListResult; +import java.util.Collections; +import java.util.List; + +public final class ResourceNavigationLinksListResultImpl implements ResourceNavigationLinksListResult { + private ResourceNavigationLinksListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ResourceNavigationLinksListResultImpl( + ResourceNavigationLinksListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ResourceNavigationLinksListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..76ab0385d9e65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,2287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.network.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.BastionActiveSessionListResult; +import com.azure.resourcemanager.network.generated.models.BastionSessionDeleteResult; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListResult; +import com.azure.resourcemanager.network.generated.models.SessionIds; +import com.azure.resourcemanager.network.generated.models.VirtualWanVpnProfileParameters; +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 ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + private final ClientLogger logger = new ClientLogger(ResourceProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientResourceProviders to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/createShareableLinks") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> putBastionShareableLink( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BastionShareableLinkListRequest bslRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/deleteShareableLinks") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteBastionShareableLink( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BastionShareableLinkListRequest bslRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/getShareableLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBastionShareableLink( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BastionShareableLinkListRequest bslRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/getActiveSessions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getActiveSessions( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/disconnectActiveSessions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disconnectActiveSessions( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SessionIds sessionIds, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkDnsNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("domainNameLabel") String domainNameLabel, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{virtualWANName}/supportedSecurityProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> supportedSecurityProviders( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{virtualWANName}/GenerateVpnProfile") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generatevirtualwanvpnserverconfigurationvpnprofile( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualWanVpnProfileParameters vpnClientParams, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> putBastionShareableLinkNext( + @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> getBastionShareableLinkNext( + @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, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getActiveSessionsNext( + @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> disconnectActiveSessionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putBastionShareableLinkSinglePageAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (bslRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter bslRequest is required and cannot be null.")); + } else { + bslRequest.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> { + Mono>> mono = + service + .putBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BastionShareableLinkListResult.class, + BastionShareableLinkListResult.class, + Context.NONE) + .last() + .flatMap(this.client::getLroFinalResultOrError)); + }) + .>map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putBastionShareableLinkSinglePageAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (bslRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter bslRequest is required and cannot be null.")); + } else { + bslRequest.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + Mono>> mono = + service + .putBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BastionShareableLinkListResult.class, + BastionShareableLinkListResult.class, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux putBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return new PagedFlux<>( + () -> putBastionShareableLinkSinglePageAsync(resourceGroupName, bastionHostname, bslRequest), + nextLink -> putBastionShareableLinkNextSinglePageAsync(nextLink)); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux putBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return new PagedFlux<>( + () -> putBastionShareableLinkSinglePageAsync(resourceGroupName, bastionHostname, bslRequest, context), + nextLink -> putBastionShareableLinkNextSinglePageAsync(nextLink, context)); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return new PagedIterable<>(putBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest)); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return new PagedIterable<>( + putBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest, context)); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> deleteBastionShareableLinkWithResponseAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (bslRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter bslRequest is required and cannot be null.")); + } else { + bslRequest.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> deleteBastionShareableLinkWithResponseAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (bslRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter bslRequest is required and cannot be null.")); + } else { + bslRequest.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + Mono>> mono = + deleteBastionShareableLinkWithResponseAsync(resourceGroupName, bastionHostname, bslRequest); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteBastionShareableLinkWithResponseAsync(resourceGroupName, bastionHostname, bslRequest, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return beginDeleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest).getSyncPoller(); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return beginDeleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest, context) + .getSyncPoller(); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deleteBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return beginDeleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deleteBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return beginDeleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + deleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest).block(); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + deleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest, context).block(); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBastionShareableLinkSinglePageAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (bslRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter bslRequest is required and cannot be null.")); + } else { + bslRequest.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + 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())); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBastionShareableLinkSinglePageAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (bslRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter bslRequest is required and cannot be null.")); + } else { + bslRequest.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return new PagedFlux<>( + () -> getBastionShareableLinkSinglePageAsync(resourceGroupName, bastionHostname, bslRequest), + nextLink -> getBastionShareableLinkNextSinglePageAsync(nextLink)); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return new PagedFlux<>( + () -> getBastionShareableLinkSinglePageAsync(resourceGroupName, bastionHostname, bslRequest, context), + nextLink -> getBastionShareableLinkNextSinglePageAsync(nextLink, context)); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return new PagedIterable<>(getBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest)); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return new PagedIterable<>( + getBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest, context)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getActiveSessionsSinglePageAsync( + String resourceGroupName, String bastionHostname) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> { + Mono>> mono = + service + .getActiveSessions( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BastionActiveSessionListResult.class, + BastionActiveSessionListResult.class, + Context.NONE) + .last() + .flatMap(this.client::getLroFinalResultOrError)); + }) + .>map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getActiveSessionsSinglePageAsync( + String resourceGroupName, String bastionHostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + Mono>> mono = + service + .getActiveSessions( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BastionActiveSessionListResult.class, + BastionActiveSessionListResult.class, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getActiveSessionsAsync( + String resourceGroupName, String bastionHostname) { + return new PagedFlux<>( + () -> getActiveSessionsSinglePageAsync(resourceGroupName, bastionHostname), + nextLink -> getActiveSessionsNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getActiveSessionsAsync( + String resourceGroupName, String bastionHostname, Context context) { + return new PagedFlux<>( + () -> getActiveSessionsSinglePageAsync(resourceGroupName, bastionHostname, context), + nextLink -> getActiveSessionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname) { + return new PagedIterable<>(getActiveSessionsAsync(resourceGroupName, bastionHostname)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname, Context context) { + return new PagedIterable<>(getActiveSessionsAsync(resourceGroupName, bastionHostname, context)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disconnectActiveSessionsSinglePageAsync( + String resourceGroupName, String bastionHostname, SessionIds sessionIds) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (sessionIds == null) { + return Mono.error(new IllegalArgumentException("Parameter sessionIds is required and cannot be null.")); + } else { + sessionIds.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disconnectActiveSessions( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + sessionIds, + 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())); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disconnectActiveSessionsSinglePageAsync( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (sessionIds == null) { + return Mono.error(new IllegalArgumentException("Parameter sessionIds is required and cannot be null.")); + } else { + sessionIds.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disconnectActiveSessions( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + sessionIds, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux disconnectActiveSessionsAsync( + String resourceGroupName, String bastionHostname, SessionIds sessionIds) { + return new PagedFlux<>( + () -> disconnectActiveSessionsSinglePageAsync(resourceGroupName, bastionHostname, sessionIds), + nextLink -> disconnectActiveSessionsNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux disconnectActiveSessionsAsync( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context) { + return new PagedFlux<>( + () -> disconnectActiveSessionsSinglePageAsync(resourceGroupName, bastionHostname, sessionIds, context), + nextLink -> disconnectActiveSessionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds) { + return new PagedIterable<>(disconnectActiveSessionsAsync(resourceGroupName, bastionHostname, sessionIds)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context) { + return new PagedIterable<>( + disconnectActiveSessionsAsync(resourceGroupName, bastionHostname, sessionIds, context)); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkDnsNameAvailabilityWithResponseAsync( + String location, String domainNameLabel) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (domainNameLabel == null) { + return Mono + .error(new IllegalArgumentException("Parameter domainNameLabel is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkDnsNameAvailability( + this.client.getEndpoint(), + location, + domainNameLabel, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkDnsNameAvailabilityWithResponseAsync( + String location, String domainNameLabel, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (domainNameLabel == null) { + return Mono + .error(new IllegalArgumentException("Parameter domainNameLabel is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkDnsNameAvailability( + this.client.getEndpoint(), + location, + domainNameLabel, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkDnsNameAvailabilityAsync( + String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithResponseAsync(location, domainNameLabel) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel) { + return checkDnsNameAvailabilityAsync(location, domainNameLabel).block(); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkDnsNameAvailabilityWithResponse( + String location, String domainNameLabel, Context context) { + return checkDnsNameAvailabilityWithResponseAsync(location, domainNameLabel, context).block(); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> supportedSecurityProvidersWithResponseAsync( + String resourceGroupName, String virtualWanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .supportedSecurityProviders( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> supportedSecurityProvidersWithResponseAsync( + String resourceGroupName, String virtualWanName, 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 (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .supportedSecurityProviders( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + accept, + context); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono supportedSecurityProvidersAsync( + String resourceGroupName, String virtualWanName) { + return supportedSecurityProvidersWithResponseAsync(resourceGroupName, virtualWanName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualWanSecurityProvidersInner supportedSecurityProviders( + String resourceGroupName, String virtualWanName) { + return supportedSecurityProvidersAsync(resourceGroupName, virtualWanName).block(); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response supportedSecurityProvidersWithResponse( + String resourceGroupName, String virtualWanName, Context context) { + return supportedSecurityProvidersWithResponseAsync(resourceGroupName, virtualWanName, context).block(); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generatevirtualwanvpnserverconfigurationvpnprofileWithResponseAsync( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + if (vpnClientParams == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnClientParams is required and cannot be null.")); + } else { + vpnClientParams.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generatevirtualwanvpnserverconfigurationvpnprofile( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + vpnClientParams, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generatevirtualwanvpnserverconfigurationvpnprofileWithResponseAsync( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + 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 (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + if (vpnClientParams == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnClientParams is required and cannot be null.")); + } else { + vpnClientParams.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generatevirtualwanvpnserverconfigurationvpnprofile( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + vpnClientParams, + accept, + context); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams) { + Mono>> mono = + generatevirtualwanvpnserverconfigurationvpnprofileWithResponseAsync( + resourceGroupName, virtualWanName, vpnClientParams); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnProfileResponseInner.class, + VpnProfileResponseInner.class, + Context.NONE); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + generatevirtualwanvpnserverconfigurationvpnprofileWithResponseAsync( + resourceGroupName, virtualWanName, vpnClientParams, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnProfileResponseInner.class, + VpnProfileResponseInner.class, + context); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams) { + return beginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync( + resourceGroupName, virtualWanName, vpnClientParams) + .getSyncPoller(); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context) { + return beginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync( + resourceGroupName, virtualWanName, vpnClientParams, context) + .getSyncPoller(); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generatevirtualwanvpnserverconfigurationvpnprofileAsync( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams) { + return beginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync( + resourceGroupName, virtualWanName, vpnClientParams) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generatevirtualwanvpnserverconfigurationvpnprofileAsync( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context) { + return beginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync( + resourceGroupName, virtualWanName, vpnClientParams, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnProfileResponseInner generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams) { + return generatevirtualwanvpnserverconfigurationvpnprofileAsync( + resourceGroupName, virtualWanName, vpnClientParams) + .block(); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnProfileResponseInner generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context) { + return generatevirtualwanvpnserverconfigurationvpnprofileAsync( + resourceGroupName, virtualWanName, vpnClientParams, 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 response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putBastionShareableLinkNextSinglePageAsync(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.putBastionShareableLinkNext(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 response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putBastionShareableLinkNextSinglePageAsync( + 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 + .putBastionShareableLinkNext(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 response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBastionShareableLinkNextSinglePageAsync(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.getBastionShareableLinkNext(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 response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBastionShareableLinkNextSinglePageAsync( + 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 + .getBastionShareableLinkNext(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 response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getActiveSessionsNextSinglePageAsync(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.getActiveSessionsNext(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 response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getActiveSessionsNextSinglePageAsync( + 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 + .getActiveSessionsNext(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 response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disconnectActiveSessionsNextSinglePageAsync(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.disconnectActiveSessionsNext(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 response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disconnectActiveSessionsNextSinglePageAsync( + 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 + .disconnectActiveSessionsNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..acf3d6b529243 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersImpl.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.network.generated.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.network.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.BastionActiveSession; +import com.azure.resourcemanager.network.generated.models.BastionSessionState; +import com.azure.resourcemanager.network.generated.models.BastionShareableLink; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.DnsNameAvailabilityResult; +import com.azure.resourcemanager.network.generated.models.ResourceProviders; +import com.azure.resourcemanager.network.generated.models.SessionIds; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProviders; +import com.azure.resourcemanager.network.generated.models.VirtualWanVpnProfileParameters; +import com.azure.resourcemanager.network.generated.models.VpnProfileResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceProvidersImpl implements ResourceProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + PagedIterable inner = + this.serviceClient().putBastionShareableLink(resourceGroupName, bastionHostname, bslRequest); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + PagedIterable inner = + this.serviceClient().putBastionShareableLink(resourceGroupName, bastionHostname, bslRequest, context); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + this.serviceClient().deleteBastionShareableLink(resourceGroupName, bastionHostname, bslRequest); + } + + public void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + this.serviceClient().deleteBastionShareableLink(resourceGroupName, bastionHostname, bslRequest, context); + } + + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + PagedIterable inner = + this.serviceClient().getBastionShareableLink(resourceGroupName, bastionHostname, bslRequest); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + PagedIterable inner = + this.serviceClient().getBastionShareableLink(resourceGroupName, bastionHostname, bslRequest, context); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable getActiveSessions(String resourceGroupName, String bastionHostname) { + PagedIterable inner = + this.serviceClient().getActiveSessions(resourceGroupName, bastionHostname); + return Utils.mapPage(inner, inner1 -> new BastionActiveSessionImpl(inner1, this.manager())); + } + + public PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname, Context context) { + PagedIterable inner = + this.serviceClient().getActiveSessions(resourceGroupName, bastionHostname, context); + return Utils.mapPage(inner, inner1 -> new BastionActiveSessionImpl(inner1, this.manager())); + } + + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds) { + PagedIterable inner = + this.serviceClient().disconnectActiveSessions(resourceGroupName, bastionHostname, sessionIds); + return Utils.mapPage(inner, inner1 -> new BastionSessionStateImpl(inner1, this.manager())); + } + + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context) { + PagedIterable inner = + this.serviceClient().disconnectActiveSessions(resourceGroupName, bastionHostname, sessionIds, context); + return Utils.mapPage(inner, inner1 -> new BastionSessionStateImpl(inner1, this.manager())); + } + + public DnsNameAvailabilityResult checkDnsNameAvailability(String location, String domainNameLabel) { + DnsNameAvailabilityResultInner inner = this.serviceClient().checkDnsNameAvailability(location, domainNameLabel); + if (inner != null) { + return new DnsNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkDnsNameAvailabilityWithResponse( + String location, String domainNameLabel, Context context) { + Response inner = + this.serviceClient().checkDnsNameAvailabilityWithResponse(location, domainNameLabel, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DnsNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualWanSecurityProviders supportedSecurityProviders(String resourceGroupName, String virtualWanName) { + VirtualWanSecurityProvidersInner inner = + this.serviceClient().supportedSecurityProviders(resourceGroupName, virtualWanName); + if (inner != null) { + return new VirtualWanSecurityProvidersImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response supportedSecurityProvidersWithResponse( + String resourceGroupName, String virtualWanName, Context context) { + Response inner = + this.serviceClient().supportedSecurityProvidersWithResponse(resourceGroupName, virtualWanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualWanSecurityProvidersImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VpnProfileResponse generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams) { + VpnProfileResponseInner inner = + this + .serviceClient() + .generatevirtualwanvpnserverconfigurationvpnprofile(resourceGroupName, virtualWanName, vpnClientParams); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnProfileResponse generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context) { + VpnProfileResponseInner inner = + this + .serviceClient() + .generatevirtualwanvpnserverconfigurationvpnprofile( + resourceGroupName, virtualWanName, vpnClientParams, context); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterImpl.java new file mode 100644 index 0000000000000..76ecfe2e7b741 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterImpl.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeering; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteFilter; +import com.azure.resourcemanager.network.generated.models.RouteFilterRule; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RouteFilterImpl implements RouteFilter, RouteFilter.Definition, RouteFilter.Update { + private RouteFilterInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public List rules() { + List inner = this.innerModel().rules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new RouteFilterRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List peerings() { + List inner = this.innerModel().peerings(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipv6Peerings() { + List inner = this.innerModel().ipv6Peerings(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public RouteFilterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String routeFilterName; + + private TagsObject updateParameters; + + public RouteFilterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RouteFilter create() { + this.innerObject = + serviceManager + .serviceClient() + .getRouteFilters() + .createOrUpdate(resourceGroupName, routeFilterName, this.innerModel(), Context.NONE); + return this; + } + + public RouteFilter create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRouteFilters() + .createOrUpdate(resourceGroupName, routeFilterName, this.innerModel(), context); + return this; + } + + RouteFilterImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new RouteFilterInner(); + this.serviceManager = serviceManager; + this.routeFilterName = name; + } + + public RouteFilterImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public RouteFilter apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRouteFilters() + .updateTagsWithResponse(resourceGroupName, routeFilterName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public RouteFilter apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRouteFilters() + .updateTagsWithResponse(resourceGroupName, routeFilterName, updateParameters, context) + .getValue(); + return this; + } + + RouteFilterImpl( + RouteFilterInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeFilterName = Utils.getValueFromIdByName(innerObject.id(), "routeFilters"); + } + + public RouteFilter refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRouteFilters() + .getByResourceGroupWithResponse(resourceGroupName, routeFilterName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public RouteFilter refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRouteFilters() + .getByResourceGroupWithResponse(resourceGroupName, routeFilterName, localExpand, context) + .getValue(); + return this; + } + + public RouteFilterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RouteFilterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RouteFilterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public RouteFilterImpl withRules(List rules) { + this.innerModel().withRules(rules); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRuleImpl.java new file mode 100644 index 0000000000000..470c023862a7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRuleImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteFilterRule; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import java.util.Collections; +import java.util.List; + +public final class RouteFilterRuleImpl implements RouteFilterRule { + private RouteFilterRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + RouteFilterRuleImpl( + RouteFilterRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String location() { + return this.innerModel().location(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Access access() { + return this.innerModel().access(); + } + + public RouteFilterRuleType routeFilterRuleType() { + return this.innerModel().routeFilterRuleType(); + } + + public List communities() { + List inner = this.innerModel().communities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public RouteFilterRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesClientImpl.java new file mode 100644 index 0000000000000..dfe5c7ac1ab00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesClientImpl.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.network.generated.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.network.generated.fluent.RouteFilterRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleListResult; +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 RouteFilterRulesClient. */ +public final class RouteFilterRulesClientImpl implements RouteFilterRulesClient { + private final ClientLogger logger = new ClientLogger(RouteFilterRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RouteFilterRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFilterRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RouteFilterRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(RouteFilterRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRouteFilterRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface RouteFilterRulesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RouteFilterRuleInner routeFilterRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}/routeFilterRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRouteFilter( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRouteFilterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + ruleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + ruleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, String ruleName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeFilterName, ruleName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, String ruleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, routeFilterName, ruleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, String ruleName) { + return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName).getSyncPoller(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, String ruleName, Context context) { + return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName, context).getSyncPoller(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, String ruleName) { + return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, String ruleName, Context context) { + return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeFilterName, String ruleName) { + deleteAsync(resourceGroupName, routeFilterName, ruleName).block(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeFilterName, String ruleName, Context context) { + deleteAsync(resourceGroupName, routeFilterName, ruleName, context).block(); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String routeFilterName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + ruleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String routeFilterName, String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + ruleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithResponseAsync(resourceGroupName, routeFilterName, ruleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName) { + return getAsync(resourceGroupName, routeFilterName, ruleName).block(); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String routeFilterName, String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, routeFilterName, ruleName, context).block(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (routeFilterRuleParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter routeFilterRuleParameters is required and cannot be null.")); + } else { + routeFilterRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + ruleName, + apiVersion, + this.client.getSubscriptionId(), + routeFilterRuleParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (routeFilterRuleParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter routeFilterRuleParameters is required and cannot be null.")); + } else { + routeFilterRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + ruleName, + apiVersion, + this.client.getSubscriptionId(), + routeFilterRuleParameters, + accept, + context); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RouteFilterRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RouteFilterRuleInner.class, + RouteFilterRuleInner.class, + Context.NONE); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RouteFilterRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteFilterRuleInner.class, RouteFilterRuleInner.class, context); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterRuleInner createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters) { + return createOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).block(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterRuleInner createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context) + .block(); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRouteFilterSinglePageAsync( + String resourceGroupName, String routeFilterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByRouteFilter( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRouteFilterSinglePageAsync( + String resourceGroupName, String routeFilterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByRouteFilter( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRouteFilterAsync(String resourceGroupName, String routeFilterName) { + return new PagedFlux<>( + () -> listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName), + nextLink -> listByRouteFilterNextSinglePageAsync(nextLink)); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRouteFilterAsync( + String resourceGroupName, String routeFilterName, Context context) { + return new PagedFlux<>( + () -> listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName, context), + nextLink -> listByRouteFilterNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName) { + return new PagedIterable<>(listByRouteFilterAsync(resourceGroupName, routeFilterName)); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRouteFilter( + String resourceGroupName, String routeFilterName, Context context) { + return new PagedIterable<>(listByRouteFilterAsync(resourceGroupName, routeFilterName, 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 response for the ListRouteFilterRules API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRouteFilterNextSinglePageAsync(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.listByRouteFilterNext(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 response for the ListRouteFilterRules API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRouteFilterNextSinglePageAsync( + 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 + .listByRouteFilterNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesImpl.java new file mode 100644 index 0000000000000..2c64f292da5a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesImpl.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.network.generated.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.network.generated.fluent.RouteFilterRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.RouteFilterRule; +import com.azure.resourcemanager.network.generated.models.RouteFilterRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RouteFilterRulesImpl implements RouteFilterRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRulesImpl.class); + + private final RouteFilterRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RouteFilterRulesImpl( + RouteFilterRulesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String routeFilterName, String ruleName) { + this.serviceClient().delete(resourceGroupName, routeFilterName, ruleName); + } + + public void delete(String resourceGroupName, String routeFilterName, String ruleName, Context context) { + this.serviceClient().delete(resourceGroupName, routeFilterName, ruleName, context); + } + + public RouteFilterRule get(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRuleInner inner = this.serviceClient().get(resourceGroupName, routeFilterName, ruleName); + if (inner != null) { + return new RouteFilterRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String routeFilterName, String ruleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, routeFilterName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RouteFilterRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RouteFilterRule createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters) { + RouteFilterRuleInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters); + if (inner != null) { + return new RouteFilterRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public RouteFilterRule createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context) { + RouteFilterRuleInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context); + if (inner != null) { + return new RouteFilterRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName) { + PagedIterable inner = + this.serviceClient().listByRouteFilter(resourceGroupName, routeFilterName); + return Utils.mapPage(inner, inner1 -> new RouteFilterRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByRouteFilter( + String resourceGroupName, String routeFilterName, Context context) { + PagedIterable inner = + this.serviceClient().listByRouteFilter(resourceGroupName, routeFilterName, context); + return Utils.mapPage(inner, inner1 -> new RouteFilterRuleImpl(inner1, this.manager())); + } + + private RouteFilterRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java new file mode 100644 index 0000000000000..9efbb7a37349f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java @@ -0,0 +1,1479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.RouteFiltersClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.models.RouteFilterListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 RouteFiltersClient. */ +public final class RouteFiltersClientImpl implements RouteFiltersClient { + private final ClientLogger logger = new ClientLogger(RouteFiltersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RouteFiltersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFiltersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RouteFiltersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(RouteFiltersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRouteFilters to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface RouteFiltersService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RouteFilterInner routeFilterParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeFilterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeFilterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName) { + return beginDeleteAsync(resourceGroupName, routeFilterName).getSyncPoller(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, Context context) { + return beginDeleteAsync(resourceGroupName, routeFilterName, context).getSyncPoller(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName) { + return beginDeleteAsync(resourceGroupName, routeFilterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeFilterName, Context context) { + return beginDeleteAsync(resourceGroupName, routeFilterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeFilterName) { + deleteAsync(resourceGroupName, routeFilterName).block(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeFilterName, Context context) { + deleteAsync(resourceGroupName, routeFilterName, context).block(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String routeFilterName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String routeFilterName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routeFilterName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String routeFilterName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, routeFilterName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, routeFilterName, expand).block(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String routeFilterName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routeFilterName, expand, context).block(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (routeFilterParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null.")); + } else { + routeFilterParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + routeFilterParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (routeFilterParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null.")); + } else { + routeFilterParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + routeFilterParameters, + accept, + context); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RouteFilterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteFilterInner.class, RouteFilterInner.class, Context.NONE); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RouteFilterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteFilterInner.class, RouteFilterInner.class, context); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RouteFilterInner> beginCreateOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).getSyncPoller(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RouteFilterInner> beginCreateOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterInner createOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return createOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).block(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterInner createOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context).block(); + } + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String routeFilterName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String routeFilterName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeFilterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String routeFilterName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, routeFilterName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterInner updateTags(String resourceGroupName, String routeFilterName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, routeFilterName, parameters).block(); + } + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String routeFilterName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, routeFilterName, parameters, context).block(); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all route filters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all route filters 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 all route filters in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all route filters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all route filters 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 all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all route filters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all route filters 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 all route filters in a subscription. + */ + @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 response for the ListRouteFilters API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for the ListRouteFilters API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 response for the ListRouteFilters API service call. + */ + @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 response for the ListRouteFilters API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersImpl.java new file mode 100644 index 0000000000000..3e33310d0f075 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersImpl.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.network.generated.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.network.generated.fluent.RouteFiltersClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.models.RouteFilter; +import com.azure.resourcemanager.network.generated.models.RouteFilters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RouteFiltersImpl implements RouteFilters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFiltersImpl.class); + + private final RouteFiltersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RouteFiltersImpl( + RouteFiltersClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String routeFilterName) { + this.serviceClient().delete(resourceGroupName, routeFilterName); + } + + public void delete(String resourceGroupName, String routeFilterName, Context context) { + this.serviceClient().delete(resourceGroupName, routeFilterName, context); + } + + public RouteFilter getByResourceGroup(String resourceGroupName, String routeFilterName) { + RouteFilterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, routeFilterName); + if (inner != null) { + return new RouteFilterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String routeFilterName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, routeFilterName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RouteFilterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public RouteFilter 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 routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, routeFilterName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, routeFilterName, expand, 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 routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + this.delete(resourceGroupName, routeFilterName, 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 routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + this.delete(resourceGroupName, routeFilterName, context); + } + + private RouteFiltersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteFilterImpl define(String name) { + return new RouteFilterImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java new file mode 100644 index 0000000000000..83ab1d9e50d90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Route; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; + +public final class RouteImpl implements Route, Route.Definition, Route.Update { + private RouteInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public RouteNextHopType nextHopType() { + return this.innerModel().nextHopType(); + } + + public String nextHopIpAddress() { + return this.innerModel().nextHopIpAddress(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean hasBgpOverride() { + return this.innerModel().hasBgpOverride(); + } + + public RouteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String routeTableName; + + private String routeName; + + public RouteImpl withExistingRouteTable(String resourceGroupName, String routeTableName) { + this.resourceGroupName = resourceGroupName; + this.routeTableName = routeTableName; + return this; + } + + public Route create() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .createOrUpdate(resourceGroupName, routeTableName, routeName, this.innerModel(), Context.NONE); + return this; + } + + public Route create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .createOrUpdate(resourceGroupName, routeTableName, routeName, this.innerModel(), context); + return this; + } + + RouteImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new RouteInner(); + this.serviceManager = serviceManager; + this.routeName = name; + } + + public RouteImpl update() { + return this; + } + + public Route apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .createOrUpdate(resourceGroupName, routeTableName, routeName, this.innerModel(), Context.NONE); + return this; + } + + public Route apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .createOrUpdate(resourceGroupName, routeTableName, routeName, this.innerModel(), context); + return this; + } + + RouteImpl(RouteInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeTableName = Utils.getValueFromIdByName(innerObject.id(), "routeTables"); + this.routeName = Utils.getValueFromIdByName(innerObject.id(), "routes"); + } + + public Route refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, routeTableName, routeName, Context.NONE) + .getValue(); + return this; + } + + public Route refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, routeTableName, routeName, context) + .getValue(); + return this; + } + + public RouteImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public RouteImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public RouteImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public RouteImpl withNextHopType(RouteNextHopType nextHopType) { + this.innerModel().withNextHopType(nextHopType); + return this; + } + + public RouteImpl withNextHopIpAddress(String nextHopIpAddress) { + this.innerModel().withNextHopIpAddress(nextHopIpAddress); + return this; + } + + public RouteImpl withHasBgpOverride(Boolean hasBgpOverride) { + this.innerModel().withHasBgpOverride(hasBgpOverride); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTableImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTableImpl.java new file mode 100644 index 0000000000000..4368d796f2c25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTableImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Route; +import com.azure.resourcemanager.network.generated.models.RouteTable; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RouteTableImpl implements RouteTable, RouteTable.Definition, RouteTable.Update { + private RouteTableInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public List routes() { + List inner = this.innerModel().routes(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new RouteImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List subnets() { + List inner = this.innerModel().subnets(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new SubnetImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Boolean disableBgpRoutePropagation() { + return this.innerModel().disableBgpRoutePropagation(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public RouteTableInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String routeTableName; + + private TagsObject updateParameters; + + public RouteTableImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RouteTable create() { + this.innerObject = + serviceManager + .serviceClient() + .getRouteTables() + .createOrUpdate(resourceGroupName, routeTableName, this.innerModel(), Context.NONE); + return this; + } + + public RouteTable create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRouteTables() + .createOrUpdate(resourceGroupName, routeTableName, this.innerModel(), context); + return this; + } + + RouteTableImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new RouteTableInner(); + this.serviceManager = serviceManager; + this.routeTableName = name; + } + + public RouteTableImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public RouteTable apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRouteTables() + .updateTagsWithResponse(resourceGroupName, routeTableName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public RouteTable apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRouteTables() + .updateTagsWithResponse(resourceGroupName, routeTableName, updateParameters, context) + .getValue(); + return this; + } + + RouteTableImpl( + RouteTableInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeTableName = Utils.getValueFromIdByName(innerObject.id(), "routeTables"); + } + + public RouteTable refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRouteTables() + .getByResourceGroupWithResponse(resourceGroupName, routeTableName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public RouteTable refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRouteTables() + .getByResourceGroupWithResponse(resourceGroupName, routeTableName, localExpand, context) + .getValue(); + return this; + } + + public RouteTableImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RouteTableImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RouteTableImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public RouteTableImpl withRoutes(List routes) { + this.innerModel().withRoutes(routes); + return this; + } + + public RouteTableImpl withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.innerModel().withDisableBgpRoutePropagation(disableBgpRoutePropagation); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesClientImpl.java new file mode 100644 index 0000000000000..33321c94b0a49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesClientImpl.java @@ -0,0 +1,1464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.RouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.models.RouteTableListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 RouteTablesClient. */ +public final class RouteTablesClientImpl implements RouteTablesClient { + private final ClientLogger logger = new ClientLogger(RouteTablesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RouteTablesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteTablesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RouteTablesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(RouteTablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRouteTables to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface RouteTablesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RouteTableInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeTables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{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> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeTableName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeTableName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName) { + return beginDeleteAsync(resourceGroupName, routeTableName).getSyncPoller(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, Context context) { + return beginDeleteAsync(resourceGroupName, routeTableName, context).getSyncPoller(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName) { + return beginDeleteAsync(resourceGroupName, routeTableName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, Context context) { + return beginDeleteAsync(resourceGroupName, routeTableName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeTableName) { + deleteAsync(resourceGroupName, routeTableName).block(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeTableName, Context context) { + deleteAsync(resourceGroupName, routeTableName, context).block(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String routeTableName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String routeTableName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routeTableName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String routeTableName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, routeTableName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, routeTableName, expand).block(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String routeTableName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routeTableName, expand, context).block(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String routeTableName, RouteTableInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RouteTableInner> beginCreateOrUpdateAsync( + String resourceGroupName, String routeTableName, RouteTableInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, routeTableName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteTableInner.class, RouteTableInner.class, Context.NONE); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RouteTableInner> beginCreateOrUpdateAsync( + String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, routeTableName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteTableInner.class, RouteTableInner.class, context); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RouteTableInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters).getSyncPoller(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RouteTableInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters, context).getSyncPoller(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteTableInner createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateAsync(resourceGroupName, routeTableName, parameters).block(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteTableInner createOrUpdate( + String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, routeTableName, parameters, context).block(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String routeTableName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String routeTableName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String routeTableName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, routeTableName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteTableInner updateTags(String resourceGroupName, String routeTableName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, routeTableName, parameters).block(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String routeTableName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, routeTableName, parameters, context).block(); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all route tables in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all route tables 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 all route tables in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all route tables in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all route tables 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 all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all route tables in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all route tables 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 all route tables in a subscription. + */ + @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 response for the ListRouteTable API service call. + */ + @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 response for the ListRouteTable API service call. + */ + @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 response for the ListRouteTable API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for the ListRouteTable API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesImpl.java new file mode 100644 index 0000000000000..43d8d1bfb515b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesImpl.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.network.generated.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.network.generated.fluent.RouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.models.RouteTable; +import com.azure.resourcemanager.network.generated.models.RouteTables; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RouteTablesImpl implements RouteTables { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTablesImpl.class); + + private final RouteTablesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RouteTablesImpl( + RouteTablesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String routeTableName) { + this.serviceClient().delete(resourceGroupName, routeTableName); + } + + public void delete(String resourceGroupName, String routeTableName, Context context) { + this.serviceClient().delete(resourceGroupName, routeTableName, context); + } + + public RouteTable getByResourceGroup(String resourceGroupName, String routeTableName) { + RouteTableInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, routeTableName); + if (inner != null) { + return new RouteTableImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String routeTableName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, routeTableName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RouteTableImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public RouteTable 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 routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, routeTableName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, routeTableName, expand, 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 routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + this.delete(resourceGroupName, routeTableName, 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 routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + this.delete(resourceGroupName, routeTableName, context); + } + + private RouteTablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteTableImpl define(String name) { + return new RouteTableImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java new file mode 100644 index 0000000000000..aaff22c44ab7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java @@ -0,0 +1,1115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.RoutesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.models.RouteListResult; +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 RoutesClient. */ +public final class RoutesClientImpl implements RoutesClient { + private final ClientLogger logger = new ClientLogger(RoutesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RoutesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RoutesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoutesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(RoutesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRoutes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface RoutesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}/routes/{routeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @PathParam("routeName") String routeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}/routes/{routeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @PathParam("routeName") String routeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}/routes/{routeName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @PathParam("routeName") String routeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RouteInner routeParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}/routes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, String routeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + routeName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, String routeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + routeName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, String routeName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, routeTableName, routeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, String routeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, routeTableName, routeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, String routeName) { + return beginDeleteAsync(resourceGroupName, routeTableName, routeName).getSyncPoller(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, String routeName, Context context) { + return beginDeleteAsync(resourceGroupName, routeTableName, routeName, context).getSyncPoller(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, String routeName) { + return beginDeleteAsync(resourceGroupName, routeTableName, routeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 routeTableName, String routeName, Context context) { + return beginDeleteAsync(resourceGroupName, routeTableName, routeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeTableName, String routeName) { + deleteAsync(resourceGroupName, routeTableName, routeName).block(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeTableName, String routeName, Context context) { + deleteAsync(resourceGroupName, routeTableName, routeName, context).block(); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String routeTableName, String routeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + routeName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String routeTableName, String routeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + routeName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String routeTableName, String routeName) { + return getWithResponseAsync(resourceGroupName, routeTableName, routeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner get(String resourceGroupName, String routeTableName, String routeName) { + return getAsync(resourceGroupName, routeTableName, routeName).block(); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String routeTableName, String routeName, Context context) { + return getWithResponseAsync(resourceGroupName, routeTableName, routeName, context).block(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (routeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeParameters is required and cannot be null.")); + } else { + routeParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + routeName, + apiVersion, + this.client.getSubscriptionId(), + routeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String routeTableName, + String routeName, + RouteInner routeParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (routeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeParameters is required and cannot be null.")); + } else { + routeParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + routeName, + apiVersion, + this.client.getSubscriptionId(), + routeParameters, + accept, + context); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RouteInner> beginCreateOrUpdateAsync( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteInner.class, RouteInner.class, Context.NONE); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RouteInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String routeTableName, + String routeName, + RouteInner routeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteInner.class, RouteInner.class, context); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RouteInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).getSyncPoller(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RouteInner> beginCreateOrUpdate( + String resourceGroupName, + String routeTableName, + String routeName, + RouteInner routeParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String routeTableName, + String routeName, + RouteInner routeParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner createOrUpdate( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).block(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner createOrUpdate( + String resourceGroupName, + String routeTableName, + String routeName, + RouteInner routeParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters, context).block(); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String routeTableName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String routeTableName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String routeTableName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, routeTableName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String routeTableName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, routeTableName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String routeTableName) { + return new PagedIterable<>(listAsync(resourceGroupName, routeTableName)); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String routeTableName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, routeTableName, 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 response for the ListRoute API service call. + */ + @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 response for the ListRoute API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesImpl.java new file mode 100644 index 0000000000000..d591d6895b742 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.RoutesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.models.Route; +import com.azure.resourcemanager.network.generated.models.Routes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RoutesImpl implements Routes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutesImpl.class); + + private final RoutesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RoutesImpl( + RoutesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String routeTableName, String routeName) { + this.serviceClient().delete(resourceGroupName, routeTableName, routeName); + } + + public void delete(String resourceGroupName, String routeTableName, String routeName, Context context) { + this.serviceClient().delete(resourceGroupName, routeTableName, routeName, context); + } + + public Route get(String resourceGroupName, String routeTableName, String routeName) { + RouteInner inner = this.serviceClient().get(resourceGroupName, routeTableName, routeName); + if (inner != null) { + return new RouteImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String routeTableName, String routeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, routeTableName, routeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RouteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String routeTableName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, routeTableName); + return Utils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String routeTableName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, routeTableName, context); + return Utils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public Route 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 routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + return this.getWithResponse(resourceGroupName, routeTableName, routeName, 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 routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + return this.getWithResponse(resourceGroupName, routeTableName, routeName, 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 routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + this.delete(resourceGroupName, routeTableName, routeName, 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 routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + this.delete(resourceGroupName, routeTableName, routeName, context); + } + + private RoutesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteImpl define(String name) { + return new RouteImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityGroupViewResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityGroupViewResultImpl.java new file mode 100644 index 0000000000000..19f94157c86a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityGroupViewResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import com.azure.resourcemanager.network.generated.models.SecurityGroupNetworkInterface; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewResult; +import java.util.Collections; +import java.util.List; + +public final class SecurityGroupViewResultImpl implements SecurityGroupViewResult { + private SecurityGroupViewResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + SecurityGroupViewResultImpl( + SecurityGroupViewResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List networkInterfaces() { + List inner = this.innerModel().networkInterfaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SecurityGroupViewResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProviderImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProviderImpl.java new file mode 100644 index 0000000000000..c514ffa914f3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProviderImpl.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.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProvider; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviderConnectionStatus; +import com.azure.resourcemanager.network.generated.models.SecurityProviderName; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class SecurityPartnerProviderImpl + implements SecurityPartnerProvider, SecurityPartnerProvider.Definition, SecurityPartnerProvider.Update { + private SecurityPartnerProviderInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SecurityProviderName securityProviderName() { + return this.innerModel().securityProviderName(); + } + + public SecurityPartnerProviderConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public SubResource virtualHub() { + return this.innerModel().virtualHub(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SecurityPartnerProviderInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String securityPartnerProviderName; + + private TagsObject updateParameters; + + public SecurityPartnerProviderImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SecurityPartnerProvider create() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPartnerProviders() + .createOrUpdate(resourceGroupName, securityPartnerProviderName, this.innerModel(), Context.NONE); + return this; + } + + public SecurityPartnerProvider create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPartnerProviders() + .createOrUpdate(resourceGroupName, securityPartnerProviderName, this.innerModel(), context); + return this; + } + + SecurityPartnerProviderImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new SecurityPartnerProviderInner(); + this.serviceManager = serviceManager; + this.securityPartnerProviderName = name; + } + + public SecurityPartnerProviderImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public SecurityPartnerProvider apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPartnerProviders() + .updateTagsWithResponse(resourceGroupName, securityPartnerProviderName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public SecurityPartnerProvider apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPartnerProviders() + .updateTagsWithResponse(resourceGroupName, securityPartnerProviderName, updateParameters, context) + .getValue(); + return this; + } + + SecurityPartnerProviderImpl( + SecurityPartnerProviderInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.securityPartnerProviderName = Utils.getValueFromIdByName(innerObject.id(), "securityPartnerProviders"); + } + + public SecurityPartnerProvider refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPartnerProviders() + .getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, Context.NONE) + .getValue(); + return this; + } + + public SecurityPartnerProvider refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPartnerProviders() + .getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, context) + .getValue(); + return this; + } + + public SecurityPartnerProviderImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SecurityPartnerProviderImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SecurityPartnerProviderImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SecurityPartnerProviderImpl withSecurityProviderName(SecurityProviderName securityProviderName) { + this.innerModel().withSecurityProviderName(securityProviderName); + return this; + } + + public SecurityPartnerProviderImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersClientImpl.java new file mode 100644 index 0000000000000..68aa648d841ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersClientImpl.java @@ -0,0 +1,1494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.SecurityPartnerProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviderListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 SecurityPartnerProvidersClient. */ +public final class SecurityPartnerProvidersClientImpl implements SecurityPartnerProvidersClient { + private final ClientLogger logger = new ClientLogger(SecurityPartnerProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SecurityPartnerProvidersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityPartnerProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityPartnerProvidersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(SecurityPartnerProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSecurityPartnerProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface SecurityPartnerProvidersService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders/{securityPartnerProviderName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityPartnerProviderName") String securityPartnerProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders/{securityPartnerProviderName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityPartnerProviderName") String securityPartnerProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders/{securityPartnerProviderName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityPartnerProviderName") String securityPartnerProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecurityPartnerProviderInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders/{securityPartnerProviderName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityPartnerProviderName") String securityPartnerProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPartnerProviderName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityPartnerProviderName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPartnerProviderName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + securityPartnerProviderName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String securityPartnerProviderName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityPartnerProviderName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPartnerProviderName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + securityPartnerProviderName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPartnerProviderName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, securityPartnerProviderName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String securityPartnerProviderName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, securityPartnerProviderName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPartnerProviderName) { + return beginDeleteAsync(resourceGroupName, securityPartnerProviderName).getSyncPoller(); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String securityPartnerProviderName, Context context) { + return beginDeleteAsync(resourceGroupName, securityPartnerProviderName, context).getSyncPoller(); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPartnerProviderName) { + return beginDeleteAsync(resourceGroupName, securityPartnerProviderName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String securityPartnerProviderName, Context context) { + return beginDeleteAsync(resourceGroupName, securityPartnerProviderName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 securityPartnerProviderName) { + deleteAsync(resourceGroupName, securityPartnerProviderName).block(); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String securityPartnerProviderName, Context context) { + deleteAsync(resourceGroupName, securityPartnerProviderName, context).block(); + } + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String securityPartnerProviderName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityPartnerProviderName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPartnerProviderName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + securityPartnerProviderName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String securityPartnerProviderName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityPartnerProviderName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPartnerProviderName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + securityPartnerProviderName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String securityPartnerProviderName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, securityPartnerProviderName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPartnerProviderInner getByResourceGroup( + String resourceGroupName, String securityPartnerProviderName) { + return getByResourceGroupAsync(resourceGroupName, securityPartnerProviderName).block(); + } + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String securityPartnerProviderName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, securityPartnerProviderName, context).block(); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityPartnerProviderName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPartnerProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + securityPartnerProviderName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String securityPartnerProviderName, + SecurityPartnerProviderInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityPartnerProviderName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPartnerProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + securityPartnerProviderName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SecurityPartnerProviderInner> beginCreateOrUpdateAsync( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, securityPartnerProviderName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SecurityPartnerProviderInner.class, + SecurityPartnerProviderInner.class, + Context.NONE); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SecurityPartnerProviderInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String securityPartnerProviderName, + SecurityPartnerProviderInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, securityPartnerProviderName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SecurityPartnerProviderInner.class, + SecurityPartnerProviderInner.class, + context); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SecurityPartnerProviderInner> beginCreateOrUpdate( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SecurityPartnerProviderInner> beginCreateOrUpdate( + String resourceGroupName, + String securityPartnerProviderName, + SecurityPartnerProviderInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String securityPartnerProviderName, + SecurityPartnerProviderInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPartnerProviderInner createOrUpdate( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters) { + return createOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters).block(); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPartnerProviderInner createOrUpdate( + String resourceGroupName, + String securityPartnerProviderName, + SecurityPartnerProviderInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters, context).block(); + } + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityPartnerProviderName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPartnerProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + securityPartnerProviderName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (securityPartnerProviderName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPartnerProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + securityPartnerProviderName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, securityPartnerProviderName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPartnerProviderInner updateTags( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, securityPartnerProviderName, parameters).block(); + } + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, securityPartnerProviderName, parameters, context).block(); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Security Partner Providers 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 all the Security Partner Providers in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Security Partner Providers 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 all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Security Partner Providers 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 all the Security Partner Providers in a subscription. + */ + @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 response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 response for ListSecurityPartnerProviders API service call. + */ + @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 response for ListSecurityPartnerProviders API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersImpl.java new file mode 100644 index 0000000000000..139ec62c57276 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.SecurityPartnerProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProvider; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviders; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SecurityPartnerProvidersImpl implements SecurityPartnerProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPartnerProvidersImpl.class); + + private final SecurityPartnerProvidersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SecurityPartnerProvidersImpl( + SecurityPartnerProvidersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String securityPartnerProviderName) { + this.serviceClient().delete(resourceGroupName, securityPartnerProviderName); + } + + public void delete(String resourceGroupName, String securityPartnerProviderName, Context context) { + this.serviceClient().delete(resourceGroupName, securityPartnerProviderName, context); + } + + public SecurityPartnerProvider getByResourceGroup(String resourceGroupName, String securityPartnerProviderName) { + SecurityPartnerProviderInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, securityPartnerProviderName); + if (inner != null) { + return new SecurityPartnerProviderImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String securityPartnerProviderName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecurityPartnerProviderImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public SecurityPartnerProvider 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 securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, 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 securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, 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 securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + this.delete(resourceGroupName, securityPartnerProviderName, 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 securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + this.delete(resourceGroupName, securityPartnerProviderName, context); + } + + private SecurityPartnerProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityPartnerProviderImpl define(String name) { + return new SecurityPartnerProviderImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java new file mode 100644 index 0000000000000..5d6a750bd9a34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityRule; +import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SecurityRuleImpl implements SecurityRule, SecurityRule.Definition, SecurityRule.Update { + private SecurityRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public SecurityRuleProtocol protocol() { + return this.innerModel().protocol(); + } + + public String sourcePortRange() { + return this.innerModel().sourcePortRange(); + } + + public String destinationPortRange() { + return this.innerModel().destinationPortRange(); + } + + public String sourceAddressPrefix() { + return this.innerModel().sourceAddressPrefix(); + } + + public List sourceAddressPrefixes() { + List inner = this.innerModel().sourceAddressPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List sourceApplicationSecurityGroups() { + List inner = this.innerModel().sourceApplicationSecurityGroups(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String destinationAddressPrefix() { + return this.innerModel().destinationAddressPrefix(); + } + + public List destinationAddressPrefixes() { + List inner = this.innerModel().destinationAddressPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationApplicationSecurityGroups() { + List inner = this.innerModel().destinationApplicationSecurityGroups(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List sourcePortRanges() { + List inner = this.innerModel().sourcePortRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationPortRanges() { + List inner = this.innerModel().destinationPortRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SecurityRuleAccess access() { + return this.innerModel().access(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public SecurityRuleDirection direction() { + return this.innerModel().direction(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SecurityRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkSecurityGroupName; + + private String securityRuleName; + + public SecurityRuleImpl withExistingNetworkSecurityGroup( + String resourceGroupName, String networkSecurityGroupName) { + this.resourceGroupName = resourceGroupName; + this.networkSecurityGroupName = networkSecurityGroupName; + return this; + } + + public SecurityRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .createOrUpdate( + resourceGroupName, networkSecurityGroupName, securityRuleName, this.innerModel(), Context.NONE); + return this; + } + + public SecurityRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .createOrUpdate( + resourceGroupName, networkSecurityGroupName, securityRuleName, this.innerModel(), context); + return this; + } + + SecurityRuleImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new SecurityRuleInner(); + this.serviceManager = serviceManager; + this.securityRuleName = name; + } + + public SecurityRuleImpl update() { + return this; + } + + public SecurityRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .createOrUpdate( + resourceGroupName, networkSecurityGroupName, securityRuleName, this.innerModel(), Context.NONE); + return this; + } + + public SecurityRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .createOrUpdate( + resourceGroupName, networkSecurityGroupName, securityRuleName, this.innerModel(), context); + return this; + } + + SecurityRuleImpl( + SecurityRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkSecurityGroupName = Utils.getValueFromIdByName(innerObject.id(), "networkSecurityGroups"); + this.securityRuleName = Utils.getValueFromIdByName(innerObject.id(), "securityRules"); + } + + public SecurityRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, Context.NONE) + .getValue(); + return this; + } + + public SecurityRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, context) + .getValue(); + return this; + } + + public SecurityRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public SecurityRuleImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public SecurityRuleImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SecurityRuleImpl withProtocol(SecurityRuleProtocol protocol) { + this.innerModel().withProtocol(protocol); + return this; + } + + public SecurityRuleImpl withSourcePortRange(String sourcePortRange) { + this.innerModel().withSourcePortRange(sourcePortRange); + return this; + } + + public SecurityRuleImpl withDestinationPortRange(String destinationPortRange) { + this.innerModel().withDestinationPortRange(destinationPortRange); + return this; + } + + public SecurityRuleImpl withSourceAddressPrefix(String sourceAddressPrefix) { + this.innerModel().withSourceAddressPrefix(sourceAddressPrefix); + return this; + } + + public SecurityRuleImpl withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.innerModel().withSourceAddressPrefixes(sourceAddressPrefixes); + return this; + } + + public SecurityRuleImpl withSourceApplicationSecurityGroups( + List sourceApplicationSecurityGroups) { + this.innerModel().withSourceApplicationSecurityGroups(sourceApplicationSecurityGroups); + return this; + } + + public SecurityRuleImpl withDestinationAddressPrefix(String destinationAddressPrefix) { + this.innerModel().withDestinationAddressPrefix(destinationAddressPrefix); + return this; + } + + public SecurityRuleImpl withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.innerModel().withDestinationAddressPrefixes(destinationAddressPrefixes); + return this; + } + + public SecurityRuleImpl withDestinationApplicationSecurityGroups( + List destinationApplicationSecurityGroups) { + this.innerModel().withDestinationApplicationSecurityGroups(destinationApplicationSecurityGroups); + return this; + } + + public SecurityRuleImpl withSourcePortRanges(List sourcePortRanges) { + this.innerModel().withSourcePortRanges(sourcePortRanges); + return this; + } + + public SecurityRuleImpl withDestinationPortRanges(List destinationPortRanges) { + this.innerModel().withDestinationPortRanges(destinationPortRanges); + return this; + } + + public SecurityRuleImpl withAccess(SecurityRuleAccess access) { + this.innerModel().withAccess(access); + return this; + } + + public SecurityRuleImpl withPriority(Integer priority) { + this.innerModel().withPriority(priority); + return this; + } + + public SecurityRuleImpl withDirection(SecurityRuleDirection direction) { + this.innerModel().withDirection(direction); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java new file mode 100644 index 0000000000000..24151c7a0c79a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java @@ -0,0 +1,1173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.SecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.SecurityRuleListResult; +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 SecurityRulesClient. */ +public final class SecurityRulesClientImpl implements SecurityRulesClient { + private final ClientLogger logger = new ClientLogger(SecurityRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SecurityRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(SecurityRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSecurityRules to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface SecurityRulesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @PathParam("securityRuleName") String securityRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @PathParam("securityRuleName") String securityRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @PathParam("securityRuleName") String securityRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecurityRuleInner securityRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkSecurityGroupName, String securityRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (securityRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkSecurityGroupName, String securityRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (securityRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkSecurityGroupName, String securityRuleName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkSecurityGroupName, String securityRuleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkSecurityGroupName, String securityRuleName) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).getSyncPoller(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkSecurityGroupName, String securityRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context).getSyncPoller(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkSecurityGroupName, String securityRuleName) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkSecurityGroupName, String securityRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkSecurityGroupName, String securityRuleName) { + deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).block(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkSecurityGroupName, String securityRuleName, Context context) { + deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context).block(); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (securityRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (securityRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityRuleName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).block(); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context).block(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (securityRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (securityRuleParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null.")); + } else { + securityRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + apiVersion, + this.client.getSubscriptionId(), + securityRuleParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null.")); + } + if (securityRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (securityRuleParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null.")); + } else { + securityRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + apiVersion, + this.client.getSubscriptionId(), + securityRuleParameters, + accept, + context); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SecurityRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SecurityRuleInner.class, SecurityRuleInner.class, Context.NONE); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SecurityRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SecurityRuleInner.class, SecurityRuleInner.class, context); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityRuleInner createOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters) { + return createOrUpdateAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) + .block(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityRuleInner createOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, context) + .block(); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkSecurityGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkSecurityGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkSecurityGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter networkSecurityGroupName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkSecurityGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName)); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName, 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 response for ListSecurityRule API service call. + */ + @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 response for ListSecurityRule API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesImpl.java new file mode 100644 index 0000000000000..cf8aea4c4cdbe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.SecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.SecurityRule; +import com.azure.resourcemanager.network.generated.models.SecurityRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SecurityRulesImpl implements SecurityRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRulesImpl.class); + + private final SecurityRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SecurityRulesImpl( + SecurityRulesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + this.serviceClient().delete(resourceGroupName, networkSecurityGroupName, securityRuleName); + } + + public void delete( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + } + + public SecurityRule get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRuleInner inner = + this.serviceClient().get(resourceGroupName, networkSecurityGroupName, securityRuleName); + if (inner != null) { + return new SecurityRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecurityRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkSecurityGroupName); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkSecurityGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public SecurityRule 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 networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, 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 networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + return this.getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, 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 networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, 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 networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + } + + private SecurityRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityRuleImpl define(String name) { + return new SecurityRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.java new file mode 100644 index 0000000000000..ae8968a51d9cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ServiceAssociationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServiceAssociationLinksClient. */ +public final class ServiceAssociationLinksClientImpl implements ServiceAssociationLinksClient { + private final ClientLogger logger = new ClientLogger(ServiceAssociationLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServiceAssociationLinksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceAssociationLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceAssociationLinksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ServiceAssociationLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientServiceAssociationLinks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ServiceAssociationLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service association links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String subnetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service association links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service association links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String virtualNetworkName, String subnetName) { + return listWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service association links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceAssociationLinksListResultInner list( + String resourceGroupName, String virtualNetworkName, String subnetName) { + return listAsync(resourceGroupName, virtualNetworkName, subnetName).block(); + } + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service association links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + return listWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksImpl.java new file mode 100644 index 0000000000000..59b83b2a37eee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ServiceAssociationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLinks; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLinksListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceAssociationLinksImpl implements ServiceAssociationLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceAssociationLinksImpl.class); + + private final ServiceAssociationLinksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ServiceAssociationLinksImpl( + ServiceAssociationLinksClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ServiceAssociationLinksListResult list( + String resourceGroupName, String virtualNetworkName, String subnetName) { + ServiceAssociationLinksListResultInner inner = + this.serviceClient().list(resourceGroupName, virtualNetworkName, subnetName); + if (inner != null) { + return new ServiceAssociationLinksListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, virtualNetworkName, subnetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceAssociationLinksListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ServiceAssociationLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksListResultImpl.java new file mode 100644 index 0000000000000..170b0a048509b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksListResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLinksListResult; +import java.util.Collections; +import java.util.List; + +public final class ServiceAssociationLinksListResultImpl implements ServiceAssociationLinksListResult { + private ServiceAssociationLinksListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ServiceAssociationLinksListResultImpl( + ServiceAssociationLinksListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ServiceAssociationLinksListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java new file mode 100644 index 0000000000000..7b0dee71893a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java @@ -0,0 +1,1524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ServiceEndpointPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 ServiceEndpointPoliciesClient. */ +public final class ServiceEndpointPoliciesClientImpl implements ServiceEndpointPoliciesClient { + private final ClientLogger logger = new ClientLogger(ServiceEndpointPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServiceEndpointPoliciesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceEndpointPoliciesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ServiceEndpointPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientServiceEndpointPolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ServiceEndpointPoliciesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ServiceEndpointPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceEndpointPolicyName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName) { + return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName).getSyncPoller(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, context).getSyncPoller(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName) { + return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceEndpointPolicyName) { + deleteAsync(resourceGroupName, serviceEndpointPolicyName).block(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceEndpointPolicyName, Context context) { + deleteAsync(resourceGroupName, serviceEndpointPolicyName, context).block(); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceEndpointPolicyName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String serviceEndpointPolicyName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String serviceEndpointPolicyName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName, expand).block(); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand, context) + .block(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + ServiceEndpointPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServiceEndpointPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServiceEndpointPolicyInner.class, + ServiceEndpointPolicyInner.class, + Context.NONE); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServiceEndpointPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + ServiceEndpointPolicyInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServiceEndpointPolicyInner.class, + ServiceEndpointPolicyInner.class, + context); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + ServiceEndpointPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + ServiceEndpointPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyInner createOrUpdate( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).block(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyInner createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + ServiceEndpointPolicyInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context).block(); + } + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyInner updateTags( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, serviceEndpointPolicyName, parameters).block(); + } + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context).block(); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the service endpoint policies 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 all the service endpoint policies in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the service endpoint policies 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 all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the service endpoint policies 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 all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for ListServiceEndpointPolicies API service call. + */ + @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 response for ListServiceEndpointPolicies API service call. + */ + @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 response for ListServiceEndpointPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for ListServiceEndpointPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesImpl.java new file mode 100644 index 0000000000000..c62f619ec2bb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesImpl.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.network.generated.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.network.generated.fluent.ServiceEndpointPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicies; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceEndpointPoliciesImpl implements ServiceEndpointPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPoliciesImpl.class); + + private final ServiceEndpointPoliciesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ServiceEndpointPoliciesImpl( + ServiceEndpointPoliciesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { + this.serviceClient().delete(resourceGroupName, serviceEndpointPolicyName); + } + + public void delete(String resourceGroupName, String serviceEndpointPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceEndpointPolicyName, context); + } + + public ServiceEndpointPolicy getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { + ServiceEndpointPolicyInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, serviceEndpointPolicyName); + if (inner != null) { + return new ServiceEndpointPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceEndpointPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public ServiceEndpointPolicy 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 serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, expand, 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 serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + this.delete(resourceGroupName, serviceEndpointPolicyName, 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 serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + this.delete(resourceGroupName, serviceEndpointPolicyName, context); + } + + private ServiceEndpointPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ServiceEndpointPolicyImpl define(String name) { + return new ServiceEndpointPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.java new file mode 100644 index 0000000000000..f86e6f0356f5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinition; +import java.util.Collections; +import java.util.List; + +public final class ServiceEndpointPolicyDefinitionImpl implements ServiceEndpointPolicyDefinition { + private ServiceEndpointPolicyDefinitionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ServiceEndpointPolicyDefinitionImpl( + ServiceEndpointPolicyDefinitionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String description() { + return this.innerModel().description(); + } + + public String service() { + return this.innerModel().service(); + } + + public List serviceResources() { + List inner = this.innerModel().serviceResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ServiceEndpointPolicyDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java new file mode 100644 index 0000000000000..fe1ac3780315d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java @@ -0,0 +1,1290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.ServiceEndpointPolicyDefinitionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinitionListResult; +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 ServiceEndpointPolicyDefinitionsClient. + */ +public final class ServiceEndpointPolicyDefinitionsClientImpl implements ServiceEndpointPolicyDefinitionsClient { + private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServiceEndpointPolicyDefinitionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPolicyDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceEndpointPolicyDefinitionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ServiceEndpointPolicyDefinitionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientServiceEndpointPolicyDefinitions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ServiceEndpointPolicyDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" + + "/{serviceEndpointPolicyDefinitionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @PathParam("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" + + "/{serviceEndpointPolicyDefinitionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @PathParam("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" + + "/{serviceEndpointPolicyDefinitionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @PathParam("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (serviceEndpointPolicyDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyDefinitionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (serviceEndpointPolicyDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyDefinitionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) + .getSyncPoller(); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + return beginDeleteAsync( + resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + return beginDeleteAsync( + resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + deleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).block(); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + deleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context).block(); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition 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 specified service endpoint policy definitions from service endpoint policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (serviceEndpointPolicyDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyDefinitionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition 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 specified service endpoint policy definitions from service endpoint policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (serviceEndpointPolicyDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyDefinitionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition 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 specified service endpoint policy definitions from service endpoint policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition 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 specified service endpoint policy definitions from service endpoint policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyDefinitionInner get( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).block(); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition 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 specified service endpoint policy definitions from service endpoint policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + return getWithResponseAsync( + resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context) + .block(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (serviceEndpointPolicyDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (serviceEndpointPolicyDefinitions == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyDefinitions is required and cannot be null.")); + } else { + serviceEndpointPolicyDefinitions.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + apiVersion, + this.client.getSubscriptionId(), + serviceEndpointPolicyDefinitions, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required and cannot be null.")); + } + if (serviceEndpointPolicyDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (serviceEndpointPolicyDefinitions == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyDefinitions is required and cannot be null.")); + } else { + serviceEndpointPolicyDefinitions.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + apiVersion, + this.client.getSubscriptionId(), + serviceEndpointPolicyDefinitions, + accept, + context); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServiceEndpointPolicyDefinitionInner.class, + ServiceEndpointPolicyDefinitionInner.class, + Context.NONE); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServiceEndpointPolicyDefinitionInner.class, + ServiceEndpointPolicyDefinitionInner.class, + context); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return beginCreateOrUpdateAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions) + .getSyncPoller(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions, + context) + .getSyncPoller(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return beginCreateOrUpdateAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyDefinitionInner createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return createOrUpdateAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions) + .block(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyDefinitionInner createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions, + context) + .block(); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String serviceEndpointPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String serviceEndpointPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceEndpointPolicyName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter serviceEndpointPolicyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String serviceEndpointPolicyName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String serviceEndpointPolicyName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName)); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName, 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 response for ListServiceEndpointPolicyDefinition API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for ListServiceEndpointPolicyDefinition API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsImpl.java new file mode 100644 index 0000000000000..00ea3c38a4ed8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsImpl.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.network.generated.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.network.generated.fluent.ServiceEndpointPolicyDefinitionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinition; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinitions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceEndpointPolicyDefinitionsImpl implements ServiceEndpointPolicyDefinitions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionsImpl.class); + + private final ServiceEndpointPolicyDefinitionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ServiceEndpointPolicyDefinitionsImpl( + ServiceEndpointPolicyDefinitionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + this.serviceClient().delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName); + } + + public void delete( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context); + } + + public ServiceEndpointPolicyDefinition get( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + ServiceEndpointPolicyDefinitionInner inner = + this.serviceClient().get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName); + if (inner != null) { + return new ServiceEndpointPolicyDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceEndpointPolicyDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServiceEndpointPolicyDefinition createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + ServiceEndpointPolicyDefinitionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions); + if (inner != null) { + return new ServiceEndpointPolicyDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ServiceEndpointPolicyDefinition createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context) { + ServiceEndpointPolicyDefinitionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions, + context); + if (inner != null) { + return new ServiceEndpointPolicyDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, serviceEndpointPolicyName); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, context); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyDefinitionImpl(inner1, this.manager())); + } + + private ServiceEndpointPolicyDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyImpl.java new file mode 100644 index 0000000000000..f7dcaa4a634b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyImpl.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.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicy; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinition; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ServiceEndpointPolicyImpl + implements ServiceEndpointPolicy, ServiceEndpointPolicy.Definition, ServiceEndpointPolicy.Update { + private ServiceEndpointPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public List serviceEndpointPolicyDefinitions() { + List inner = this.innerModel().serviceEndpointPolicyDefinitions(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ServiceEndpointPolicyDefinitionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List subnets() { + List inner = this.innerModel().subnets(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new SubnetImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ServiceEndpointPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceEndpointPolicyName; + + private TagsObject updateParameters; + + public ServiceEndpointPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ServiceEndpointPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getServiceEndpointPolicies() + .createOrUpdate(resourceGroupName, serviceEndpointPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public ServiceEndpointPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServiceEndpointPolicies() + .createOrUpdate(resourceGroupName, serviceEndpointPolicyName, this.innerModel(), context); + return this; + } + + ServiceEndpointPolicyImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ServiceEndpointPolicyInner(); + this.serviceManager = serviceManager; + this.serviceEndpointPolicyName = name; + } + + public ServiceEndpointPolicyImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ServiceEndpointPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getServiceEndpointPolicies() + .updateTagsWithResponse(resourceGroupName, serviceEndpointPolicyName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ServiceEndpointPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServiceEndpointPolicies() + .updateTagsWithResponse(resourceGroupName, serviceEndpointPolicyName, updateParameters, context) + .getValue(); + return this; + } + + ServiceEndpointPolicyImpl( + ServiceEndpointPolicyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceEndpointPolicyName = Utils.getValueFromIdByName(innerObject.id(), "serviceEndpointPolicies"); + } + + public ServiceEndpointPolicy refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getServiceEndpointPolicies() + .getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public ServiceEndpointPolicy refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getServiceEndpointPolicies() + .getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, localExpand, context) + .getValue(); + return this; + } + + public ServiceEndpointPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ServiceEndpointPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ServiceEndpointPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ServiceEndpointPolicyImpl withServiceEndpointPolicyDefinitions( + List serviceEndpointPolicyDefinitions) { + this.innerModel().withServiceEndpointPolicyDefinitions(serviceEndpointPolicyDefinitions); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsClientImpl.java new file mode 100644 index 0000000000000..152a6b7784fd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsClientImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ServiceTagsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServiceTagsClient. */ +public final class ServiceTagsClientImpl implements ServiceTagsClient { + private final ClientLogger logger = new ClientLogger(ServiceTagsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServiceTagsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceTagsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceTagsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ServiceTagsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientServiceTags to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ServiceTagsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String location) { + return listWithResponseAsync(location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceTagsListResultInner list(String location) { + return listAsync(location).block(); + } + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String location, Context context) { + return listWithResponseAsync(location, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsImpl.java new file mode 100644 index 0000000000000..6a8238f5b955f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsImpl.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.network.generated.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.network.generated.fluent.ServiceTagsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; +import com.azure.resourcemanager.network.generated.models.ServiceTags; +import com.azure.resourcemanager.network.generated.models.ServiceTagsListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceTagsImpl implements ServiceTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTagsImpl.class); + + private final ServiceTagsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ServiceTagsImpl( + ServiceTagsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ServiceTagsListResult list(String location) { + ServiceTagsListResultInner inner = this.serviceClient().list(location); + if (inner != null) { + return new ServiceTagsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String location, Context context) { + Response inner = this.serviceClient().listWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceTagsListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ServiceTagsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsListResultImpl.java new file mode 100644 index 0000000000000..39ab724488508 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsListResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; +import com.azure.resourcemanager.network.generated.models.ServiceTagInformation; +import com.azure.resourcemanager.network.generated.models.ServiceTagsListResult; +import java.util.Collections; +import java.util.List; + +public final class ServiceTagsListResultImpl implements ServiceTagsListResult { + private ServiceTagsListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ServiceTagsListResultImpl( + ServiceTagsListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String changeNumber() { + return this.innerModel().changeNumber(); + } + + public String cloud() { + return this.innerModel().cloud(); + } + + public List values() { + List inner = this.innerModel().values(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ServiceTagsListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetImpl.java new file mode 100644 index 0000000000000..aaf2e58694b58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetImpl.java @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.IpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpConfigurationProfile; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.RouteTable; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicy; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SubnetImpl implements Subnet, Subnet.Definition, Subnet.Update { + private SubnetInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public List addressPrefixes() { + List inner = this.innerModel().addressPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.innerModel().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public RouteTable routeTable() { + RouteTableInner inner = this.innerModel().routeTable(); + if (inner != null) { + return new RouteTableImpl(inner, this.manager()); + } else { + return null; + } + } + + public SubResource natGateway() { + return this.innerModel().natGateway(); + } + + public List serviceEndpoints() { + List inner = this.innerModel().serviceEndpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List serviceEndpointPolicies() { + List inner = this.innerModel().serviceEndpointPolicies(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List privateEndpoints() { + List inner = this.innerModel().privateEndpoints(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new IpConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipConfigurationProfiles() { + List inner = this.innerModel().ipConfigurationProfiles(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new IpConfigurationProfileImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipAllocations() { + List inner = this.innerModel().ipAllocations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List resourceNavigationLinks() { + List inner = this.innerModel().resourceNavigationLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List serviceAssociationLinks() { + List inner = this.innerModel().serviceAssociationLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List delegations() { + List inner = this.innerModel().delegations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String purpose() { + return this.innerModel().purpose(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies() { + return this.innerModel().privateEndpointNetworkPolicies(); + } + + public VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies() { + return this.innerModel().privateLinkServiceNetworkPolicies(); + } + + public List applicationGatewayIpConfigurations() { + List inner = this.innerModel().applicationGatewayIpConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubnetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkName; + + private String subnetName; + + public SubnetImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + public Subnet create() { + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.innerModel(), Context.NONE); + return this; + } + + public Subnet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.innerModel(), context); + return this; + } + + SubnetImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new SubnetInner(); + this.serviceManager = serviceManager; + this.subnetName = name; + } + + public SubnetImpl update() { + return this; + } + + public Subnet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.innerModel(), Context.NONE); + return this; + } + + public Subnet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.innerModel(), context); + return this; + } + + SubnetImpl(SubnetInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + this.subnetName = Utils.getValueFromIdByName(innerObject.id(), "subnets"); + } + + public Subnet refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .getWithResponse(resourceGroupName, virtualNetworkName, subnetName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public Subnet refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .getWithResponse(resourceGroupName, virtualNetworkName, subnetName, localExpand, context) + .getValue(); + return this; + } + + public void prepareNetworkPolicies(PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + serviceManager + .subnets() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters); + } + + public void prepareNetworkPolicies( + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Context context) { + serviceManager + .subnets() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context); + } + + public void unprepareNetworkPolicies(UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + serviceManager + .subnets() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters); + } + + public void unprepareNetworkPolicies( + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Context context) { + serviceManager + .subnets() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context); + } + + public SubnetImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public SubnetImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public SubnetImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public SubnetImpl withAddressPrefixes(List addressPrefixes) { + this.innerModel().withAddressPrefixes(addressPrefixes); + return this; + } + + public SubnetImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.innerModel().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + public SubnetImpl withRouteTable(RouteTableInner routeTable) { + this.innerModel().withRouteTable(routeTable); + return this; + } + + public SubnetImpl withNatGateway(SubResource natGateway) { + this.innerModel().withNatGateway(natGateway); + return this; + } + + public SubnetImpl withServiceEndpoints(List serviceEndpoints) { + this.innerModel().withServiceEndpoints(serviceEndpoints); + return this; + } + + public SubnetImpl withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.innerModel().withServiceEndpointPolicies(serviceEndpointPolicies); + return this; + } + + public SubnetImpl withIpAllocations(List ipAllocations) { + this.innerModel().withIpAllocations(ipAllocations); + return this; + } + + public SubnetImpl withDelegations(List delegations) { + this.innerModel().withDelegations(delegations); + return this; + } + + public SubnetImpl withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies) { + this.innerModel().withPrivateEndpointNetworkPolicies(privateEndpointNetworkPolicies); + return this; + } + + public SubnetImpl withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies) { + this.innerModel().withPrivateLinkServiceNetworkPolicies(privateLinkServiceNetworkPolicies); + return this; + } + + public SubnetImpl withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations) { + this.innerModel().withApplicationGatewayIpConfigurations(applicationGatewayIpConfigurations); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsClientImpl.java new file mode 100644 index 0000000000000..04b1773e0c4a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsClientImpl.java @@ -0,0 +1,1887 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.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.network.generated.fluent.SubnetsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.SubnetListResult; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; +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 SubnetsClient. */ +public final class SubnetsClientImpl implements SubnetsClient { + private final ClientLogger logger = new ClientLogger(SubnetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SubnetsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SubnetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubnetsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(SubnetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSubnets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface SubnetsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SubnetInner subnetParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> prepareNetworkPolicies( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> unprepareNetworkPolicies( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName).getSyncPoller(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).getSyncPoller(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String subnetName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkName, String subnetName) { + deleteAsync(resourceGroupName, virtualNetworkName, subnetName).block(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkName, String subnetName, Context context) { + deleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).block(); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName) { + final String expand = null; + return getAsync(resourceGroupName, virtualNetworkName, subnetName, expand).block(); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand, context).block(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (subnetParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter subnetParameters is required and cannot be null.")); + } else { + subnetParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + subnetParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + SubnetInner subnetParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (subnetParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter subnetParameters is required and cannot be null.")); + } else { + subnetParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + subnetParameters, + accept, + context); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SubnetInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SubnetInner.class, SubnetInner.class, Context.NONE); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SubnetInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + SubnetInner subnetParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualNetworkName, subnetName, subnetParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SubnetInner.class, SubnetInner.class, context); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SubnetInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SubnetInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + SubnetInner subnetParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + SubnetInner subnetParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubnetInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).block(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubnetInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + SubnetInner subnetParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, context) + .block(); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> prepareNetworkPoliciesWithResponseAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (prepareNetworkPoliciesRequestParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter prepareNetworkPoliciesRequestParameters is required and cannot be null.")); + } else { + prepareNetworkPoliciesRequestParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .prepareNetworkPolicies( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + prepareNetworkPoliciesRequestParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> prepareNetworkPoliciesWithResponseAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (prepareNetworkPoliciesRequestParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter prepareNetworkPoliciesRequestParameters is required and cannot be null.")); + } else { + prepareNetworkPoliciesRequestParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .prepareNetworkPolicies( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + prepareNetworkPoliciesRequestParameters, + accept, + context); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPrepareNetworkPoliciesAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + Mono>> mono = + prepareNetworkPoliciesWithResponseAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPrepareNetworkPoliciesAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + prepareNetworkPoliciesWithResponseAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPrepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + return beginPrepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters) + .getSyncPoller(); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPrepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context) { + return beginPrepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context) + .getSyncPoller(); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 prepareNetworkPoliciesAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + return beginPrepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 prepareNetworkPoliciesAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context) { + return beginPrepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + prepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters) + .block(); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context) { + prepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context) + .block(); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> unprepareNetworkPoliciesWithResponseAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (unprepareNetworkPoliciesRequestParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter unprepareNetworkPoliciesRequestParameters is required and cannot be null.")); + } else { + unprepareNetworkPoliciesRequestParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .unprepareNetworkPolicies( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + unprepareNetworkPoliciesRequestParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> unprepareNetworkPoliciesWithResponseAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (unprepareNetworkPoliciesRequestParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter unprepareNetworkPoliciesRequestParameters is required and cannot be null.")); + } else { + unprepareNetworkPoliciesRequestParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .unprepareNetworkPolicies( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + unprepareNetworkPoliciesRequestParameters, + accept, + context); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUnprepareNetworkPoliciesAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + Mono>> mono = + unprepareNetworkPoliciesWithResponseAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUnprepareNetworkPoliciesAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + unprepareNetworkPoliciesWithResponseAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUnprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + return beginUnprepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters) + .getSyncPoller(); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUnprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context) { + return beginUnprepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context) + .getSyncPoller(); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 unprepareNetworkPoliciesAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + return beginUnprepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 unprepareNetworkPoliciesAsync( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context) { + return beginUnprepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + unprepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters) + .block(); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context) { + unprepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context) + .block(); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String virtualNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualNetworkName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualNetworkName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualNetworkName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualNetworkName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName)); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName, 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 response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. + */ + @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 response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsImpl.java new file mode 100644 index 0000000000000..d5d55b569af9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsImpl.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.SubnetsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.Subnets; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SubnetsImpl implements Subnets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetsImpl.class); + + private final SubnetsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SubnetsImpl( + SubnetsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, subnetName); + } + + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, subnetName, context); + } + + public Subnet get(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetInner inner = this.serviceClient().get(resourceGroupName, virtualNetworkName, subnetName); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualNetworkName, subnetName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SubnetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + this + .serviceClient() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters); + } + + public void prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context) { + this + .serviceClient() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context); + } + + public void unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + this + .serviceClient() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters); + } + + public void unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context) { + this + .serviceClient() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context); + } + + public PagedIterable list(String resourceGroupName, String virtualNetworkName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualNetworkName); + return Utils.mapPage(inner, inner1 -> new SubnetImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualNetworkName, context); + return Utils.mapPage(inner, inner1 -> new SubnetImpl(inner1, this.manager())); + } + + public Subnet 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + String localExpand = null; + return this + .getWithResponse(resourceGroupName, virtualNetworkName, subnetName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkName, subnetName, expand, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, subnetName, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, subnetName, context); + } + + private SubnetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SubnetImpl define(String name) { + return new SubnetImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TopologyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TopologyImpl.java new file mode 100644 index 0000000000000..4e250a2aa2734 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TopologyImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import com.azure.resourcemanager.network.generated.models.Topology; +import com.azure.resourcemanager.network.generated.models.TopologyResource; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class TopologyImpl implements Topology { + private TopologyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + TopologyImpl(TopologyInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public OffsetDateTime createdDateTime() { + return this.innerModel().createdDateTime(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TopologyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TroubleshootingResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TroubleshootingResultImpl.java new file mode 100644 index 0000000000000..2a88ed09cbf7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TroubleshootingResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import com.azure.resourcemanager.network.generated.models.TroubleshootingDetails; +import com.azure.resourcemanager.network.generated.models.TroubleshootingResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class TroubleshootingResultImpl implements TroubleshootingResult { + private TroubleshootingResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + TroubleshootingResultImpl( + TroubleshootingResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public String code() { + return this.innerModel().code(); + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TroubleshootingResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.java new file mode 100644 index 0000000000000..4ecca678e41e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.network.generated.models.Usage; +import com.azure.resourcemanager.network.generated.models.UsageName; +import com.azure.resourcemanager.network.generated.models.UsageUnit; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public UsageUnit unit() { + return this.innerModel().unit(); + } + + public long currentValue() { + return this.innerModel().currentValue(); + } + + public long limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.java new file mode 100644 index 0000000000000..9ab9eabab3c00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.UsagesClient; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.network.generated.models.UsagesListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientUsages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, 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 the list usages operation response. + */ + @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 the list usages operation response. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..a92bfb64b52ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesImpl.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.network.generated.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.network.generated.fluent.UsagesClient; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.network.generated.models.Usage; +import com.azure.resourcemanager.network.generated.models.Usages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsagesImpl implements Usages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public UsagesImpl( + UsagesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/Utils.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/Utils.java new file mode 100644 index 0000000000000..64d0a08514764 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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.network.generated.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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java new file mode 100644 index 0000000000000..53cdfa059d67b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowResult; + +public final class VerificationIpFlowResultImpl implements VerificationIpFlowResult { + private VerificationIpFlowResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VerificationIpFlowResultImpl( + VerificationIpFlowResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Access access() { + return this.innerModel().access(); + } + + public String ruleName() { + return this.innerModel().ruleName(); + } + + public VerificationIpFlowResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSiteImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSiteImpl.java new file mode 100644 index 0000000000000..0c2ac92701e74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSiteImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSite; + +public final class VirtualApplianceSiteImpl + implements VirtualApplianceSite, VirtualApplianceSite.Definition, VirtualApplianceSite.Update { + private VirtualApplianceSiteInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public Office365PolicyProperties o365Policy() { + return this.innerModel().o365Policy(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualApplianceSiteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkVirtualApplianceName; + + private String siteName; + + public VirtualApplianceSiteImpl withExistingNetworkVirtualAppliance( + String resourceGroupName, String networkVirtualApplianceName) { + this.resourceGroupName = resourceGroupName; + this.networkVirtualApplianceName = networkVirtualApplianceName; + return this; + } + + public VirtualApplianceSite create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .createOrUpdate( + resourceGroupName, networkVirtualApplianceName, siteName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualApplianceSite create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, siteName, this.innerModel(), context); + return this; + } + + VirtualApplianceSiteImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualApplianceSiteInner(); + this.serviceManager = serviceManager; + this.siteName = name; + } + + public VirtualApplianceSiteImpl update() { + return this; + } + + public VirtualApplianceSite apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .createOrUpdate( + resourceGroupName, networkVirtualApplianceName, siteName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualApplianceSite apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, siteName, this.innerModel(), context); + return this; + } + + VirtualApplianceSiteImpl( + VirtualApplianceSiteInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName = Utils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + this.siteName = Utils.getValueFromIdByName(innerObject.id(), "virtualApplianceSites"); + } + + public VirtualApplianceSite refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, Context.NONE) + .getValue(); + return this; + } + + public VirtualApplianceSite refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, context) + .getValue(); + return this; + } + + public VirtualApplianceSiteImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualApplianceSiteImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public VirtualApplianceSiteImpl withO365Policy(Office365PolicyProperties o365Policy) { + this.innerModel().withO365Policy(o365Policy); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java new file mode 100644 index 0000000000000..e363ba24fad83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java @@ -0,0 +1,1173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualApplianceSitesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSiteListResult; +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 VirtualApplianceSitesClient. */ +public final class VirtualApplianceSitesClientImpl implements VirtualApplianceSitesClient { + private final ClientLogger logger = new ClientLogger(VirtualApplianceSitesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualApplianceSitesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualApplianceSitesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualApplianceSitesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualApplianceSitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualApplianceSites to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualApplianceSitesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("siteName") String siteName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("siteName") String siteName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("siteName") String siteName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualApplianceSiteInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkVirtualApplianceName, String siteName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + siteName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + siteName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkVirtualApplianceName, String siteName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkVirtualApplianceName, siteName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkVirtualApplianceName, siteName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkVirtualApplianceName, String siteName) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName).getSyncPoller(); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName, context).getSyncPoller(); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkVirtualApplianceName, String siteName) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName) { + deleteAsync(resourceGroupName, networkVirtualApplianceName, siteName).block(); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + deleteAsync(resourceGroupName, networkVirtualApplianceName, siteName, context).block(); + } + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the specified Virtual Appliance Site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkVirtualApplianceName, String siteName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + siteName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the specified Virtual Appliance Site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + siteName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the specified Virtual Appliance Site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String networkVirtualApplianceName, String siteName) { + return getWithResponseAsync(resourceGroupName, networkVirtualApplianceName, siteName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the specified Virtual Appliance Site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualApplianceSiteInner get( + String resourceGroupName, String networkVirtualApplianceName, String siteName) { + return getAsync(resourceGroupName, networkVirtualApplianceName, siteName).block(); + } + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the specified Virtual Appliance Site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + return getWithResponseAsync(resourceGroupName, networkVirtualApplianceName, siteName, context).block(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + siteName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + siteName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualApplianceSiteInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualApplianceSiteInner.class, + VirtualApplianceSiteInner.class, + Context.NONE); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualApplianceSiteInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, networkVirtualApplianceName, siteName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualApplianceSiteInner.class, + VirtualApplianceSiteInner.class, + context); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualApplianceSiteInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualApplianceSiteInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualApplianceSiteInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters).block(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualApplianceSiteInner createOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, context) + .block(); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkVirtualApplianceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkVirtualApplianceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkVirtualApplianceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkVirtualApplianceName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkVirtualApplianceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkVirtualApplianceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkVirtualApplianceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkVirtualApplianceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkVirtualApplianceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkVirtualApplianceName)); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkVirtualApplianceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkVirtualApplianceName, 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 response for ListNetworkVirtualApplianceSites API service call. + */ + @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 response for ListNetworkVirtualApplianceSites API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesImpl.java new file mode 100644 index 0000000000000..067377ee3733a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesImpl.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.network.generated.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.network.generated.fluent.VirtualApplianceSitesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSite; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSites; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualApplianceSitesImpl implements VirtualApplianceSites { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceSitesImpl.class); + + private final VirtualApplianceSitesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualApplianceSitesImpl( + VirtualApplianceSitesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName, siteName); + } + + public void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName, siteName, context); + } + + public VirtualApplianceSite get(String resourceGroupName, String networkVirtualApplianceName, String siteName) { + VirtualApplianceSiteInner inner = + this.serviceClient().get(resourceGroupName, networkVirtualApplianceName, siteName); + if (inner != null) { + return new VirtualApplianceSiteImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualApplianceSiteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkVirtualApplianceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkVirtualApplianceName); + return Utils.mapPage(inner, inner1 -> new VirtualApplianceSiteImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkVirtualApplianceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkVirtualApplianceName, context); + return Utils.mapPage(inner, inner1 -> new VirtualApplianceSiteImpl(inner1, this.manager())); + } + + public VirtualApplianceSite 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 networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + return this.getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, 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 networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + return this.getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, 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 networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, siteName, 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 networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, siteName, context); + } + + private VirtualApplianceSitesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualApplianceSiteImpl define(String name) { + return new VirtualApplianceSiteImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java new file mode 100644 index 0000000000000..e39fb9e00f14b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualApplianceSkusClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualApplianceSkusClient. */ +public final class VirtualApplianceSkusClientImpl implements VirtualApplianceSkusClient { + private final ClientLogger logger = new ClientLogger(VirtualApplianceSkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualApplianceSkusService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualApplianceSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualApplianceSkusClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualApplianceSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualApplianceSkus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualApplianceSkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("skuName") String skuName, + @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 all SKUs available for a virtual appliance. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 all SKUs available for a virtual appliance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all SKUs available for a virtual appliance. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all SKUs available for a virtual appliance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all SKUs available for a virtual appliance. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all SKUs available for a virtual appliance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the NetworkVirtualApplianceSkus resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String skuName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + skuName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the NetworkVirtualApplianceSkus resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String skuName, 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 (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, skuName, accept, context); + } + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the NetworkVirtualApplianceSkus resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String skuName) { + return getWithResponseAsync(skuName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the NetworkVirtualApplianceSkus resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceSkuInner get(String skuName) { + return getAsync(skuName).block(); + } + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the NetworkVirtualApplianceSkus resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String skuName, Context context) { + return getWithResponseAsync(skuName, 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 response for ListNetworkVirtualApplianceSkus API service call. + */ + @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 response for ListNetworkVirtualApplianceSkus API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusImpl.java new file mode 100644 index 0000000000000..8b0393f7bf0fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusImpl.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.network.generated.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.network.generated.fluent.VirtualApplianceSkusClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSku; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualApplianceSkusImpl implements VirtualApplianceSkus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceSkusImpl.class); + + private final VirtualApplianceSkusClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualApplianceSkusImpl( + VirtualApplianceSkusClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceSkuImpl(inner1, this.manager())); + } + + public NetworkVirtualApplianceSku get(String skuName) { + NetworkVirtualApplianceSkuInner inner = this.serviceClient().get(skuName); + if (inner != null) { + return new NetworkVirtualApplianceSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String skuName, Context context) { + Response inner = this.serviceClient().getWithResponse(skuName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkVirtualApplianceSkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private VirtualApplianceSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsClientImpl.java new file mode 100644 index 0000000000000..1fe63b64a97f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsClientImpl.java @@ -0,0 +1,1672 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.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.network.generated.fluent.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubBgpConnectionResults; +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 VirtualHubBgpConnectionsClient. */ +public final class VirtualHubBgpConnectionsClientImpl implements VirtualHubBgpConnectionsClient { + private final ClientLogger logger = new ClientLogger(VirtualHubBgpConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualHubBgpConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubBgpConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualHubBgpConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualHubBgpConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualHubBgpConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualHubBgpConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/bgpConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/bgpConnections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BgpConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/bgpConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/bgpConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{hubName}/bgpConnections/{connectionName}/learnedRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listLearnedRoutes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hubName") String hubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{hubName}/bgpConnections/{connectionName}/advertisedRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listAdvertisedRoutes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hubName") String hubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String connectionName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, connectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName) { + return getAsync(resourceGroupName, virtualHubName, connectionName).block(); + } + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, connectionName, context).block(); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualHubName, String connectionName, BgpConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualHubName, + String connectionName, + BgpConnectionInner parameters, + 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BgpConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualHubName, String connectionName, BgpConnectionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, connectionName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BgpConnectionInner.class, BgpConnectionInner.class, Context.NONE); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BgpConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String connectionName, + BgpConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, connectionName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BgpConnectionInner.class, BgpConnectionInner.class, context); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BgpConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String connectionName, BgpConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters).getSyncPoller(); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BgpConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + BgpConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualHubName, String connectionName, BgpConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String connectionName, + BgpConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpConnectionInner createOrUpdate( + String resourceGroupName, String virtualHubName, String connectionName, BgpConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters).block(); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpConnectionInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + BgpConnectionInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters, context).block(); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + accept, + context); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, connectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, connectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName).getSyncPoller(); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName, String connectionName) { + deleteAsync(resourceGroupName, virtualHubName, connectionName).block(); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName, String connectionName, Context context) { + deleteAsync(resourceGroupName, virtualHubName, connectionName, context).block(); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + 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())); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, context)); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listLearnedRoutesWithResponseAsync( + String resourceGroupName, String hubName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hubName == null) { + return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listLearnedRoutes( + this.client.getEndpoint(), + resourceGroupName, + hubName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listLearnedRoutesWithResponseAsync( + String resourceGroupName, String hubName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hubName == null) { + return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listLearnedRoutes( + this.client.getEndpoint(), + resourceGroupName, + hubName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PeerRouteListInner> beginListLearnedRoutesAsync( + String resourceGroupName, String hubName, String connectionName) { + Mono>> mono = + listLearnedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PeerRouteListInner.class, PeerRouteListInner.class, Context.NONE); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PeerRouteListInner> beginListLearnedRoutesAsync( + String resourceGroupName, String hubName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listLearnedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PeerRouteListInner.class, PeerRouteListInner.class, context); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PeerRouteListInner> beginListLearnedRoutes( + String resourceGroupName, String hubName, String connectionName) { + return beginListLearnedRoutesAsync(resourceGroupName, hubName, connectionName).getSyncPoller(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PeerRouteListInner> beginListLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + return beginListLearnedRoutesAsync(resourceGroupName, hubName, connectionName, context).getSyncPoller(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listLearnedRoutesAsync( + String resourceGroupName, String hubName, String connectionName) { + return beginListLearnedRoutesAsync(resourceGroupName, hubName, connectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listLearnedRoutesAsync( + String resourceGroupName, String hubName, String connectionName, Context context) { + return beginListLearnedRoutesAsync(resourceGroupName, hubName, connectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerRouteListInner listLearnedRoutes(String resourceGroupName, String hubName, String connectionName) { + return listLearnedRoutesAsync(resourceGroupName, hubName, connectionName).block(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerRouteListInner listLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + return listLearnedRoutesAsync(resourceGroupName, hubName, connectionName, context).block(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAdvertisedRoutesWithResponseAsync( + String resourceGroupName, String hubName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hubName == null) { + return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAdvertisedRoutes( + this.client.getEndpoint(), + resourceGroupName, + hubName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAdvertisedRoutesWithResponseAsync( + String resourceGroupName, String hubName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hubName == null) { + return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAdvertisedRoutes( + this.client.getEndpoint(), + resourceGroupName, + hubName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PeerRouteListInner> beginListAdvertisedRoutesAsync( + String resourceGroupName, String hubName, String connectionName) { + Mono>> mono = + listAdvertisedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PeerRouteListInner.class, PeerRouteListInner.class, Context.NONE); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PeerRouteListInner> beginListAdvertisedRoutesAsync( + String resourceGroupName, String hubName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listAdvertisedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PeerRouteListInner.class, PeerRouteListInner.class, context); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PeerRouteListInner> beginListAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName) { + return beginListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName).getSyncPoller(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PeerRouteListInner> beginListAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + return beginListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName, context).getSyncPoller(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAdvertisedRoutesAsync( + String resourceGroupName, String hubName, String connectionName) { + return beginListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAdvertisedRoutesAsync( + String resourceGroupName, String hubName, String connectionName, Context context) { + return beginListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerRouteListInner listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName) { + return listAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName).block(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerRouteListInner listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + return listAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName, 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 virtualHubBgpConnections list. + */ + @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 virtualHubBgpConnections list. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsImpl.java new file mode 100644 index 0000000000000..721cdbceedabd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsImpl.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import com.azure.resourcemanager.network.generated.models.BgpConnection; +import com.azure.resourcemanager.network.generated.models.PeerRouteList; +import com.azure.resourcemanager.network.generated.models.VirtualHubBgpConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualHubBgpConnectionsImpl implements VirtualHubBgpConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubBgpConnectionsImpl.class); + + private final VirtualHubBgpConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualHubBgpConnectionsImpl( + VirtualHubBgpConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BgpConnection get(String resourceGroupName, String virtualHubName, String connectionName) { + BgpConnectionInner inner = this.serviceClient().get(resourceGroupName, virtualHubName, connectionName); + if (inner != null) { + return new BgpConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BgpConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String connectionName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, connectionName); + } + + public void delete(String resourceGroupName, String virtualHubName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, connectionName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new BgpConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new BgpConnectionImpl(inner1, this.manager())); + } + + public PeerRouteList listLearnedRoutes(String resourceGroupName, String hubName, String connectionName) { + PeerRouteListInner inner = this.serviceClient().listLearnedRoutes(resourceGroupName, hubName, connectionName); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public PeerRouteList listLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + PeerRouteListInner inner = + this.serviceClient().listLearnedRoutes(resourceGroupName, hubName, connectionName, context); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public PeerRouteList listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName) { + PeerRouteListInner inner = + this.serviceClient().listAdvertisedRoutes(resourceGroupName, hubName, connectionName); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public PeerRouteList listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + PeerRouteListInner inner = + this.serviceClient().listAdvertisedRoutes(resourceGroupName, hubName, connectionName, context); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public BgpConnection 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, connectionName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, connectionName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + this.delete(resourceGroupName, virtualHubName, connectionName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + this.delete(resourceGroupName, virtualHubName, connectionName, context); + } + + private VirtualHubBgpConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public BgpConnectionImpl define(String name) { + return new BgpConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java new file mode 100644 index 0000000000000..8f23d22c97725 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.PreferredRoutingGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualHub; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTable; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualHubImpl implements VirtualHub, VirtualHub.Definition, VirtualHub.Update { + private VirtualHubInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public SubResource virtualWan() { + return this.innerModel().virtualWan(); + } + + public SubResource vpnGateway() { + return this.innerModel().vpnGateway(); + } + + public SubResource p2SVpnGateway() { + return this.innerModel().p2SVpnGateway(); + } + + public SubResource expressRouteGateway() { + return this.innerModel().expressRouteGateway(); + } + + public SubResource azureFirewall() { + return this.innerModel().azureFirewall(); + } + + public SubResource securityPartnerProvider() { + return this.innerModel().securityPartnerProvider(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public VirtualHubRouteTable routeTable() { + return this.innerModel().routeTable(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String securityProviderName() { + return this.innerModel().securityProviderName(); + } + + public List virtualHubRouteTableV2S() { + List inner = this.innerModel().virtualHubRouteTableV2S(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualHubRouteTableV2Impl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String sku() { + return this.innerModel().sku(); + } + + public RoutingState routingState() { + return this.innerModel().routingState(); + } + + public List bgpConnections() { + List inner = this.innerModel().bgpConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Long virtualRouterAsn() { + return this.innerModel().virtualRouterAsn(); + } + + public List virtualRouterIps() { + List inner = this.innerModel().virtualRouterIps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean allowBranchToBranchTraffic() { + return this.innerModel().allowBranchToBranchTraffic(); + } + + public PreferredRoutingGateway preferredRoutingGateway() { + return this.innerModel().preferredRoutingGateway(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualHubInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHubName; + + private TagsObject updateVirtualHubParameters; + + public VirtualHubImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualHub create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .createOrUpdate(resourceGroupName, virtualHubName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualHub create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .createOrUpdate(resourceGroupName, virtualHubName, this.innerModel(), context); + return this; + } + + VirtualHubImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualHubInner(); + this.serviceManager = serviceManager; + this.virtualHubName = name; + } + + public VirtualHubImpl update() { + this.updateVirtualHubParameters = new TagsObject(); + return this; + } + + public VirtualHub apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .updateTagsWithResponse(resourceGroupName, virtualHubName, updateVirtualHubParameters, Context.NONE) + .getValue(); + return this; + } + + public VirtualHub apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .updateTagsWithResponse(resourceGroupName, virtualHubName, updateVirtualHubParameters, context) + .getValue(); + return this; + } + + VirtualHubImpl( + VirtualHubInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + } + + public VirtualHub refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .getByResourceGroupWithResponse(resourceGroupName, virtualHubName, Context.NONE) + .getValue(); + return this; + } + + public VirtualHub refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .getByResourceGroupWithResponse(resourceGroupName, virtualHubName, context) + .getValue(); + return this; + } + + public void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters) { + serviceManager + .virtualHubs() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters); + } + + public void getEffectiveVirtualHubRoutes() { + serviceManager.virtualHubs().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName); + } + + public void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters, Context context) { + serviceManager + .virtualHubs() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + } + + public VirtualHubImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualHubImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualHubImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVirtualHubParameters.withTags(tags); + return this; + } + } + + public VirtualHubImpl withVirtualWan(SubResource virtualWan) { + this.innerModel().withVirtualWan(virtualWan); + return this; + } + + public VirtualHubImpl withVpnGateway(SubResource vpnGateway) { + this.innerModel().withVpnGateway(vpnGateway); + return this; + } + + public VirtualHubImpl withP2SVpnGateway(SubResource p2SVpnGateway) { + this.innerModel().withP2SVpnGateway(p2SVpnGateway); + return this; + } + + public VirtualHubImpl withExpressRouteGateway(SubResource expressRouteGateway) { + this.innerModel().withExpressRouteGateway(expressRouteGateway); + return this; + } + + public VirtualHubImpl withAzureFirewall(SubResource azureFirewall) { + this.innerModel().withAzureFirewall(azureFirewall); + return this; + } + + public VirtualHubImpl withSecurityPartnerProvider(SubResource securityPartnerProvider) { + this.innerModel().withSecurityPartnerProvider(securityPartnerProvider); + return this; + } + + public VirtualHubImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public VirtualHubImpl withRouteTable(VirtualHubRouteTable routeTable) { + this.innerModel().withRouteTable(routeTable); + return this; + } + + public VirtualHubImpl withSecurityProviderName(String securityProviderName) { + this.innerModel().withSecurityProviderName(securityProviderName); + return this; + } + + public VirtualHubImpl withVirtualHubRouteTableV2S(List virtualHubRouteTableV2S) { + this.innerModel().withVirtualHubRouteTableV2S(virtualHubRouteTableV2S); + return this; + } + + public VirtualHubImpl withSku(String sku) { + this.innerModel().withSku(sku); + return this; + } + + public VirtualHubImpl withVirtualRouterAsn(Long virtualRouterAsn) { + this.innerModel().withVirtualRouterAsn(virtualRouterAsn); + return this; + } + + public VirtualHubImpl withVirtualRouterIps(List virtualRouterIps) { + this.innerModel().withVirtualRouterIps(virtualRouterIps); + return this; + } + + public VirtualHubImpl withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.innerModel().withAllowBranchToBranchTraffic(allowBranchToBranchTraffic); + return this; + } + + public VirtualHubImpl withPreferredRoutingGateway(PreferredRoutingGateway preferredRoutingGateway) { + this.innerModel().withPreferredRoutingGateway(preferredRoutingGateway); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsClientImpl.java new file mode 100644 index 0000000000000..623627606639c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsClientImpl.java @@ -0,0 +1,1140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualHubIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubIpConfigurationResults; +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 VirtualHubIpConfigurationsClient. */ +public final class VirtualHubIpConfigurationsClientImpl implements VirtualHubIpConfigurationsClient { + private final ClientLogger logger = new ClientLogger(VirtualHubIpConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualHubIpConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubIpConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualHubIpConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualHubIpConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualHubIpConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualHubIpConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/ipConfigurations/{ipConfigName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("ipConfigName") String ipConfigName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/ipConfigurations/{ipConfigName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("ipConfigName") String ipConfigName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") HubIpConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/ipConfigurations/{ipConfigName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("ipConfigName") String ipConfigName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/ipConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @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); + } + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String ipConfigName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (ipConfigName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipConfigName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + ipConfigName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String ipConfigName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (ipConfigName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipConfigName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + ipConfigName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String virtualHubName, String ipConfigName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, ipConfigName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubIpConfigurationInner get(String resourceGroupName, String virtualHubName, String ipConfigName) { + return getAsync(resourceGroupName, virtualHubName, ipConfigName).block(); + } + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String ipConfigName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, ipConfigName, context).block(); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (ipConfigName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipConfigName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + ipConfigName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualHubName, + String ipConfigName, + HubIpConfigurationInner parameters, + 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (ipConfigName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipConfigName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + ipConfigName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, HubIpConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, ipConfigName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + HubIpConfigurationInner.class, + HubIpConfigurationInner.class, + Context.NONE); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, HubIpConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String ipConfigName, + HubIpConfigurationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + HubIpConfigurationInner.class, + HubIpConfigurationInner.class, + context); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, HubIpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters).getSyncPoller(); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, HubIpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String ipConfigName, + HubIpConfigurationInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String ipConfigName, + HubIpConfigurationInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubIpConfigurationInner createOrUpdate( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters).block(); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubIpConfigurationInner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String ipConfigName, + HubIpConfigurationInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, context).block(); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String ipConfigName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (ipConfigName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipConfigName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + ipConfigName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String ipConfigName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (ipConfigName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipConfigName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + ipConfigName, + apiVersion, + accept, + context); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String ipConfigName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, ipConfigName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String ipConfigName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, ipConfigName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String ipConfigName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, ipConfigName).getSyncPoller(); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String ipConfigName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, ipConfigName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String ipConfigName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, ipConfigName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, String ipConfigName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, ipConfigName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName, String ipConfigName) { + deleteAsync(resourceGroupName, virtualHubName, ipConfigName).block(); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName, String ipConfigName, Context context) { + deleteAsync(resourceGroupName, virtualHubName, ipConfigName, context).block(); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + 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())); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, 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 virtualHubIpConfigurations list. + */ + @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 virtualHubIpConfigurations list. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsImpl.java new file mode 100644 index 0000000000000..ca2f9f87290f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualHubIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.HubIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualHubIpConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualHubIpConfigurationsImpl implements VirtualHubIpConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubIpConfigurationsImpl.class); + + private final VirtualHubIpConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualHubIpConfigurationsImpl( + VirtualHubIpConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public HubIpConfiguration get(String resourceGroupName, String virtualHubName, String ipConfigName) { + HubIpConfigurationInner inner = this.serviceClient().get(resourceGroupName, virtualHubName, ipConfigName); + if (inner != null) { + return new HubIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String ipConfigName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, ipConfigName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HubIpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String ipConfigName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, ipConfigName); + } + + public void delete(String resourceGroupName, String virtualHubName, String ipConfigName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, ipConfigName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new HubIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new HubIpConfigurationImpl(inner1, this.manager())); + } + + public HubIpConfiguration 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, ipConfigName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, ipConfigName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + this.delete(resourceGroupName, virtualHubName, ipConfigName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + this.delete(resourceGroupName, virtualHubName, ipConfigName, context); + } + + private VirtualHubIpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public HubIpConfigurationImpl define(String name) { + return new HubIpConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java new file mode 100644 index 0000000000000..8c062ebf18af4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import java.util.Collections; +import java.util.List; + +public final class VirtualHubRouteTableV2Impl implements VirtualHubRouteTableV2 { + private VirtualHubRouteTableV2Inner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualHubRouteTableV2Impl( + VirtualHubRouteTableV2Inner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List routes() { + List inner = this.innerModel().routes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List attachedConnections() { + List inner = this.innerModel().attachedConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualHubRouteTableV2Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java new file mode 100644 index 0000000000000..6cb5a3ab3e687 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java @@ -0,0 +1,1161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualHubRouteTableV2SClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubRouteTableV2SResult; +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 VirtualHubRouteTableV2SClient. */ +public final class VirtualHubRouteTableV2SClientImpl implements VirtualHubRouteTableV2SClient { + private final ClientLogger logger = new ClientLogger(VirtualHubRouteTableV2SClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualHubRouteTableV2SService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubRouteTableV2SClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualHubRouteTableV2SClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualHubRouteTableV2SService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualHubRouteTableV2S to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualHubRouteTableV2SService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/routeTables/{routeTableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/routeTables/{routeTableName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/routeTables/{routeTableName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/routeTables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @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); + } + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String routeTableName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualHubName, String routeTableName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String virtualHubName, String routeTableName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeTableName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubRouteTableV2Inner get(String resourceGroupName, String virtualHubName, String routeTableName) { + return getAsync(resourceGroupName, virtualHubName, routeTableName).block(); + } + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeTableName, context).block(); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (virtualHubRouteTableV2Parameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualHubRouteTableV2Parameters is required and cannot be null.")); + } else { + virtualHubRouteTableV2Parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + virtualHubRouteTableV2Parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + if (virtualHubRouteTableV2Parameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualHubRouteTableV2Parameters is required and cannot be null.")); + } else { + virtualHubRouteTableV2Parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + virtualHubRouteTableV2Parameters, + accept, + context); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualHubRouteTableV2Inner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualHubRouteTableV2Inner.class, + VirtualHubRouteTableV2Inner.class, + Context.NONE); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualHubRouteTableV2Inner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualHubRouteTableV2Inner.class, + VirtualHubRouteTableV2Inner.class, + context); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualHubRouteTableV2Inner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters) + .getSyncPoller(); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualHubRouteTableV2Inner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, context) + .getSyncPoller(); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubRouteTableV2Inner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters) + .block(); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubRouteTableV2Inner createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, context) + .block(); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (routeTableName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeTableName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + accept, + context); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, routeTableName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualHubName, routeTableName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName).getSyncPoller(); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName) { + deleteAsync(resourceGroupName, virtualHubName, routeTableName).block(); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualHubName, String routeTableName, Context context) { + deleteAsync(resourceGroupName, virtualHubName, routeTableName, context).block(); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + 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())); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualHubName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, 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 list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @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 list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SImpl.java new file mode 100644 index 0000000000000..b91dc66c60eef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SImpl.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualHubRouteTableV2SClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2S; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualHubRouteTableV2SImpl implements VirtualHubRouteTableV2S { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteTableV2SImpl.class); + + private final VirtualHubRouteTableV2SClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualHubRouteTableV2SImpl( + VirtualHubRouteTableV2SClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualHubRouteTableV2 get(String resourceGroupName, String virtualHubName, String routeTableName) { + VirtualHubRouteTableV2Inner inner = this.serviceClient().get(resourceGroupName, virtualHubName, routeTableName); + if (inner != null) { + return new VirtualHubRouteTableV2Impl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, routeTableName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualHubRouteTableV2Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualHubRouteTableV2 createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters) { + VirtualHubRouteTableV2Inner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters); + if (inner != null) { + return new VirtualHubRouteTableV2Impl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualHubRouteTableV2 createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context) { + VirtualHubRouteTableV2Inner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, context); + if (inner != null) { + return new VirtualHubRouteTableV2Impl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String routeTableName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeTableName); + } + + public void delete(String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeTableName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new VirtualHubRouteTableV2Impl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new VirtualHubRouteTableV2Impl(inner1, this.manager())); + } + + private VirtualHubRouteTableV2SClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java new file mode 100644 index 0000000000000..5b331ccdef8e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java @@ -0,0 +1,1770 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualHubsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubsResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 VirtualHubsClient. */ +public final class VirtualHubsClientImpl implements VirtualHubsClient { + private final ClientLogger logger = new ClientLogger(VirtualHubsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualHubsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualHubsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualHubs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualHubsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualHubInner virtualHubParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject virtualHubParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualHubs") + @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.Network/virtualHubs") + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/effectiveRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getEffectiveVirtualHubRoutes( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EffectiveRoutesParameters effectiveRoutesParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualHubName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualHubName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName) { + return getByResourceGroupAsync(resourceGroupName, virtualHubName).block(); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHubName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualHubName, context).block(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (virtualHubParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null.")); + } else { + virtualHubParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + virtualHubParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (virtualHubParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null.")); + } else { + virtualHubParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + virtualHubParameters, + accept, + context); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualHubInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualHubInner.class, VirtualHubInner.class, Context.NONE); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualHubInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualHubInner.class, VirtualHubInner.class, context); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualHubInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters).getSyncPoller(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualHubInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters, context) + .getSyncPoller(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubInner createOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters).block(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubInner createOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters, context).block(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (virtualHubParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null.")); + } else { + virtualHubParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + virtualHubParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (virtualHubParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null.")); + } else { + virtualHubParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + virtualHubParameters, + accept, + context); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters) { + return updateTagsWithResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubInner updateTags( + String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters) { + return updateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters).block(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters, context).block(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualHubName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualHubName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName) { + return beginDeleteAsync(resourceGroupName, virtualHubName).getSyncPoller(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName) { + return beginDeleteAsync(resourceGroupName, virtualHubName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualHubName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName) { + deleteAsync(resourceGroupName, virtualHubName).block(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualHubName, Context context) { + deleteAsync(resourceGroupName, virtualHubName, context).block(); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getEffectiveVirtualHubRoutesWithResponseAsync( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (effectiveRoutesParameters != null) { + effectiveRoutesParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEffectiveVirtualHubRoutes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + effectiveRoutesParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getEffectiveVirtualHubRoutesWithResponseAsync( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + 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 (virtualHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null.")); + } + if (effectiveRoutesParameters != null) { + effectiveRoutesParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEffectiveVirtualHubRoutes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + effectiveRoutesParameters, + accept, + context); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginGetEffectiveVirtualHubRoutesAsync( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + Mono>> mono = + getEffectiveVirtualHubRoutesWithResponseAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginGetEffectiveVirtualHubRoutesAsync( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getEffectiveVirtualHubRoutesWithResponseAsync( + resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginGetEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + return beginGetEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters) + .getSyncPoller(); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginGetEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + return beginGetEffectiveVirtualHubRoutesAsync( + resourceGroupName, virtualHubName, effectiveRoutesParameters, context) + .getSyncPoller(); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEffectiveVirtualHubRoutesAsync( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + return beginGetEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEffectiveVirtualHubRoutesAsync(String resourceGroupName, String virtualHubName) { + final EffectiveRoutesParameters effectiveRoutesParameters = null; + return beginGetEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEffectiveVirtualHubRoutesAsync( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + return beginGetEffectiveVirtualHubRoutesAsync( + resourceGroupName, virtualHubName, effectiveRoutesParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + getEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters).block(); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName) { + final EffectiveRoutesParameters effectiveRoutesParameters = null; + getEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters).block(); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + getEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, 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 result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 result of the request to list VirtualHubs. + */ + @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 result of the request to list VirtualHubs. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsImpl.java new file mode 100644 index 0000000000000..1f4eb3edbfc1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsImpl.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.network.generated.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.network.generated.fluent.VirtualHubsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.VirtualHub; +import com.azure.resourcemanager.network.generated.models.VirtualHubs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualHubsImpl implements VirtualHubs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubsImpl.class); + + private final VirtualHubsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualHubsImpl( + VirtualHubsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualHub getByResourceGroup(String resourceGroupName, String virtualHubName) { + VirtualHubInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualHubName); + if (inner != null) { + return new VirtualHubImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHubName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualHubName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualHubImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualHubName) { + this.serviceClient().delete(resourceGroupName, virtualHubName); + } + + public void delete(String resourceGroupName, String virtualHubName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + this.serviceClient().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters); + } + + public void getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName) { + this.serviceClient().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName); + } + + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + this + .serviceClient() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + } + + public VirtualHub 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualHubName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualHubName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + this.delete(resourceGroupName, virtualHubName, 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 virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + this.delete(resourceGroupName, virtualHubName, context); + } + + private VirtualHubsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualHubImpl define(String name) { + return new VirtualHubImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.java new file mode 100644 index 0000000000000..a1962f275166c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.java @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnection; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualNetworkGatewayConnectionImpl + implements VirtualNetworkGatewayConnection, + VirtualNetworkGatewayConnection.Definition, + VirtualNetworkGatewayConnection.Update { + private VirtualNetworkGatewayConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public VirtualNetworkGateway virtualNetworkGateway1() { + VirtualNetworkGatewayInner inner = this.innerModel().virtualNetworkGateway1(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualNetworkGateway virtualNetworkGateway2() { + VirtualNetworkGatewayInner inner = this.innerModel().virtualNetworkGateway2(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public LocalNetworkGateway localNetworkGateway2() { + LocalNetworkGatewayInner inner = this.innerModel().localNetworkGateway2(); + if (inner != null) { + return new LocalNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public List ingressNatRules() { + List inner = this.innerModel().ingressNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List egressNatRules() { + List inner = this.innerModel().egressNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualNetworkGatewayConnectionType connectionType() { + return this.innerModel().connectionType(); + } + + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.innerModel().connectionProtocol(); + } + + public Integer routingWeight() { + return this.innerModel().routingWeight(); + } + + public Integer dpdTimeoutSeconds() { + return this.innerModel().dpdTimeoutSeconds(); + } + + public VirtualNetworkGatewayConnectionMode connectionMode() { + return this.innerModel().connectionMode(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public List tunnelConnectionStatus() { + List inner = this.innerModel().tunnelConnectionStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Long egressBytesTransferred() { + return this.innerModel().egressBytesTransferred(); + } + + public Long ingressBytesTransferred() { + return this.innerModel().ingressBytesTransferred(); + } + + public SubResource peer() { + return this.innerModel().peer(); + } + + public Boolean enableBgp() { + return this.innerModel().enableBgp(); + } + + public Boolean useLocalAzureIpAddress() { + return this.innerModel().useLocalAzureIpAddress(); + } + + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerModel().usePolicyBasedTrafficSelectors(); + } + + public List ipsecPolicies() { + List inner = this.innerModel().ipsecPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List trafficSelectorPolicies() { + List inner = this.innerModel().trafficSelectorPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean expressRouteGatewayBypass() { + return this.innerModel().expressRouteGatewayBypass(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualNetworkGatewayConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkGatewayConnectionName; + + private TagsObject updateParameters; + + public VirtualNetworkGatewayConnectionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualNetworkGatewayConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .createOrUpdate( + resourceGroupName, virtualNetworkGatewayConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworkGatewayConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.innerModel(), context); + return this; + } + + VirtualNetworkGatewayConnectionImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkGatewayConnectionInner(); + this.serviceManager = serviceManager; + this.virtualNetworkGatewayConnectionName = name; + } + + public VirtualNetworkGatewayConnectionImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public VirtualNetworkGatewayConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, updateParameters, Context.NONE); + return this; + } + + public VirtualNetworkGatewayConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, updateParameters, context); + return this; + } + + VirtualNetworkGatewayConnectionImpl( + VirtualNetworkGatewayConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(innerObject.id(), "connections"); + } + + public VirtualNetworkGatewayConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkGatewayConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .getValue(); + return this; + } + + public String startPacketCapture(VpnPacketCaptureStartParameters parameters) { + return serviceManager + .virtualNetworkGatewayConnections() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public String startPacketCapture() { + return serviceManager + .virtualNetworkGatewayConnections() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String startPacketCapture(VpnPacketCaptureStartParameters parameters, Context context) { + return serviceManager + .virtualNetworkGatewayConnections() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String stopPacketCapture(VpnPacketCaptureStopParameters parameters) { + return serviceManager + .virtualNetworkGatewayConnections() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public String stopPacketCapture(VpnPacketCaptureStopParameters parameters, Context context) { + return serviceManager + .virtualNetworkGatewayConnections() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String getIkeSas() { + return serviceManager + .virtualNetworkGatewayConnections() + .getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String getIkeSas(Context context) { + return serviceManager + .virtualNetworkGatewayConnections() + .getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public void resetConnection() { + serviceManager + .virtualNetworkGatewayConnections() + .resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public void resetConnection(Context context) { + serviceManager + .virtualNetworkGatewayConnections() + .resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public VirtualNetworkGatewayConnectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway1( + VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.innerModel().withVirtualNetworkGateway1(virtualNetworkGateway1); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.innerModel().withConnectionType(connectionType); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualNetworkGatewayConnectionImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway2( + VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.innerModel().withVirtualNetworkGateway2(virtualNetworkGateway2); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.innerModel().withLocalNetworkGateway2(localNetworkGateway2); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withIngressNatRules(List ingressNatRules) { + this.innerModel().withIngressNatRules(ingressNatRules); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withEgressNatRules(List egressNatRules) { + this.innerModel().withEgressNatRules(egressNatRules); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withConnectionProtocol( + VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.innerModel().withConnectionProtocol(connectionProtocol); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withRoutingWeight(Integer routingWeight) { + this.innerModel().withRoutingWeight(routingWeight); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withDpdTimeoutSeconds(Integer dpdTimeoutSeconds) { + this.innerModel().withDpdTimeoutSeconds(dpdTimeoutSeconds); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withConnectionMode(VirtualNetworkGatewayConnectionMode connectionMode) { + this.innerModel().withConnectionMode(connectionMode); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withSharedKey(String sharedKey) { + this.innerModel().withSharedKey(sharedKey); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withPeer(SubResource peer) { + this.innerModel().withPeer(peer); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withEnableBgp(Boolean enableBgp) { + this.innerModel().withEnableBgp(enableBgp); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress) { + this.innerModel().withUseLocalAzureIpAddress(useLocalAzureIpAddress); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withUsePolicyBasedTrafficSelectors( + Boolean usePolicyBasedTrafficSelectors) { + this.innerModel().withUsePolicyBasedTrafficSelectors(usePolicyBasedTrafficSelectors); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.innerModel().withIpsecPolicies(ipsecPolicies); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withTrafficSelectorPolicies( + List trafficSelectorPolicies) { + this.innerModel().withTrafficSelectorPolicies(trafficSelectorPolicies); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.innerModel().withExpressRouteGatewayBypass(expressRouteGatewayBypass); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java new file mode 100644 index 0000000000000..025513ffc221d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkConnectionGatewayReference; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionListEntity; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualNetworkGatewayConnectionListEntityImpl implements VirtualNetworkGatewayConnectionListEntity { + private VirtualNetworkGatewayConnectionListEntityInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualNetworkGatewayConnectionListEntityImpl( + VirtualNetworkGatewayConnectionListEntityInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 String etag() { + return this.innerModel().etag(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.innerModel().virtualNetworkGateway1(); + } + + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.innerModel().virtualNetworkGateway2(); + } + + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.innerModel().localNetworkGateway2(); + } + + public VirtualNetworkGatewayConnectionType connectionType() { + return this.innerModel().connectionType(); + } + + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.innerModel().connectionProtocol(); + } + + public Integer routingWeight() { + return this.innerModel().routingWeight(); + } + + public VirtualNetworkGatewayConnectionMode connectionMode() { + return this.innerModel().connectionMode(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public List tunnelConnectionStatus() { + List inner = this.innerModel().tunnelConnectionStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Long egressBytesTransferred() { + return this.innerModel().egressBytesTransferred(); + } + + public Long ingressBytesTransferred() { + return this.innerModel().ingressBytesTransferred(); + } + + public SubResource peer() { + return this.innerModel().peer(); + } + + public Boolean enableBgp() { + return this.innerModel().enableBgp(); + } + + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerModel().usePolicyBasedTrafficSelectors(); + } + + public List ipsecPolicies() { + List inner = this.innerModel().ipsecPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List trafficSelectorPolicies() { + List inner = this.innerModel().trafficSelectorPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean expressRouteGatewayBypass() { + return this.innerModel().expressRouteGatewayBypass(); + } + + public String id() { + return this.innerModel().id(); + } + + public VirtualNetworkGatewayConnectionListEntityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsClientImpl.java new file mode 100644 index 0000000000000..e3973e4ed29ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsClientImpl.java @@ -0,0 +1,3480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkGatewayConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionListResult; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +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 VirtualNetworkGatewayConnectionsClient. + */ +public final class VirtualNetworkGatewayConnectionsClientImpl implements VirtualNetworkGatewayConnectionsClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkGatewayConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewayConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkGatewayConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualNetworkGatewayConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkGatewayConnections to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkGatewayConnectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkGatewayConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/sharedkey") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setSharedKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ConnectionSharedKeyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/sharedkey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSharedKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/connections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetSharedKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ConnectionResetSharedKeyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/startPacketCapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> startPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnPacketCaptureStartParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/stopPacketCapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> stopPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnPacketCaptureStopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/getikesas") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getIkeSas( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/resetconnection") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetConnection( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayConnectionInner.class, + VirtualNetworkGatewayConnectionInner.class, + Context.NONE); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayConnectionInner.class, + VirtualNetworkGatewayConnectionInner.class, + context); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayConnectionInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayConnectionInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context).block(); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayConnectionInner getByResourceGroup( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .block(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayConnectionName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).getSyncPoller(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayConnectionName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkGatewayConnectionName) { + deleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkGatewayConnectionName, Context context) { + deleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).block(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayConnectionInner> + beginUpdateTagsAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayConnectionInner.class, + VirtualNetworkGatewayConnectionInner.class, + Context.NONE); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayConnectionInner> + beginUpdateTagsAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + TagsObject parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayConnectionInner.class, + VirtualNetworkGatewayConnectionInner.class, + context); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).getSyncPoller(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginUpdateTags( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + TagsObject parameters, + Context context) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayConnectionInner updateTags( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayConnectionInner updateTags( + String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context) { + return updateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context).block(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setSharedKeyWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setSharedKeyWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectionSharedKeyInner> beginSetSharedKeyAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + Mono>> mono = + setSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectionSharedKeyInner.class, + ConnectionSharedKeyInner.class, + Context.NONE); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectionSharedKeyInner> beginSetSharedKeyAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + setSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectionSharedKeyInner.class, + ConnectionSharedKeyInner.class, + context); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context) { + return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setSharedKeyAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setSharedKeyAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context) { + return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionSharedKeyInner setSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionSharedKeyInner setSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context) { + return setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context).block(); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSharedKeyWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSharedKeyWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSharedKeyAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSharedKeyWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return getSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).block(); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetSharedKeyWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetSharedKeyWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectionResetSharedKeyInner> + beginResetSharedKeyAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + Mono>> mono = + resetSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectionResetSharedKeyInner.class, + ConnectionResetSharedKeyInner.class, + Context.NONE); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectionResetSharedKeyInner> + beginResetSharedKeyAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetSharedKeyWithResponseAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectionResetSharedKeyInner.class, + ConnectionResetSharedKeyInner.class, + context); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context) { + return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetSharedKeyAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetSharedKeyAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context) { + return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionResetSharedKeyInner resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + return resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionResetSharedKeyInner resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context) { + return resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context).block(); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono>> startPacketCaptureWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono>> startPacketCaptureWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private PollerFlux, String> beginStartPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters) { + Mono>> mono = + startPacketCaptureWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private PollerFlux, String> beginStartPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startPacketCaptureWithResponseAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono startPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono startPacketCaptureAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + final VpnPacketCaptureStartParameters parameters = null; + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono startPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters) { + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + final VpnPacketCaptureStartParameters parameters = null; + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .block(); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono>> stopPacketCaptureWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono>> stopPacketCaptureWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private PollerFlux, String> beginStopPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters) { + Mono>> mono = + stopPacketCaptureWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private PollerFlux, String> beginStopPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopPacketCaptureWithResponseAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono stopPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono stopPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters) { + return stopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return stopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .block(); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> getIkeSasWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getIkeSas( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> getIkeSasWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getIkeSas( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginGetIkeSasAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + Mono>> mono = + getIkeSasWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginGetIkeSasAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getIkeSasWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginGetIkeSas( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginGetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName).getSyncPoller(); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginGetIkeSas( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return beginGetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).getSyncPoller(); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono getIkeSasAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginGetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono getIkeSasAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return beginGetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return getIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).block(); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> resetConnectionWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetConnection( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> resetConnectionWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetConnection( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetConnectionAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + Mono>> mono = + resetConnectionWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetConnectionAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetConnectionWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetConnection( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName).getSyncPoller(); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetConnection( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return beginResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .getSyncPoller(); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resetConnectionAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resetConnectionAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return beginResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + resetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + resetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName, 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsImpl.java new file mode 100644 index 0000000000000..c608735d2fd67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsImpl.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkGatewayConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.azure.resourcemanager.network.generated.models.ConnectionResetSharedKey; +import com.azure.resourcemanager.network.generated.models.ConnectionSharedKey; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnection; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnections; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkGatewayConnectionsImpl implements VirtualNetworkGatewayConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionsImpl.class); + + private final VirtualNetworkGatewayConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkGatewayConnectionsImpl( + VirtualNetworkGatewayConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualNetworkGatewayConnection getByResourceGroup( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + VirtualNetworkGatewayConnectionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkGatewayConnectionName); + if (inner != null) { + return new VirtualNetworkGatewayConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkGatewayConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public ConnectionSharedKey setSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + ConnectionSharedKeyInner inner = + this.serviceClient().setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + if (inner != null) { + return new ConnectionSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionSharedKey setSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context) { + ConnectionSharedKeyInner inner = + this + .serviceClient() + .setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + if (inner != null) { + return new ConnectionSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionSharedKey getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + ConnectionSharedKeyInner inner = + this.serviceClient().getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName); + if (inner != null) { + return new ConnectionSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSharedKeyWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getSharedKeyWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConnectionSharedKeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionImpl(inner1, this.manager())); + } + + public ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + ConnectionResetSharedKeyInner inner = + this.serviceClient().resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + if (inner != null) { + return new ConnectionResetSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context) { + ConnectionResetSharedKeyInner inner = + this + .serviceClient() + .resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + if (inner != null) { + return new ConnectionResetSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters) { + return this + .serviceClient() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return this.serviceClient().startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return this + .serviceClient() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return this.serviceClient().getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return this.serviceClient().getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public void resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + this.serviceClient().resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public void resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + this.serviceClient().resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public VirtualNetworkGatewayConnection 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 virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, 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 virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, 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 virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayConnectionName, 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 virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + private VirtualNetworkGatewayConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkGatewayConnectionImpl define(String name) { + return new VirtualNetworkGatewayConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.java new file mode 100644 index 0000000000000..9374824fde295 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.java @@ -0,0 +1,557 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatusListResult; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.GatewayRouteListResult; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType; +import com.azure.resourcemanager.network.generated.models.VpnClientConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetailListResult; +import com.azure.resourcemanager.network.generated.models.VpnClientIPsecParameters; +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; +import com.azure.resourcemanager.network.generated.models.VpnGatewayGeneration; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import com.azure.resourcemanager.network.generated.models.VpnType; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualNetworkGatewayImpl + implements VirtualNetworkGateway, VirtualNetworkGateway.Definition, VirtualNetworkGateway.Update { + private VirtualNetworkGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualNetworkGatewayType gatewayType() { + return this.innerModel().gatewayType(); + } + + public VpnType vpnType() { + return this.innerModel().vpnType(); + } + + public VpnGatewayGeneration vpnGatewayGeneration() { + return this.innerModel().vpnGatewayGeneration(); + } + + public Boolean enableBgp() { + return this.innerModel().enableBgp(); + } + + public Boolean enablePrivateIpAddress() { + return this.innerModel().enablePrivateIpAddress(); + } + + public Boolean active() { + return this.innerModel().active(); + } + + public SubResource gatewayDefaultSite() { + return this.innerModel().gatewayDefaultSite(); + } + + public VirtualNetworkGatewaySku sku() { + return this.innerModel().sku(); + } + + public VpnClientConfiguration vpnClientConfiguration() { + return this.innerModel().vpnClientConfiguration(); + } + + public BgpSettings bgpSettings() { + return this.innerModel().bgpSettings(); + } + + public AddressSpace customRoutes() { + return this.innerModel().customRoutes(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean enableDnsForwarding() { + return this.innerModel().enableDnsForwarding(); + } + + public String inboundDnsForwardingEndpoint() { + return this.innerModel().inboundDnsForwardingEndpoint(); + } + + public String vNetExtendedLocationResourceId() { + return this.innerModel().vNetExtendedLocationResourceId(); + } + + public List natRules() { + List inner = this.innerModel().natRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualNetworkGatewayNatRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableBgpRouteTranslationForNat() { + return this.innerModel().enableBgpRouteTranslationForNat(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualNetworkGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkGatewayName; + + private TagsObject updateParameters; + + public VirtualNetworkGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualNetworkGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworkGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.innerModel(), context); + return this; + } + + VirtualNetworkGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkGatewayInner(); + this.serviceManager = serviceManager; + this.virtualNetworkGatewayName = name; + } + + public VirtualNetworkGatewayImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public VirtualNetworkGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .updateTags(resourceGroupName, virtualNetworkGatewayName, updateParameters, Context.NONE); + return this; + } + + public VirtualNetworkGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .updateTags(resourceGroupName, virtualNetworkGatewayName, updateParameters, context); + return this; + } + + VirtualNetworkGatewayImpl( + VirtualNetworkGatewayInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkGateways"); + } + + public VirtualNetworkGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, context) + .getValue(); + return this; + } + + public VirtualNetworkGateway reset(String gatewayVip) { + return serviceManager.virtualNetworkGateways().reset(resourceGroupName, virtualNetworkGatewayName, gatewayVip); + } + + public VirtualNetworkGateway reset() { + return serviceManager.virtualNetworkGateways().reset(resourceGroupName, virtualNetworkGatewayName); + } + + public VirtualNetworkGateway reset(String gatewayVip, Context context) { + return serviceManager + .virtualNetworkGateways() + .reset(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context); + } + + public void resetVpnClientSharedKey() { + serviceManager.virtualNetworkGateways().resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName); + } + + public void resetVpnClientSharedKey(Context context) { + serviceManager + .virtualNetworkGateways() + .resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, context); + } + + public String generatevpnclientpackage(VpnClientParameters parameters) { + return serviceManager + .virtualNetworkGateways() + .generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String generatevpnclientpackage(VpnClientParameters parameters, Context context) { + return serviceManager + .virtualNetworkGateways() + .generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String generateVpnProfile(VpnClientParameters parameters) { + return serviceManager + .virtualNetworkGateways() + .generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String generateVpnProfile(VpnClientParameters parameters, Context context) { + return serviceManager + .virtualNetworkGateways() + .generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String getVpnProfilePackageUrl() { + return serviceManager + .virtualNetworkGateways() + .getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName); + } + + public String getVpnProfilePackageUrl(Context context) { + return serviceManager + .virtualNetworkGateways() + .getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, context); + } + + public BgpPeerStatusListResult getBgpPeerStatus(String peer) { + return serviceManager + .virtualNetworkGateways() + .getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer); + } + + public BgpPeerStatusListResult getBgpPeerStatus() { + return serviceManager.virtualNetworkGateways().getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName); + } + + public BgpPeerStatusListResult getBgpPeerStatus(String peer, Context context) { + return serviceManager + .virtualNetworkGateways() + .getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer, context); + } + + public String supportedVpnDevices() { + return serviceManager + .virtualNetworkGateways() + .supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName); + } + + public Response supportedVpnDevicesWithResponse(Context context) { + return serviceManager + .virtualNetworkGateways() + .supportedVpnDevicesWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + } + + public GatewayRouteListResult getLearnedRoutes() { + return serviceManager.virtualNetworkGateways().getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName); + } + + public GatewayRouteListResult getLearnedRoutes(Context context) { + return serviceManager + .virtualNetworkGateways() + .getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, context); + } + + public VpnClientIPsecParameters setVpnclientIpsecParameters(VpnClientIPsecParametersInner vpnclientIpsecParams) { + return serviceManager + .virtualNetworkGateways() + .setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams); + } + + public VpnClientIPsecParameters setVpnclientIpsecParameters( + VpnClientIPsecParametersInner vpnclientIpsecParams, Context context) { + return serviceManager + .virtualNetworkGateways() + .setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context); + } + + public VpnClientIPsecParameters getVpnclientIpsecParameters() { + return serviceManager + .virtualNetworkGateways() + .getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName); + } + + public VpnClientIPsecParameters getVpnclientIpsecParameters(Context context) { + return serviceManager + .virtualNetworkGateways() + .getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, context); + } + + public String startPacketCapture(VpnPacketCaptureStartParameters parameters) { + return serviceManager + .virtualNetworkGateways() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String startPacketCapture() { + return serviceManager.virtualNetworkGateways().startPacketCapture(resourceGroupName, virtualNetworkGatewayName); + } + + public String startPacketCapture(VpnPacketCaptureStartParameters parameters, Context context) { + return serviceManager + .virtualNetworkGateways() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String stopPacketCapture(VpnPacketCaptureStopParameters parameters) { + return serviceManager + .virtualNetworkGateways() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String stopPacketCapture(VpnPacketCaptureStopParameters parameters, Context context) { + return serviceManager + .virtualNetworkGateways() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth() { + return serviceManager + .virtualNetworkGateways() + .getVpnclientConnectionHealth(resourceGroupName, virtualNetworkGatewayName); + } + + public VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth(Context context) { + return serviceManager + .virtualNetworkGateways() + .getVpnclientConnectionHealth(resourceGroupName, virtualNetworkGatewayName, context); + } + + public void disconnectVirtualNetworkGatewayVpnConnections(P2SVpnConnectionRequest request) { + serviceManager + .virtualNetworkGateways() + .disconnectVirtualNetworkGatewayVpnConnections(resourceGroupName, virtualNetworkGatewayName, request); + } + + public void disconnectVirtualNetworkGatewayVpnConnections(P2SVpnConnectionRequest request, Context context) { + serviceManager + .virtualNetworkGateways() + .disconnectVirtualNetworkGatewayVpnConnections( + resourceGroupName, virtualNetworkGatewayName, request, context); + } + + public VirtualNetworkGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworkGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworkGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualNetworkGatewayImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualNetworkGatewayImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public VirtualNetworkGatewayImpl withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.innerModel().withGatewayType(gatewayType); + return this; + } + + public VirtualNetworkGatewayImpl withVpnType(VpnType vpnType) { + this.innerModel().withVpnType(vpnType); + return this; + } + + public VirtualNetworkGatewayImpl withVpnGatewayGeneration(VpnGatewayGeneration vpnGatewayGeneration) { + this.innerModel().withVpnGatewayGeneration(vpnGatewayGeneration); + return this; + } + + public VirtualNetworkGatewayImpl withEnableBgp(Boolean enableBgp) { + this.innerModel().withEnableBgp(enableBgp); + return this; + } + + public VirtualNetworkGatewayImpl withEnablePrivateIpAddress(Boolean enablePrivateIpAddress) { + this.innerModel().withEnablePrivateIpAddress(enablePrivateIpAddress); + return this; + } + + public VirtualNetworkGatewayImpl withActive(Boolean active) { + this.innerModel().withActive(active); + return this; + } + + public VirtualNetworkGatewayImpl withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.innerModel().withGatewayDefaultSite(gatewayDefaultSite); + return this; + } + + public VirtualNetworkGatewayImpl withSku(VirtualNetworkGatewaySku sku) { + this.innerModel().withSku(sku); + return this; + } + + public VirtualNetworkGatewayImpl withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.innerModel().withVpnClientConfiguration(vpnClientConfiguration); + return this; + } + + public VirtualNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.innerModel().withBgpSettings(bgpSettings); + return this; + } + + public VirtualNetworkGatewayImpl withCustomRoutes(AddressSpace customRoutes) { + this.innerModel().withCustomRoutes(customRoutes); + return this; + } + + public VirtualNetworkGatewayImpl withEnableDnsForwarding(Boolean enableDnsForwarding) { + this.innerModel().withEnableDnsForwarding(enableDnsForwarding); + return this; + } + + public VirtualNetworkGatewayImpl withVNetExtendedLocationResourceId(String vNetExtendedLocationResourceId) { + this.innerModel().withVNetExtendedLocationResourceId(vNetExtendedLocationResourceId); + return this; + } + + public VirtualNetworkGatewayImpl withNatRules(List natRules) { + this.innerModel().withNatRules(natRules); + return this; + } + + public VirtualNetworkGatewayImpl withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat) { + this.innerModel().withEnableBgpRouteTranslationForNat(enableBgpRouteTranslationForNat); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRuleImpl.java new file mode 100644 index 0000000000000..a2f66b3d7dccc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRuleImpl.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.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import java.util.Collections; +import java.util.List; + +public final class VirtualNetworkGatewayNatRuleImpl + implements VirtualNetworkGatewayNatRule, + VirtualNetworkGatewayNatRule.Definition, + VirtualNetworkGatewayNatRule.Update { + private VirtualNetworkGatewayNatRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VpnNatRuleType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public VpnNatRuleMode mode() { + return this.innerModel().mode(); + } + + public List internalMappings() { + List inner = this.innerModel().internalMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List externalMappings() { + List inner = this.innerModel().externalMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String ipConfigurationId() { + return this.innerModel().ipConfigurationId(); + } + + public VirtualNetworkGatewayNatRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkGatewayName; + + private String natRuleName; + + public VirtualNetworkGatewayNatRuleImpl withExistingVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkGatewayName = virtualNetworkGatewayName; + return this; + } + + public VirtualNetworkGatewayNatRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .createOrUpdate( + resourceGroupName, virtualNetworkGatewayName, natRuleName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworkGatewayNatRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayName, natRuleName, this.innerModel(), context); + return this; + } + + VirtualNetworkGatewayNatRuleImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkGatewayNatRuleInner(); + this.serviceManager = serviceManager; + this.natRuleName = name; + } + + public VirtualNetworkGatewayNatRuleImpl update() { + return this; + } + + public VirtualNetworkGatewayNatRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .createOrUpdate( + resourceGroupName, virtualNetworkGatewayName, natRuleName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworkGatewayNatRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayName, natRuleName, this.innerModel(), context); + return this; + } + + VirtualNetworkGatewayNatRuleImpl( + VirtualNetworkGatewayNatRuleInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkGateways"); + this.natRuleName = Utils.getValueFromIdByName(innerObject.id(), "natRules"); + } + + public VirtualNetworkGatewayNatRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkGatewayNatRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, context) + .getValue(); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withTypePropertiesType(VpnNatRuleType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withMode(VpnNatRuleMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withInternalMappings(List internalMappings) { + this.innerModel().withInternalMappings(internalMappings); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withExternalMappings(List externalMappings) { + this.innerModel().withExternalMappings(externalMappings); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withIpConfigurationId(String ipConfigurationId) { + this.innerModel().withIpConfigurationId(ipConfigurationId); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java new file mode 100644 index 0000000000000..f7fe443830d3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java @@ -0,0 +1,1194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkGatewayNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualNetworkGatewayNatRulesResult; +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 VirtualNetworkGatewayNatRulesClient. */ +public final class VirtualNetworkGatewayNatRulesClientImpl implements VirtualNetworkGatewayNatRulesClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayNatRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkGatewayNatRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewayNatRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkGatewayNatRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualNetworkGatewayNatRulesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkGatewayNatRules to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkGatewayNatRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualNetworkGatewayNatRuleInner natRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVirtualNetworkGateway( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVirtualNetworkGatewayNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + natRuleName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, 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 (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + natRuleName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName) { + return getWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayNatRuleInner get( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName) { + return getAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).block(); + } + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, context).block(); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + if (natRuleParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter natRuleParameters is required and cannot be null.")); + } else { + natRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + natRuleName, + apiVersion, + natRuleParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters, + 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 (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + if (natRuleParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter natRuleParameters is required and cannot be null.")); + } else { + natRuleParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + natRuleName, + apiVersion, + natRuleParameters, + accept, + context); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayNatRuleInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayNatRuleInner.class, + VirtualNetworkGatewayNatRuleInner.class, + Context.NONE); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayNatRuleInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayNatRuleInner.class, + VirtualNetworkGatewayNatRuleInner.class, + context); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayNatRuleInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters) + .getSyncPoller(); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayNatRuleInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayNatRuleInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters) + .block(); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayNatRuleInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, context) + .block(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, String natRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + natRuleName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, String natRuleName, 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 (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (natRuleName == null) { + return Mono.error(new IllegalArgumentException("Parameter natRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + natRuleName, + apiVersion, + accept, + context); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, String natRuleName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, String natRuleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, String natRuleName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).getSyncPoller(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, String natRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, context).getSyncPoller(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, String natRuleName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, String natRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkGatewayName, String natRuleName) { + deleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).block(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkGatewayName, String natRuleName, Context context) { + deleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, context).block(); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualNetworkGatewaySinglePageAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByVirtualNetworkGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + 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())); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualNetworkGatewaySinglePageAsync( + String resourceGroupName, String virtualNetworkGatewayName, 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 (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVirtualNetworkGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualNetworkGatewayAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + return new PagedFlux<>( + () -> listByVirtualNetworkGatewaySinglePageAsync(resourceGroupName, virtualNetworkGatewayName), + nextLink -> listByVirtualNetworkGatewayNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualNetworkGatewayAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return new PagedFlux<>( + () -> listByVirtualNetworkGatewaySinglePageAsync(resourceGroupName, virtualNetworkGatewayName, context), + nextLink -> listByVirtualNetworkGatewayNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName) { + return new PagedIterable<>(listByVirtualNetworkGatewayAsync(resourceGroupName, virtualNetworkGatewayName)); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return new PagedIterable<>( + listByVirtualNetworkGatewayAsync(resourceGroupName, virtualNetworkGatewayName, 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 result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualNetworkGatewayNextSinglePageAsync( + 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.listByVirtualNetworkGatewayNext(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 result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualNetworkGatewayNextSinglePageAsync( + 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 + .listByVirtualNetworkGatewayNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesImpl.java new file mode 100644 index 0000000000000..42d829b9e8325 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkGatewayNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkGatewayNatRulesImpl implements VirtualNetworkGatewayNatRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayNatRulesImpl.class); + + private final VirtualNetworkGatewayNatRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkGatewayNatRulesImpl( + VirtualNetworkGatewayNatRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualNetworkGatewayNatRule get( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName) { + VirtualNetworkGatewayNatRuleInner inner = + this.serviceClient().get(resourceGroupName, virtualNetworkGatewayName, natRuleName); + if (inner != null) { + return new VirtualNetworkGatewayNatRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkGatewayNatRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualNetworkGatewayName, String natRuleName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayName, natRuleName); + } + + public void delete( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + } + + public PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName) { + PagedIterable inner = + this.serviceClient().listByVirtualNetworkGateway(resourceGroupName, virtualNetworkGatewayName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayNatRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listByVirtualNetworkGateway(resourceGroupName, virtualNetworkGatewayName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayNatRuleImpl(inner1, this.manager())); + } + + public VirtualNetworkGatewayNatRule 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 virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, 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 virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, 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 virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, natRuleName, 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 virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + } + + private VirtualNetworkGatewayNatRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkGatewayNatRuleImpl define(String name) { + return new VirtualNetworkGatewayNatRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java new file mode 100644 index 0000000000000..9687ac3ecf362 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java @@ -0,0 +1,6250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayListConnectionsResult; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayListResult; +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; +import com.azure.resourcemanager.network.generated.models.VpnDeviceScriptParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +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 VirtualNetworkGatewaysClient. */ +public final class VirtualNetworkGatewaysClientImpl implements VirtualNetworkGatewaysClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualNetworkGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkGateways to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkGatewaysService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkGatewayInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/connections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConnections( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reset( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("gatewayVip") String gatewayVip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetVpnClientSharedKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generatevpnclientpackage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnClientParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateVpnProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnClientParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getVpnProfilePackageUrl( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getBgpPeerStatus( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("peer") String peer, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> supportedVpnDevices( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getLearnedRoutes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getAdvertisedRoutes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("peer") String peer, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setVpnclientIpsecParameters( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnClientIPsecParametersInner vpnclientIpsecParams, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getVpnclientIpsecParameters( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> vpnDeviceConfigurationScript( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnDeviceScriptParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> startPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnPacketCaptureStartParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> stopPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnPacketCaptureStopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getVpnclientConnectionHealth( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disconnectVirtualNetworkGatewayVpnConnections( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") P2SVpnConnectionRequest request, + @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> listConnectionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VirtualNetworkGatewayInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayInner.class, + VirtualNetworkGatewayInner.class, + Context.NONE); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VirtualNetworkGatewayInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayInner.class, + VirtualNetworkGatewayInner.class, + context); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + VirtualNetworkGatewayInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VirtualNetworkGatewayInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner createOrUpdate( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner createOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + VirtualNetworkGatewayInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkGatewayName) { + deleteAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkGatewayName, Context context) { + deleteAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayInner> beginUpdateTagsAsync( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayInner.class, + VirtualNetworkGatewayInner.class, + Context.NONE); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayInner> beginUpdateTagsAsync( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayInner.class, + VirtualNetworkGatewayInner.class, + context); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).getSyncPoller(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner updateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner updateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { + return updateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConnectionsSinglePageAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listConnections( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConnectionsSinglePageAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listConnections( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listConnectionsAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + return new PagedFlux<>( + () -> listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName), + nextLink -> listConnectionsNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listConnectionsAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return new PagedFlux<>( + () -> listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName, context), + nextLink -> listConnectionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName) { + return new PagedIterable<>(listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return new PagedIterable<>(listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName, context)); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reset( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + gatewayVip, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reset( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + gatewayVip, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayInner> beginResetAsync( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + Mono>> mono = + resetWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayInner.class, + VirtualNetworkGatewayInner.class, + Context.NONE); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkGatewayInner> beginResetAsync( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkGatewayInner.class, + VirtualNetworkGatewayInner.class, + context); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayInner> beginReset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).getSyncPoller(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkGatewayInner> beginReset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context).getSyncPoller(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + final String gatewayVip = null; + return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).block(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName) { + final String gatewayVip = null; + return resetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).block(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + return resetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context).block(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> resetVpnClientSharedKeyWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetVpnClientSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> resetVpnClientSharedKeyWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetVpnClientSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetVpnClientSharedKeyAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + Mono>> mono = + resetVpnClientSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetVpnClientSharedKeyAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetVpnClientSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetVpnClientSharedKey( + String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetVpnClientSharedKey( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resetVpnClientSharedKeyAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + resetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + resetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> generatevpnclientpackageWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generatevpnclientpackage( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> generatevpnclientpackageWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generatevpnclientpackage( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginGeneratevpnclientpackageAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + Mono>> mono = + generatevpnclientpackageWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginGeneratevpnclientpackageAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + generatevpnclientpackageWithResponseAsync( + resourceGroupName, virtualNetworkGatewayName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginGeneratevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + .getSyncPoller(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginGeneratevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono generatevpnclientpackageAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono generatevpnclientpackageAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> generateVpnProfileWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateVpnProfile( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> generateVpnProfileWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateVpnProfile( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginGenerateVpnProfileAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + Mono>> mono = + generateVpnProfileWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginGenerateVpnProfileAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + generateVpnProfileWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginGenerateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginGenerateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono generateVpnProfileAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono generateVpnProfileAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getVpnProfilePackageUrlWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVpnProfilePackageUrl( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getVpnProfilePackageUrlWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVpnProfilePackageUrl( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, String> beginGetVpnProfilePackageUrlAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + Mono>> mono = + getVpnProfilePackageUrlWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, String> beginGetVpnProfilePackageUrlAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getVpnProfilePackageUrlWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, String> beginGetVpnProfilePackageUrl( + String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, String> beginGetVpnProfilePackageUrl( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVpnProfilePackageUrlAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getBgpPeerStatusWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBgpPeerStatus( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + peer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getBgpPeerStatusWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBgpPeerStatus( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + peer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BgpPeerStatusListResultInner> + beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + Mono>> mono = + getBgpPeerStatusWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BgpPeerStatusListResultInner.class, + BgpPeerStatusListResultInner.class, + Context.NONE); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BgpPeerStatusListResultInner> + beginGetBgpPeerStatusAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getBgpPeerStatusWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BgpPeerStatusListResultInner.class, + BgpPeerStatusListResultInner.class, + context); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).getSyncPoller(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer, context).getSyncPoller(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBgpPeerStatusAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBgpPeerStatusAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + final String peer = null; + return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBgpPeerStatusAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpPeerStatusListResultInner getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).block(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + final String peer = null; + return getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).block(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpPeerStatusListResultInner getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer, context).block(); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> supportedVpnDevicesWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .supportedVpnDevices( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> supportedVpnDevicesWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .supportedVpnDevices( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response supportedVpnDevicesWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return supportedVpnDevicesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getLearnedRoutesWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLearnedRoutes( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getLearnedRoutesWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLearnedRoutes( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GatewayRouteListResultInner> beginGetLearnedRoutesAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + Mono>> mono = + getLearnedRoutesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayRouteListResultInner.class, + GatewayRouteListResultInner.class, + Context.NONE); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GatewayRouteListResultInner> beginGetLearnedRoutesAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getLearnedRoutesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayRouteListResultInner.class, + GatewayRouteListResultInner.class, + context); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLearnedRoutesAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLearnedRoutesAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return getLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayRouteListResultInner getLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return getLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getAdvertisedRoutesWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (peer == null) { + return Mono.error(new IllegalArgumentException("Parameter peer is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAdvertisedRoutes( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + peer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getAdvertisedRoutesWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (peer == null) { + return Mono.error(new IllegalArgumentException("Parameter peer is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAdvertisedRoutes( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + peer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GatewayRouteListResultInner> + beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + Mono>> mono = + getAdvertisedRoutesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayRouteListResultInner.class, + GatewayRouteListResultInner.class, + Context.NONE); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GatewayRouteListResultInner> + beginGetAdvertisedRoutesAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getAdvertisedRoutesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayRouteListResultInner.class, + GatewayRouteListResultInner.class, + context); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).getSyncPoller(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer, context) + .getSyncPoller(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAdvertisedRoutesAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAdvertisedRoutesAsync( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayRouteListResultInner getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).block(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayRouteListResultInner getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return getAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer, context).block(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setVpnclientIpsecParametersWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (vpnclientIpsecParams == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null.")); + } else { + vpnclientIpsecParams.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setVpnclientIpsecParameters( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + vpnclientIpsecParams, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setVpnclientIpsecParametersWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (vpnclientIpsecParams == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null.")); + } else { + vpnclientIpsecParams.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setVpnclientIpsecParameters( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + vpnclientIpsecParams, + accept, + context); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParametersAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams) { + Mono>> mono = + setVpnclientIpsecParametersWithResponseAsync( + resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnClientIPsecParametersInner.class, + VpnClientIPsecParametersInner.class, + Context.NONE); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParametersAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + setVpnclientIpsecParametersWithResponseAsync( + resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnClientIPsecParametersInner.class, + VpnClientIPsecParametersInner.class, + context); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) + .getSyncPoller(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context) { + return beginSetVpnclientIpsecParametersAsync( + resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context) + .getSyncPoller(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setVpnclientIpsecParametersAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setVpnclientIpsecParametersAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context) { + return beginSetVpnclientIpsecParametersAsync( + resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnClientIPsecParametersInner setVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams) { + return setVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) + .block(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnClientIPsecParametersInner setVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context) { + return setVpnclientIpsecParametersAsync( + resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context) + .block(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getVpnclientIpsecParametersWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVpnclientIpsecParameters( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getVpnclientIpsecParametersWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVpnclientIpsecParameters( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + Mono>> mono = + getVpnclientIpsecParametersWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnClientIPsecParametersInner.class, + VpnClientIPsecParametersInner.class, + Context.NONE); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParametersAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getVpnclientIpsecParametersWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnClientIPsecParametersInner.class, + VpnClientIPsecParametersInner.class, + context); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, context) + .getSyncPoller(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVpnclientIpsecParametersAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVpnclientIpsecParametersAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnClientIPsecParametersInner getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnClientIPsecParametersInner getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return getVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> vpnDeviceConfigurationScriptWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .vpnDeviceConfigurationScript( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> vpnDeviceConfigurationScriptWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .vpnDeviceConfigurationScript( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono vpnDeviceConfigurationScriptAsync( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithResponseAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String vpnDeviceConfigurationScript( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .block(); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response vpnDeviceConfigurationScriptWithResponse( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters, + Context context) { + return vpnDeviceConfigurationScriptWithResponseAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .block(); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono>> startPacketCaptureWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono>> startPacketCaptureWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private PollerFlux, String> beginStartPacketCaptureAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters) { + Mono>> mono = + startPacketCaptureWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private PollerFlux, String> beginStartPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startPacketCaptureWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono startPacketCaptureAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono startPacketCaptureAsync(String resourceGroupName, String virtualNetworkGatewayName) { + final VpnPacketCaptureStartParameters parameters = null; + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono startPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String startPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters) { + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayName) { + final VpnPacketCaptureStartParameters parameters = null; + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono>> stopPacketCaptureWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono>> stopPacketCaptureWithResponseAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private PollerFlux, String> beginStopPacketCaptureAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) { + Mono>> mono = + stopPacketCaptureWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private PollerFlux, String> beginStopPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopPacketCaptureWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono stopPacketCaptureAsync( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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) + private Mono stopPacketCaptureAsync( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String stopPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) { + return stopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return stopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getVpnclientConnectionHealthWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVpnclientConnectionHealth( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getVpnclientConnectionHealthWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVpnclientConnectionHealth( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealthAsync(String resourceGroupName, String virtualNetworkGatewayName) { + Mono>> mono = + getVpnclientConnectionHealthWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + VpnClientConnectionHealthDetailListResultInner.class, + VpnClientConnectionHealthDetailListResultInner.class, + Context.NONE); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealthAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getVpnclientConnectionHealthWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + VpnClientConnectionHealthDetailListResultInner.class, + VpnClientConnectionHealthDetailListResultInner.class, + context); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName, context) + .getSyncPoller(); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVpnclientConnectionHealthAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVpnclientConnectionHealthAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnClientConnectionHealthDetailListResultInner getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnClientConnectionHealthDetailListResultInner getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return getVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> disconnectVirtualNetworkGatewayVpnConnectionsWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disconnectVirtualNetworkGatewayVpnConnections( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + request, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> disconnectVirtualNetworkGatewayVpnConnectionsWithResponseAsync( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, 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 (virtualNetworkGatewayName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkGatewayName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disconnectVirtualNetworkGatewayVpnConnections( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + request, + accept, + context); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisconnectVirtualNetworkGatewayVpnConnectionsAsync( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request) { + Mono>> mono = + disconnectVirtualNetworkGatewayVpnConnectionsWithResponseAsync( + resourceGroupName, virtualNetworkGatewayName, request); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisconnectVirtualNetworkGatewayVpnConnectionsAsync( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disconnectVirtualNetworkGatewayVpnConnectionsWithResponseAsync( + resourceGroupName, virtualNetworkGatewayName, request, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request) { + return beginDisconnectVirtualNetworkGatewayVpnConnectionsAsync( + resourceGroupName, virtualNetworkGatewayName, request) + .getSyncPoller(); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context) { + return beginDisconnectVirtualNetworkGatewayVpnConnectionsAsync( + resourceGroupName, virtualNetworkGatewayName, request, context) + .getSyncPoller(); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 disconnectVirtualNetworkGatewayVpnConnectionsAsync( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request) { + return beginDisconnectVirtualNetworkGatewayVpnConnectionsAsync( + resourceGroupName, virtualNetworkGatewayName, request) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 disconnectVirtualNetworkGatewayVpnConnectionsAsync( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context) { + return beginDisconnectVirtualNetworkGatewayVpnConnectionsAsync( + resourceGroupName, virtualNetworkGatewayName, request, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request) { + disconnectVirtualNetworkGatewayVpnConnectionsAsync(resourceGroupName, virtualNetworkGatewayName, request) + .block(); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context) { + disconnectVirtualNetworkGatewayVpnConnectionsAsync( + resourceGroupName, virtualNetworkGatewayName, request, 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 response for the ListVirtualNetworkGateways API service call. + */ + @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 response for the ListVirtualNetworkGateways API service call. + */ + @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 response for the VirtualNetworkGatewayListConnections API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConnectionsNextSinglePageAsync( + 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.listConnectionsNext(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 response for the VirtualNetworkGatewayListConnections API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConnectionsNextSinglePageAsync( + 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 + .listConnectionsNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysImpl.java new file mode 100644 index 0000000000000..4bab5cf73a7a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysImpl.java @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatusListResult; +import com.azure.resourcemanager.network.generated.models.GatewayRouteListResult; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionListEntity; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateways; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetailListResult; +import com.azure.resourcemanager.network.generated.models.VpnClientIPsecParameters; +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; +import com.azure.resourcemanager.network.generated.models.VpnDeviceScriptParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkGatewaysImpl implements VirtualNetworkGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewaysImpl.class); + + private final VirtualNetworkGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkGatewaysImpl( + VirtualNetworkGatewaysClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualNetworkGateway getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewayInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayName); + } + + public void delete(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName) { + PagedIterable inner = + this.serviceClient().listConnections(resourceGroupName, virtualNetworkGatewayName); + return Utils + .mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionListEntityImpl(inner1, this.manager())); + } + + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listConnections(resourceGroupName, virtualNetworkGatewayName, context); + return Utils + .mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionListEntityImpl(inner1, this.manager())); + } + + public VirtualNetworkGateway reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + VirtualNetworkGatewayInner inner = + this.serviceClient().reset(resourceGroupName, virtualNetworkGatewayName, gatewayVip); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualNetworkGateway reset(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewayInner inner = this.serviceClient().reset(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualNetworkGateway reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + VirtualNetworkGatewayInner inner = + this.serviceClient().reset(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + this.serviceClient().resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName); + } + + public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + this.serviceClient().resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, context); + } + + public String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return this.serviceClient().generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return this + .serviceClient() + .generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return this.serviceClient().generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return this + .serviceClient() + .generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return this.serviceClient().getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName); + } + + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return this.serviceClient().getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, context); + } + + public BgpPeerStatusListResult getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + BgpPeerStatusListResultInner inner = + this.serviceClient().getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer); + if (inner != null) { + return new BgpPeerStatusListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public BgpPeerStatusListResult getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + BgpPeerStatusListResultInner inner = + this.serviceClient().getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new BgpPeerStatusListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public BgpPeerStatusListResult getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + BgpPeerStatusListResultInner inner = + this.serviceClient().getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer, context); + if (inner != null) { + return new BgpPeerStatusListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return this.serviceClient().supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName); + } + + public Response supportedVpnDevicesWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return this + .serviceClient() + .supportedVpnDevicesWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + } + + public GatewayRouteListResult getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + GatewayRouteListResultInner inner = + this.serviceClient().getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new GatewayRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public GatewayRouteListResult getLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + GatewayRouteListResultInner inner = + this.serviceClient().getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, context); + if (inner != null) { + return new GatewayRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public GatewayRouteListResult getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + GatewayRouteListResultInner inner = + this.serviceClient().getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer); + if (inner != null) { + return new GatewayRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public GatewayRouteListResult getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + GatewayRouteListResultInner inner = + this.serviceClient().getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, context); + if (inner != null) { + return new GatewayRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientIPsecParameters setVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams) { + VpnClientIPsecParametersInner inner = + this + .serviceClient() + .setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams); + if (inner != null) { + return new VpnClientIPsecParametersImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientIPsecParameters setVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context) { + VpnClientIPsecParametersInner inner = + this + .serviceClient() + .setVpnclientIpsecParameters( + resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context); + if (inner != null) { + return new VpnClientIPsecParametersImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientIPsecParameters getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName) { + VpnClientIPsecParametersInner inner = + this.serviceClient().getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new VpnClientIPsecParametersImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientIPsecParameters getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + VpnClientIPsecParametersInner inner = + this.serviceClient().getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, context); + if (inner != null) { + return new VpnClientIPsecParametersImpl(inner, this.manager()); + } else { + return null; + } + } + + public String vpnDeviceConfigurationScript( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return this + .serviceClient() + .vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public Response vpnDeviceConfigurationScriptWithResponse( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters, + Context context) { + return this + .serviceClient() + .vpnDeviceConfigurationScriptWithResponse( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String startPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters) { + return this.serviceClient().startPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayName) { + return this.serviceClient().startPacketCapture(resourceGroupName, virtualNetworkGatewayName); + } + + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return this + .serviceClient() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String stopPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) { + return this.serviceClient().stopPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName) { + VpnClientConnectionHealthDetailListResultInner inner = + this.serviceClient().getVpnclientConnectionHealth(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new VpnClientConnectionHealthDetailListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + VpnClientConnectionHealthDetailListResultInner inner = + this.serviceClient().getVpnclientConnectionHealth(resourceGroupName, virtualNetworkGatewayName, context); + if (inner != null) { + return new VpnClientConnectionHealthDetailListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request) { + this + .serviceClient() + .disconnectVirtualNetworkGatewayVpnConnections(resourceGroupName, virtualNetworkGatewayName, request); + } + + public void disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context) { + this + .serviceClient() + .disconnectVirtualNetworkGatewayVpnConnections( + resourceGroupName, virtualNetworkGatewayName, request, context); + } + + public VirtualNetworkGateway 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 virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, 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 virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, 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 virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, 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 virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, context); + } + + private VirtualNetworkGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkGatewayImpl define(String name) { + return new VirtualNetworkGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.java new file mode 100644 index 0000000000000..9b042b0f9f5de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.DhcpOptions; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetwork; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeering; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualNetworkImpl implements VirtualNetwork, VirtualNetwork.Definition, VirtualNetwork.Update { + private VirtualNetworkInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public AddressSpace addressSpace() { + return this.innerModel().addressSpace(); + } + + public DhcpOptions dhcpOptions() { + return this.innerModel().dhcpOptions(); + } + + public Integer flowTimeoutInMinutes() { + return this.innerModel().flowTimeoutInMinutes(); + } + + public List subnets() { + List inner = this.innerModel().subnets(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new SubnetImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List virtualNetworkPeerings() { + List inner = this.innerModel().virtualNetworkPeerings(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualNetworkPeeringImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean enableDdosProtection() { + return this.innerModel().enableDdosProtection(); + } + + public Boolean enableVmProtection() { + return this.innerModel().enableVmProtection(); + } + + public SubResource ddosProtectionPlan() { + return this.innerModel().ddosProtectionPlan(); + } + + public VirtualNetworkBgpCommunities bgpCommunities() { + return this.innerModel().bgpCommunities(); + } + + public List ipAllocations() { + List inner = this.innerModel().ipAllocations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkName; + + private TagsObject updateParameters; + + public VirtualNetworkImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .createOrUpdate(resourceGroupName, virtualNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .createOrUpdate(resourceGroupName, virtualNetworkName, this.innerModel(), context); + return this; + } + + VirtualNetworkImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkInner(); + this.serviceManager = serviceManager; + this.virtualNetworkName = name; + } + + public VirtualNetworkImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public VirtualNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .updateTagsWithResponse(resourceGroupName, virtualNetworkName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .updateTagsWithResponse(resourceGroupName, virtualNetworkName, updateParameters, context) + .getValue(); + return this; + } + + VirtualNetworkImpl( + VirtualNetworkInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + } + + public VirtualNetwork refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetwork refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, localExpand, context) + .getValue(); + return this; + } + + public VirtualNetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualNetworkImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualNetworkImpl withAddressSpace(AddressSpace addressSpace) { + this.innerModel().withAddressSpace(addressSpace); + return this; + } + + public VirtualNetworkImpl withDhcpOptions(DhcpOptions dhcpOptions) { + this.innerModel().withDhcpOptions(dhcpOptions); + return this; + } + + public VirtualNetworkImpl withFlowTimeoutInMinutes(Integer flowTimeoutInMinutes) { + this.innerModel().withFlowTimeoutInMinutes(flowTimeoutInMinutes); + return this; + } + + public VirtualNetworkImpl withSubnets(List subnets) { + this.innerModel().withSubnets(subnets); + return this; + } + + public VirtualNetworkImpl withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.innerModel().withVirtualNetworkPeerings(virtualNetworkPeerings); + return this; + } + + public VirtualNetworkImpl withEnableDdosProtection(Boolean enableDdosProtection) { + this.innerModel().withEnableDdosProtection(enableDdosProtection); + return this; + } + + public VirtualNetworkImpl withEnableVmProtection(Boolean enableVmProtection) { + this.innerModel().withEnableVmProtection(enableVmProtection); + return this; + } + + public VirtualNetworkImpl withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.innerModel().withDdosProtectionPlan(ddosProtectionPlan); + return this; + } + + public VirtualNetworkImpl withBgpCommunities(VirtualNetworkBgpCommunities bgpCommunities) { + this.innerModel().withBgpCommunities(bgpCommunities); + return this; + } + + public VirtualNetworkImpl withIpAllocations(List ipAllocations) { + this.innerModel().withIpAllocations(ipAllocations); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringImpl.java new file mode 100644 index 0000000000000..353ebe6593530 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringImpl.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SyncRemoteAddressSpace; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeering; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringLevel; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringState; + +public final class VirtualNetworkPeeringImpl + implements VirtualNetworkPeering, VirtualNetworkPeering.Definition, VirtualNetworkPeering.Update { + private VirtualNetworkPeeringInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean allowVirtualNetworkAccess() { + return this.innerModel().allowVirtualNetworkAccess(); + } + + public Boolean allowForwardedTraffic() { + return this.innerModel().allowForwardedTraffic(); + } + + public Boolean allowGatewayTransit() { + return this.innerModel().allowGatewayTransit(); + } + + public Boolean useRemoteGateways() { + return this.innerModel().useRemoteGateways(); + } + + public SubResource remoteVirtualNetwork() { + return this.innerModel().remoteVirtualNetwork(); + } + + public AddressSpace remoteAddressSpace() { + return this.innerModel().remoteAddressSpace(); + } + + public AddressSpace remoteVirtualNetworkAddressSpace() { + return this.innerModel().remoteVirtualNetworkAddressSpace(); + } + + public VirtualNetworkBgpCommunities remoteBgpCommunities() { + return this.innerModel().remoteBgpCommunities(); + } + + public VirtualNetworkPeeringState peeringState() { + return this.innerModel().peeringState(); + } + + public VirtualNetworkPeeringLevel peeringSyncLevel() { + return this.innerModel().peeringSyncLevel(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean doNotVerifyRemoteGateways() { + return this.innerModel().doNotVerifyRemoteGateways(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public VirtualNetworkPeeringInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkName; + + private String virtualNetworkPeeringName; + + private SyncRemoteAddressSpace createSyncRemoteAddressSpace; + + private SyncRemoteAddressSpace updateSyncRemoteAddressSpace; + + public VirtualNetworkPeeringImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + public VirtualNetworkPeering create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkPeerings() + .createOrUpdate( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + this.innerModel(), + createSyncRemoteAddressSpace, + Context.NONE); + return this; + } + + public VirtualNetworkPeering create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkPeerings() + .createOrUpdate( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + this.innerModel(), + createSyncRemoteAddressSpace, + context); + return this; + } + + VirtualNetworkPeeringImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkPeeringInner(); + this.serviceManager = serviceManager; + this.virtualNetworkPeeringName = name; + this.createSyncRemoteAddressSpace = null; + } + + public VirtualNetworkPeeringImpl update() { + this.updateSyncRemoteAddressSpace = null; + return this; + } + + public VirtualNetworkPeering apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkPeerings() + .createOrUpdate( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + this.innerModel(), + updateSyncRemoteAddressSpace, + Context.NONE); + return this; + } + + public VirtualNetworkPeering apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkPeerings() + .createOrUpdate( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + this.innerModel(), + updateSyncRemoteAddressSpace, + context); + return this; + } + + VirtualNetworkPeeringImpl( + VirtualNetworkPeeringInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + this.virtualNetworkPeeringName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkPeerings"); + } + + public VirtualNetworkPeering refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkPeerings() + .getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkPeering refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkPeerings() + .getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context) + .getValue(); + return this; + } + + public VirtualNetworkPeeringImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualNetworkPeeringImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public VirtualNetworkPeeringImpl withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.innerModel().withAllowVirtualNetworkAccess(allowVirtualNetworkAccess); + return this; + } + + public VirtualNetworkPeeringImpl withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.innerModel().withAllowForwardedTraffic(allowForwardedTraffic); + return this; + } + + public VirtualNetworkPeeringImpl withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.innerModel().withAllowGatewayTransit(allowGatewayTransit); + return this; + } + + public VirtualNetworkPeeringImpl withUseRemoteGateways(Boolean useRemoteGateways) { + this.innerModel().withUseRemoteGateways(useRemoteGateways); + return this; + } + + public VirtualNetworkPeeringImpl withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.innerModel().withRemoteVirtualNetwork(remoteVirtualNetwork); + return this; + } + + public VirtualNetworkPeeringImpl withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.innerModel().withRemoteAddressSpace(remoteAddressSpace); + return this; + } + + public VirtualNetworkPeeringImpl withRemoteVirtualNetworkAddressSpace( + AddressSpace remoteVirtualNetworkAddressSpace) { + this.innerModel().withRemoteVirtualNetworkAddressSpace(remoteVirtualNetworkAddressSpace); + return this; + } + + public VirtualNetworkPeeringImpl withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities) { + this.innerModel().withRemoteBgpCommunities(remoteBgpCommunities); + return this; + } + + public VirtualNetworkPeeringImpl withPeeringState(VirtualNetworkPeeringState peeringState) { + this.innerModel().withPeeringState(peeringState); + return this; + } + + public VirtualNetworkPeeringImpl withPeeringSyncLevel(VirtualNetworkPeeringLevel peeringSyncLevel) { + this.innerModel().withPeeringSyncLevel(peeringSyncLevel); + return this; + } + + public VirtualNetworkPeeringImpl withDoNotVerifyRemoteGateways(Boolean doNotVerifyRemoteGateways) { + this.innerModel().withDoNotVerifyRemoteGateways(doNotVerifyRemoteGateways); + return this; + } + + public VirtualNetworkPeeringImpl withSyncRemoteAddressSpace(SyncRemoteAddressSpace syncRemoteAddressSpace) { + if (isInCreateMode()) { + this.createSyncRemoteAddressSpace = syncRemoteAddressSpace; + return this; + } else { + this.updateSyncRemoteAddressSpace = syncRemoteAddressSpace; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsClientImpl.java new file mode 100644 index 0000000000000..7c66145c0d1c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsClientImpl.java @@ -0,0 +1,1330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.azure.resourcemanager.network.generated.models.SyncRemoteAddressSpace; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringListResult; +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 VirtualNetworkPeeringsClient. */ +public final class VirtualNetworkPeeringsClientImpl implements VirtualNetworkPeeringsClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkPeeringsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkPeeringsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkPeeringsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualNetworkPeeringsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkPeerings to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkPeeringsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("virtualNetworkPeeringName") String virtualNetworkPeeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("virtualNetworkPeeringName") String virtualNetworkPeeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("virtualNetworkPeeringName") String virtualNetworkPeeringName, + @QueryParam("syncRemoteAddressSpace") SyncRemoteAddressSpace syncRemoteAddressSpace, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (virtualNetworkPeeringName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkPeeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (virtualNetworkPeeringName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkPeeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, String virtualNetworkPeeringName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkName, String virtualNetworkPeeringName) { + deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).block(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkName, String virtualNetworkPeeringName, Context context) { + deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context).block(); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (virtualNetworkPeeringName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkPeeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (virtualNetworkPeeringName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkPeeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkPeeringInner get( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).block(); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context).block(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (virtualNetworkPeeringName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkPeeringName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (virtualNetworkPeeringParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkPeeringParameters is required and cannot be null.")); + } else { + virtualNetworkPeeringParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + syncRemoteAddressSpace, + apiVersion, + this.client.getSubscriptionId(), + virtualNetworkPeeringParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (virtualNetworkPeeringName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkPeeringName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (virtualNetworkPeeringParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualNetworkPeeringParameters is required and cannot be null.")); + } else { + virtualNetworkPeeringParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + syncRemoteAddressSpace, + apiVersion, + this.client.getSubscriptionId(), + virtualNetworkPeeringParameters, + accept, + context); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkPeeringInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkPeeringInner.class, + VirtualNetworkPeeringInner.class, + Context.NONE); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkPeeringInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkPeeringInner.class, + VirtualNetworkPeeringInner.class, + context); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace) { + return beginCreateOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace, + context) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace) { + return beginCreateOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + final SyncRemoteAddressSpace syncRemoteAddressSpace = null; + return beginCreateOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace) { + return createOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace) + .block(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + final SyncRemoteAddressSpace syncRemoteAddressSpace = null; + return createOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace) + .block(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's 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 peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace, + context) + .block(); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualNetworkName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualNetworkName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualNetworkName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualNetworkName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName)); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName, 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 response for ListSubnets API service call. + */ + @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 response for ListSubnets API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsImpl.java new file mode 100644 index 0000000000000..c02c87bf7516f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeering; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeerings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkPeeringsImpl implements VirtualNetworkPeerings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringsImpl.class); + + private final VirtualNetworkPeeringsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkPeeringsImpl( + VirtualNetworkPeeringsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName); + } + + public void delete( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + } + + public VirtualNetworkPeering get( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringInner inner = + this.serviceClient().get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName); + if (inner != null) { + return new VirtualNetworkPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkPeeringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String virtualNetworkName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualNetworkName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualNetworkName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkPeeringImpl(inner1, this.manager())); + } + + public VirtualNetworkPeering 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + return this + .getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + } + + private VirtualNetworkPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkPeeringImpl define(String name) { + return new VirtualNetworkPeeringImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java new file mode 100644 index 0000000000000..76f43e272445c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualNetworkTapImpl + implements VirtualNetworkTap, VirtualNetworkTap.Definition, VirtualNetworkTap.Update { + private VirtualNetworkTapInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public List networkInterfaceTapConfigurations() { + List inner = this.innerModel().networkInterfaceTapConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkInterfaceTapConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkInterfaceIpConfiguration destinationNetworkInterfaceIpConfiguration() { + NetworkInterfaceIpConfigurationInner inner = this.innerModel().destinationNetworkInterfaceIpConfiguration(); + if (inner != null) { + return new NetworkInterfaceIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FrontendIpConfiguration destinationLoadBalancerFrontEndIpConfiguration() { + FrontendIpConfigurationInner inner = this.innerModel().destinationLoadBalancerFrontEndIpConfiguration(); + if (inner != null) { + return new FrontendIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Integer destinationPort() { + return this.innerModel().destinationPort(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualNetworkTapInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String tapName; + + private TagsObject updateTapParameters; + + public VirtualNetworkTapImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualNetworkTap create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkTaps() + .createOrUpdate(resourceGroupName, tapName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworkTap create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkTaps() + .createOrUpdate(resourceGroupName, tapName, this.innerModel(), context); + return this; + } + + VirtualNetworkTapImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkTapInner(); + this.serviceManager = serviceManager; + this.tapName = name; + } + + public VirtualNetworkTapImpl update() { + this.updateTapParameters = new TagsObject(); + return this; + } + + public VirtualNetworkTap apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkTaps() + .updateTagsWithResponse(resourceGroupName, tapName, updateTapParameters, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkTap apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkTaps() + .updateTagsWithResponse(resourceGroupName, tapName, updateTapParameters, context) + .getValue(); + return this; + } + + VirtualNetworkTapImpl( + VirtualNetworkTapInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.tapName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkTaps"); + } + + public VirtualNetworkTap refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkTaps() + .getByResourceGroupWithResponse(resourceGroupName, tapName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkTap refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkTaps() + .getByResourceGroupWithResponse(resourceGroupName, tapName, context) + .getValue(); + return this; + } + + public VirtualNetworkTapImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworkTapImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworkTapImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateTapParameters.withTags(tags); + return this; + } + } + + public VirtualNetworkTapImpl withDestinationNetworkInterfaceIpConfiguration( + NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration) { + this.innerModel().withDestinationNetworkInterfaceIpConfiguration(destinationNetworkInterfaceIpConfiguration); + return this; + } + + public VirtualNetworkTapImpl withDestinationLoadBalancerFrontEndIpConfiguration( + FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration) { + this + .innerModel() + .withDestinationLoadBalancerFrontEndIpConfiguration(destinationLoadBalancerFrontEndIpConfiguration); + return this; + } + + public VirtualNetworkTapImpl withDestinationPort(Integer destinationPort) { + this.innerModel().withDestinationPort(destinationPort); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsClientImpl.java new file mode 100644 index 0000000000000..96889a6a83cf9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsClientImpl.java @@ -0,0 +1,1439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkTapsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTapListResult; +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 VirtualNetworkTapsClient. */ +public final class VirtualNetworkTapsClientImpl implements VirtualNetworkTapsClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkTapsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkTapsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkTapsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkTapsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualNetworkTapsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkTaps to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkTapsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps/{tapName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("tapName") String tapName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps/{tapName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("tapName") String tapName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps/{tapName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("tapName") String tapName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkTapInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps/{tapName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("tapName") String tapName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject tapParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 tapName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (tapName == null) { + return Mono.error(new IllegalArgumentException("Parameter tapName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + tapName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 tapName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (tapName == null) { + return Mono.error(new IllegalArgumentException("Parameter tapName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + tapName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 tapName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, tapName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 tapName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, tapName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 tapName) { + return beginDeleteAsync(resourceGroupName, tapName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 tapName, Context context) { + return beginDeleteAsync(resourceGroupName, tapName, context).getSyncPoller(); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 tapName) { + return beginDeleteAsync(resourceGroupName, tapName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 tapName, Context context) { + return beginDeleteAsync(resourceGroupName, tapName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 tapName) { + deleteAsync(resourceGroupName, tapName).block(); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 tapName, Context context) { + deleteAsync(resourceGroupName, tapName, context).block(); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String tapName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (tapName == null) { + return Mono.error(new IllegalArgumentException("Parameter tapName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + tapName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String tapName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (tapName == null) { + return Mono.error(new IllegalArgumentException("Parameter tapName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + tapName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String tapName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, tapName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName) { + return getByResourceGroupAsync(resourceGroupName, tapName).block(); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String tapName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, tapName, context).block(); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (tapName == null) { + return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + tapName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (tapName == null) { + return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + tapName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkTapInner> beginCreateOrUpdateAsync( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, tapName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkTapInner.class, + VirtualNetworkTapInner.class, + Context.NONE); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkTapInner> beginCreateOrUpdateAsync( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, tapName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkTapInner.class, + VirtualNetworkTapInner.class, + context); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkTapInner createOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return createOrUpdateAsync(resourceGroupName, tapName, parameters).block(); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkTapInner createOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, tapName, parameters, context).block(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String tapName, TagsObject tapParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (tapName == null) { + return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tapParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter tapParameters is required and cannot be null.")); + } else { + tapParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + tapName, + apiVersion, + this.client.getSubscriptionId(), + tapParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String tapName, TagsObject tapParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (tapName == null) { + return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tapParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter tapParameters is required and cannot be null.")); + } else { + tapParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + tapName, + apiVersion, + this.client.getSubscriptionId(), + tapParameters, + accept, + context); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String tapName, TagsObject tapParameters) { + return updateTagsWithResponseAsync(resourceGroupName, tapName, tapParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName, TagsObject tapParameters) { + return updateTagsAsync(resourceGroupName, tapName, tapParameters).block(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String tapName, TagsObject tapParameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, tapName, tapParameters, context).block(); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the VirtualNetworkTaps 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 all the VirtualNetworkTaps in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the VirtualNetworkTaps 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 all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the VirtualNetworkTaps 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 all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response for ListVirtualNetworkTap API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for ListVirtualNetworkTap API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for ListVirtualNetworkTap API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for ListVirtualNetworkTap API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsImpl.java new file mode 100644 index 0000000000000..406b4498f48f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworkTapsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTaps; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkTapsImpl implements VirtualNetworkTaps { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapsImpl.class); + + private final VirtualNetworkTapsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkTapsImpl( + VirtualNetworkTapsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String tapName) { + this.serviceClient().delete(resourceGroupName, tapName); + } + + public void delete(String resourceGroupName, String tapName, Context context) { + this.serviceClient().delete(resourceGroupName, tapName, context); + } + + public VirtualNetworkTap getByResourceGroup(String resourceGroupName, String tapName) { + VirtualNetworkTapInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, tapName); + if (inner != null) { + return new VirtualNetworkTapImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String tapName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, tapName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkTapImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public VirtualNetworkTap 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 tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, tapName, 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 tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, tapName, 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 tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + this.delete(resourceGroupName, tapName, 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 tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + this.delete(resourceGroupName, tapName, context); + } + + private VirtualNetworkTapsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkTapImpl define(String name) { + return new VirtualNetworkTapImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.java new file mode 100644 index 0000000000000..8f914ecd9a315 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsage; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsageName; + +public final class VirtualNetworkUsageImpl implements VirtualNetworkUsage { + private VirtualNetworkUsageInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualNetworkUsageImpl( + VirtualNetworkUsageInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Double currentValue() { + return this.innerModel().currentValue(); + } + + public String id() { + return this.innerModel().id(); + } + + public Double limit() { + return this.innerModel().limit(); + } + + public VirtualNetworkUsageName name() { + return this.innerModel().name(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public VirtualNetworkUsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java new file mode 100644 index 0000000000000..213a294c85cde --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java @@ -0,0 +1,1947 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworksClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkListResult; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkListUsageResult; +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 VirtualNetworksClient. */ +public final class VirtualNetworksClientImpl implements VirtualNetworksClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworksService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkIpAddressAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("ipAddress") String ipAddress, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @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> 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> listUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, context).getSyncPoller(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkName) { + deleteAsync(resourceGroupName, virtualNetworkName).block(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualNetworkName, Context context) { + deleteAsync(resourceGroupName, virtualNetworkName, context).block(); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, virtualNetworkName, expand).block(); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, expand, context).block(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkInner.class, + VirtualNetworkInner.class, + Context.NONE); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualNetworkInner.class, VirtualNetworkInner.class, context); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).block(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkInner createOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters, context).block(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String virtualNetworkName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String virtualNetworkName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, virtualNetworkName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, virtualNetworkName, parameters).block(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, virtualNetworkName, parameters, context).block(); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all virtual networks 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 all virtual networks in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all virtual networks 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 all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all virtual networks 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 all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkIpAddressAvailabilityWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String ipAddress) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (ipAddress == null) { + return Mono.error(new IllegalArgumentException("Parameter ipAddress is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkIpAddressAvailability( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + ipAddress, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkIpAddressAvailabilityWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String ipAddress, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (ipAddress == null) { + return Mono.error(new IllegalArgumentException("Parameter ipAddress is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkIpAddressAvailability( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + ipAddress, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkIpAddressAvailabilityAsync( + String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIpAddressAvailabilityWithResponseAsync(resourceGroupName, virtualNetworkName, ipAddress) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpAddressAvailabilityResultInner checkIpAddressAvailability( + String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIpAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress).block(); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkIpAddressAvailabilityWithResponse( + String resourceGroupName, String virtualNetworkName, String ipAddress, Context context) { + return checkIpAddressAvailabilityWithResponseAsync(resourceGroupName, virtualNetworkName, ipAddress, context) + .block(); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsageSinglePageAsync( + String resourceGroupName, String virtualNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listUsage( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsageSinglePageAsync( + String resourceGroupName, String virtualNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listUsage( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUsageAsync(String resourceGroupName, String virtualNetworkName) { + return new PagedFlux<>( + () -> listUsageSinglePageAsync(resourceGroupName, virtualNetworkName), + nextLink -> listUsageNextSinglePageAsync(nextLink)); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUsageAsync( + String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedFlux<>( + () -> listUsageSinglePageAsync(resourceGroupName, virtualNetworkName, context), + nextLink -> listUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsage(String resourceGroupName, String virtualNetworkName) { + return new PagedIterable<>(listUsageAsync(resourceGroupName, virtualNetworkName)); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsage( + String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedIterable<>(listUsageAsync(resourceGroupName, virtualNetworkName, 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 response for the ListVirtualNetworks API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 response for the ListVirtualNetworks API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 response for the ListVirtualNetworks API service call. + */ + @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 response for the ListVirtualNetworks API service call. + */ + @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 response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsageNextSinglePageAsync(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.listUsageNext(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 response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsageNextSinglePageAsync( + 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 + .listUsageNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksImpl.java new file mode 100644 index 0000000000000..2640b458e1811 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualNetworksClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.azure.resourcemanager.network.generated.models.IpAddressAvailabilityResult; +import com.azure.resourcemanager.network.generated.models.VirtualNetwork; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsage; +import com.azure.resourcemanager.network.generated.models.VirtualNetworks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworksImpl implements VirtualNetworks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworksImpl.class); + + private final VirtualNetworksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworksImpl( + VirtualNetworksClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualNetworkName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName); + } + + public void delete(String resourceGroupName, String virtualNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, context); + } + + public VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + VirtualNetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkName); + if (inner != null) { + return new VirtualNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public IpAddressAvailabilityResult checkIpAddressAvailability( + String resourceGroupName, String virtualNetworkName, String ipAddress) { + IpAddressAvailabilityResultInner inner = + this.serviceClient().checkIpAddressAvailability(resourceGroupName, virtualNetworkName, ipAddress); + if (inner != null) { + return new IpAddressAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkIpAddressAvailabilityWithResponse( + String resourceGroupName, String virtualNetworkName, String ipAddress, Context context) { + Response inner = + this + .serviceClient() + .checkIpAddressAvailabilityWithResponse(resourceGroupName, virtualNetworkName, ipAddress, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpAddressAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listUsage(String resourceGroupName, String virtualNetworkName) { + PagedIterable inner = + this.serviceClient().listUsage(resourceGroupName, virtualNetworkName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkUsageImpl(inner1, this.manager())); + } + + public PagedIterable listUsage( + String resourceGroupName, String virtualNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().listUsage(resourceGroupName, virtualNetworkName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkUsageImpl(inner1, this.manager())); + } + + public VirtualNetwork 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, expand, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, 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 virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, context); + } + + private VirtualNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkImpl define(String name) { + return new VirtualNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.java new file mode 100644 index 0000000000000..e5ae6641bd6aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualRouter; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualRouterImpl implements VirtualRouter, VirtualRouter.Definition, VirtualRouter.Update { + private VirtualRouterInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public Long virtualRouterAsn() { + return this.innerModel().virtualRouterAsn(); + } + + public List virtualRouterIps() { + List inner = this.innerModel().virtualRouterIps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource hostedSubnet() { + return this.innerModel().hostedSubnet(); + } + + public SubResource hostedGateway() { + return this.innerModel().hostedGateway(); + } + + public List peerings() { + List inner = this.innerModel().peerings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualRouterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualRouterName; + + public VirtualRouterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualRouter create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .createOrUpdate(resourceGroupName, virtualRouterName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualRouter create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .createOrUpdate(resourceGroupName, virtualRouterName, this.innerModel(), context); + return this; + } + + VirtualRouterImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualRouterInner(); + this.serviceManager = serviceManager; + this.virtualRouterName = name; + } + + public VirtualRouterImpl update() { + return this; + } + + public VirtualRouter apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .createOrUpdate(resourceGroupName, virtualRouterName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualRouter apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .createOrUpdate(resourceGroupName, virtualRouterName, this.innerModel(), context); + return this; + } + + VirtualRouterImpl( + VirtualRouterInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualRouterName = Utils.getValueFromIdByName(innerObject.id(), "virtualRouters"); + } + + public VirtualRouter refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualRouter refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, localExpand, context) + .getValue(); + return this; + } + + public VirtualRouterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualRouterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualRouterImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public VirtualRouterImpl withVirtualRouterAsn(Long virtualRouterAsn) { + this.innerModel().withVirtualRouterAsn(virtualRouterAsn); + return this; + } + + public VirtualRouterImpl withVirtualRouterIps(List virtualRouterIps) { + this.innerModel().withVirtualRouterIps(virtualRouterIps); + return this; + } + + public VirtualRouterImpl withHostedSubnet(SubResource hostedSubnet) { + this.innerModel().withHostedSubnet(hostedSubnet); + return this; + } + + public VirtualRouterImpl withHostedGateway(SubResource hostedGateway) { + this.innerModel().withHostedGateway(hostedGateway); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java new file mode 100644 index 0000000000000..41314f9e18743 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeering; + +public final class VirtualRouterPeeringImpl + implements VirtualRouterPeering, VirtualRouterPeering.Definition, VirtualRouterPeering.Update { + private VirtualRouterPeeringInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Long peerAsn() { + return this.innerModel().peerAsn(); + } + + public String peerIp() { + return this.innerModel().peerIp(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualRouterPeeringInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualRouterName; + + private String peeringName; + + public VirtualRouterPeeringImpl withExistingVirtualRouter(String resourceGroupName, String virtualRouterName) { + this.resourceGroupName = resourceGroupName; + this.virtualRouterName = virtualRouterName; + return this; + } + + public VirtualRouterPeering create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .createOrUpdate(resourceGroupName, virtualRouterName, peeringName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualRouterPeering create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .createOrUpdate(resourceGroupName, virtualRouterName, peeringName, this.innerModel(), context); + return this; + } + + VirtualRouterPeeringImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualRouterPeeringInner(); + this.serviceManager = serviceManager; + this.peeringName = name; + } + + public VirtualRouterPeeringImpl update() { + return this; + } + + public VirtualRouterPeering apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .createOrUpdate(resourceGroupName, virtualRouterName, peeringName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualRouterPeering apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .createOrUpdate(resourceGroupName, virtualRouterName, peeringName, this.innerModel(), context); + return this; + } + + VirtualRouterPeeringImpl( + VirtualRouterPeeringInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualRouterName = Utils.getValueFromIdByName(innerObject.id(), "virtualRouters"); + this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); + } + + public VirtualRouterPeering refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .getWithResponse(resourceGroupName, virtualRouterName, peeringName, Context.NONE) + .getValue(); + return this; + } + + public VirtualRouterPeering refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .getWithResponse(resourceGroupName, virtualRouterName, peeringName, context) + .getValue(); + return this; + } + + public VirtualRouterPeeringImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualRouterPeeringImpl withPeerAsn(Long peerAsn) { + this.innerModel().withPeerAsn(peerAsn); + return this; + } + + public VirtualRouterPeeringImpl withPeerIp(String peerIp) { + this.innerModel().withPeerIp(peerIp); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java new file mode 100644 index 0000000000000..64d4e9f331aaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java @@ -0,0 +1,1137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.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.network.generated.fluent.VirtualRouterPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeeringListResult; +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 VirtualRouterPeeringsClient. */ +public final class VirtualRouterPeeringsClientImpl implements VirtualRouterPeeringsClient { + private final ClientLogger logger = new ClientLogger(VirtualRouterPeeringsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualRouterPeeringsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualRouterPeeringsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualRouterPeeringsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualRouterPeeringsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualRouterPeerings to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualRouterPeeringsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}/peerings/{peeringName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}/peerings/{peeringName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}/peerings/{peeringName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualRouterPeeringInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}/peerings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualRouterName, peeringName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualRouterName, peeringName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName) { + return beginDeleteAsync(resourceGroupName, virtualRouterName, peeringName).getSyncPoller(); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualRouterName, peeringName, context).getSyncPoller(); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName) { + return beginDeleteAsync(resourceGroupName, virtualRouterName, peeringName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualRouterName, peeringName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName) { + deleteAsync(resourceGroupName, virtualRouterName, peeringName).block(); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, String peeringName, Context context) { + deleteAsync(resourceGroupName, virtualRouterName, peeringName, context).block(); + } + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualRouterName, String peeringName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualRouterName, String peeringName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String virtualRouterName, String peeringName) { + return getWithResponseAsync(resourceGroupName, virtualRouterName, peeringName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualRouterPeeringInner get(String resourceGroupName, String virtualRouterName, String peeringName) { + return getAsync(resourceGroupName, virtualRouterName, peeringName).block(); + } + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualRouterName, String peeringName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualRouterName, peeringName, context).block(); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualRouterName, + String peeringName, + VirtualRouterPeeringInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required and cannot be null.")); + } + if (peeringName == null) { + return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualRouterPeeringInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualRouterName, peeringName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualRouterPeeringInner.class, + VirtualRouterPeeringInner.class, + Context.NONE); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualRouterPeeringInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualRouterName, + String peeringName, + VirtualRouterPeeringInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualRouterName, peeringName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualRouterPeeringInner.class, + VirtualRouterPeeringInner.class, + context); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualRouterPeeringInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualRouterPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualRouterName, + String peeringName, + VirtualRouterPeeringInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualRouterName, + String peeringName, + VirtualRouterPeeringInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualRouterPeeringInner createOrUpdate( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters) { + return createOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters).block(); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualRouterPeeringInner createOrUpdate( + String resourceGroupName, + String virtualRouterName, + String peeringName, + VirtualRouterPeeringInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters, context).block(); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualRouterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualRouterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualRouterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualRouterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualRouterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualRouterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualRouterName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualRouterName)); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualRouterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualRouterName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsImpl.java new file mode 100644 index 0000000000000..3d64a7480b34d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsImpl.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.network.generated.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.network.generated.fluent.VirtualRouterPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeering; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeerings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualRouterPeeringsImpl implements VirtualRouterPeerings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterPeeringsImpl.class); + + private final VirtualRouterPeeringsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualRouterPeeringsImpl( + VirtualRouterPeeringsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String virtualRouterName, String peeringName) { + this.serviceClient().delete(resourceGroupName, virtualRouterName, peeringName); + } + + public void delete(String resourceGroupName, String virtualRouterName, String peeringName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualRouterName, peeringName, context); + } + + public VirtualRouterPeering get(String resourceGroupName, String virtualRouterName, String peeringName) { + VirtualRouterPeeringInner inner = this.serviceClient().get(resourceGroupName, virtualRouterName, peeringName); + if (inner != null) { + return new VirtualRouterPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualRouterName, String peeringName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualRouterName, peeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualRouterPeeringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String virtualRouterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualRouterName); + return Utils.mapPage(inner, inner1 -> new VirtualRouterPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualRouterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualRouterName, context); + return Utils.mapPage(inner, inner1 -> new VirtualRouterPeeringImpl(inner1, this.manager())); + } + + public VirtualRouterPeering 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 virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualRouterName, peeringName, 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 virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualRouterName, peeringName, 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 virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, peeringName, 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 virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, peeringName, context); + } + + private VirtualRouterPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualRouterPeeringImpl define(String name) { + return new VirtualRouterPeeringImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java new file mode 100644 index 0000000000000..21c217a9b0c4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java @@ -0,0 +1,1288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.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.network.generated.fluent.VirtualRoutersClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.VirtualRouterListResult; +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 VirtualRoutersClient. */ +public final class VirtualRoutersClientImpl implements VirtualRoutersClient { + private final ClientLogger logger = new ClientLogger(VirtualRoutersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualRoutersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualRoutersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualRoutersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualRoutersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualRouters to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualRoutersService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualRouterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroupNext( + @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(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualRouterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualRouterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName) { + return beginDeleteAsync(resourceGroupName, virtualRouterName).getSyncPoller(); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualRouterName, context).getSyncPoller(); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName) { + return beginDeleteAsync(resourceGroupName, virtualRouterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualRouterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName) { + deleteAsync(resourceGroupName, virtualRouterName).block(); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException 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 virtualRouterName, Context context) { + deleteAsync(resourceGroupName, virtualRouterName, context).block(); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualRouterName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualRouterName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String virtualRouterName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualRouterName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualRouterName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualRouterName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualRouterInner getByResourceGroup(String resourceGroupName, String virtualRouterName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, virtualRouterName, expand).block(); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualRouterName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualRouterName, expand, context).block(); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualRouterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualRouterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualRouterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualRouterName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualRouterInner.class, VirtualRouterInner.class, Context.NONE); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualRouterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualRouterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualRouterInner.class, VirtualRouterInner.class, context); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualRouterInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualRouterInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualRouterInner createOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters) { + return createOrUpdateAsync(resourceGroupName, virtualRouterName, parameters).block(); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualRouterInner createOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualRouterName, parameters, context).block(); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @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 ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersImpl.java new file mode 100644 index 0000000000000..05c86c1017c5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualRoutersClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import com.azure.resourcemanager.network.generated.models.VirtualRouter; +import com.azure.resourcemanager.network.generated.models.VirtualRouters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualRoutersImpl implements VirtualRouters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRoutersImpl.class); + + private final VirtualRoutersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualRoutersImpl( + VirtualRoutersClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualRouterName) { + this.serviceClient().delete(resourceGroupName, virtualRouterName); + } + + public void delete(String resourceGroupName, String virtualRouterName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualRouterName, context); + } + + public VirtualRouter getByResourceGroup(String resourceGroupName, String virtualRouterName) { + VirtualRouterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualRouterName); + if (inner != null) { + return new VirtualRouterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualRouterName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualRouterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public VirtualRouter 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 virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, expand, 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 virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, 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 virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, context); + } + + private VirtualRoutersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualRouterImpl define(String name) { + return new VirtualRouterImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java new file mode 100644 index 0000000000000..3e503f9e241aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.azure.resourcemanager.network.generated.models.OfficeTrafficCategory; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualWan; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualWanImpl implements VirtualWan, VirtualWan.Definition, VirtualWan.Update { + private VirtualWanInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public Boolean disableVpnEncryption() { + return this.innerModel().disableVpnEncryption(); + } + + public List virtualHubs() { + List inner = this.innerModel().virtualHubs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List vpnSites() { + List inner = this.innerModel().vpnSites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean allowBranchToBranchTraffic() { + return this.innerModel().allowBranchToBranchTraffic(); + } + + public Boolean allowVnetToVnetTraffic() { + return this.innerModel().allowVnetToVnetTraffic(); + } + + public OfficeTrafficCategory office365LocalBreakoutCategory() { + return this.innerModel().office365LocalBreakoutCategory(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualWanInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualWanName; + + private TagsObject updateWanParameters; + + public VirtualWanImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualWan create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualWans() + .createOrUpdate(resourceGroupName, virtualWanName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualWan create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualWans() + .createOrUpdate(resourceGroupName, virtualWanName, this.innerModel(), context); + return this; + } + + VirtualWanImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualWanInner(); + this.serviceManager = serviceManager; + this.virtualWanName = name; + } + + public VirtualWanImpl update() { + this.updateWanParameters = new TagsObject(); + return this; + } + + public VirtualWan apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualWans() + .updateTagsWithResponse(resourceGroupName, virtualWanName, updateWanParameters, Context.NONE) + .getValue(); + return this; + } + + public VirtualWan apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualWans() + .updateTagsWithResponse(resourceGroupName, virtualWanName, updateWanParameters, context) + .getValue(); + return this; + } + + VirtualWanImpl( + VirtualWanInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualWanName = Utils.getValueFromIdByName(innerObject.id(), "virtualWans"); + } + + public VirtualWan refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualWans() + .getByResourceGroupWithResponse(resourceGroupName, virtualWanName, Context.NONE) + .getValue(); + return this; + } + + public VirtualWan refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualWans() + .getByResourceGroupWithResponse(resourceGroupName, virtualWanName, context) + .getValue(); + return this; + } + + public VirtualWanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualWanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualWanImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateWanParameters.withTags(tags); + return this; + } + } + + public VirtualWanImpl withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.innerModel().withDisableVpnEncryption(disableVpnEncryption); + return this; + } + + public VirtualWanImpl withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.innerModel().withAllowBranchToBranchTraffic(allowBranchToBranchTraffic); + return this; + } + + public VirtualWanImpl withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { + this.innerModel().withAllowVnetToVnetTraffic(allowVnetToVnetTraffic); + return this; + } + + public VirtualWanImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanSecurityProvidersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanSecurityProvidersImpl.java new file mode 100644 index 0000000000000..aa1dc98be22a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanSecurityProvidersImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProvider; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProviders; +import java.util.Collections; +import java.util.List; + +public final class VirtualWanSecurityProvidersImpl implements VirtualWanSecurityProviders { + private VirtualWanSecurityProvidersInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualWanSecurityProvidersImpl( + VirtualWanSecurityProvidersInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List supportedProviders() { + List inner = this.innerModel().supportedProviders(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualWanSecurityProvidersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansClientImpl.java new file mode 100644 index 0000000000000..72f2ab0009309 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansClientImpl.java @@ -0,0 +1,1435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualWansResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 VirtualWansClient. */ +public final class VirtualWansClientImpl implements VirtualWansClient { + private final ClientLogger logger = new ClientLogger(VirtualWansClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualWansService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualWansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualWansClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualWansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualWans to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualWansService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{VirtualWANName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("VirtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{VirtualWANName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("VirtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualWanInner wanParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{VirtualWANName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("VirtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject wanParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{VirtualWANName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("VirtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualWans") + @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.Network/virtualWans") + @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("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualWanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualWanName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualWanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualWanName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualWanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualWanName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualWanInner getByResourceGroup(String resourceGroupName, String virtualWanName) { + return getByResourceGroupAsync(resourceGroupName, virtualWanName).block(); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualWanName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualWanName, context).block(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + if (wanParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter wanParameters is required and cannot be null.")); + } else { + wanParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + wanParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, 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 (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + if (wanParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter wanParameters is required and cannot be null.")); + } else { + wanParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + wanParameters, + accept, + context); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualWanInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualWanName, wanParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualWanInner.class, VirtualWanInner.class, Context.NONE); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualWanInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualWanName, wanParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualWanInner.class, VirtualWanInner.class, context); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualWanInner> beginCreateOrUpdate( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters).getSyncPoller(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualWanInner> beginCreateOrUpdate( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters, context).getSyncPoller(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualWanInner createOrUpdate( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { + return createOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters).block(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualWanInner createOrUpdate( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters, context).block(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String virtualWanName, TagsObject wanParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + if (wanParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter wanParameters is required and cannot be null.")); + } else { + wanParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + wanParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String virtualWanName, TagsObject wanParameters, 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 (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + if (wanParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter wanParameters is required and cannot be null.")); + } else { + wanParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + wanParameters, + accept, + context); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String virtualWanName, TagsObject wanParameters) { + return updateTagsWithResponseAsync(resourceGroupName, virtualWanName, wanParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualWanInner updateTags(String resourceGroupName, String virtualWanName, TagsObject wanParameters) { + return updateTagsAsync(resourceGroupName, virtualWanName, wanParameters).block(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, virtualWanName, wanParameters, context).block(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualWanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualWanName, 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 (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + accept, + context); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualWanName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualWanName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualWanName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualWanName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualWanName) { + return beginDeleteAsync(resourceGroupName, virtualWanName).getSyncPoller(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualWanName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualWanName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualWanName) { + return beginDeleteAsync(resourceGroupName, virtualWanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtualWanName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualWanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualWanName) { + deleteAsync(resourceGroupName, virtualWanName).block(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualWanName, Context context) { + deleteAsync(resourceGroupName, virtualWanName, context).block(); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + @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 result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 result of the request to list VirtualWANs. + */ + @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 result of the request to list VirtualWANs. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansImpl.java new file mode 100644 index 0000000000000..ada14c14d9a21 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.azure.resourcemanager.network.generated.models.VirtualWan; +import com.azure.resourcemanager.network.generated.models.VirtualWans; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualWansImpl implements VirtualWans { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWansImpl.class); + + private final VirtualWansClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualWansImpl( + VirtualWansClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualWan getByResourceGroup(String resourceGroupName, String virtualWanName) { + VirtualWanInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualWanName); + if (inner != null) { + return new VirtualWanImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualWanName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualWanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualWanImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualWanName) { + this.serviceClient().delete(resourceGroupName, virtualWanName); + } + + public void delete(String resourceGroupName, String virtualWanName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualWanName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public VirtualWan 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 virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualWanName, 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 virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualWanName, 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 virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + this.delete(resourceGroupName, virtualWanName, 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 virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + this.delete(resourceGroupName, virtualWanName, context); + } + + private VirtualWansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualWanImpl define(String name) { + return new VirtualWanImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java new file mode 100644 index 0000000000000..7b4dad39cf768 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetail; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetailListResult; +import java.util.Collections; +import java.util.List; + +public final class VpnClientConnectionHealthDetailListResultImpl implements VpnClientConnectionHealthDetailListResult { + private VpnClientConnectionHealthDetailListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnClientConnectionHealthDetailListResultImpl( + VpnClientConnectionHealthDetailListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnClientConnectionHealthDetailListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java new file mode 100644 index 0000000000000..adf02429e54fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.DhGroup; +import com.azure.resourcemanager.network.generated.models.IkeEncryption; +import com.azure.resourcemanager.network.generated.models.IkeIntegrity; +import com.azure.resourcemanager.network.generated.models.IpsecEncryption; +import com.azure.resourcemanager.network.generated.models.IpsecIntegrity; +import com.azure.resourcemanager.network.generated.models.PfsGroup; +import com.azure.resourcemanager.network.generated.models.VpnClientIPsecParameters; + +public final class VpnClientIPsecParametersImpl implements VpnClientIPsecParameters { + private VpnClientIPsecParametersInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnClientIPsecParametersImpl( + VpnClientIPsecParametersInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public int saLifeTimeSeconds() { + return this.innerModel().saLifeTimeSeconds(); + } + + public int saDataSizeKilobytes() { + return this.innerModel().saDataSizeKilobytes(); + } + + public IpsecEncryption ipsecEncryption() { + return this.innerModel().ipsecEncryption(); + } + + public IpsecIntegrity ipsecIntegrity() { + return this.innerModel().ipsecIntegrity(); + } + + public IkeEncryption ikeEncryption() { + return this.innerModel().ikeEncryption(); + } + + public IkeIntegrity ikeIntegrity() { + return this.innerModel().ikeIntegrity(); + } + + public DhGroup dhGroup() { + return this.innerModel().dhGroup(); + } + + public PfsGroup pfsGroup() { + return this.innerModel().pfsGroup(); + } + + public VpnClientIPsecParametersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java new file mode 100644 index 0000000000000..1a364be203cff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnection; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VpnConnectionImpl implements VpnConnection { + private VpnConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnConnectionImpl( + VpnConnectionInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SubResource remoteVpnSite() { + return this.innerModel().remoteVpnSite(); + } + + public Integer routingWeight() { + return this.innerModel().routingWeight(); + } + + public Integer dpdTimeoutSeconds() { + return this.innerModel().dpdTimeoutSeconds(); + } + + public VpnConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.innerModel().vpnConnectionProtocolType(); + } + + public Long ingressBytesTransferred() { + return this.innerModel().ingressBytesTransferred(); + } + + public Long egressBytesTransferred() { + return this.innerModel().egressBytesTransferred(); + } + + public Integer connectionBandwidth() { + return this.innerModel().connectionBandwidth(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public Boolean enableBgp() { + return this.innerModel().enableBgp(); + } + + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerModel().usePolicyBasedTrafficSelectors(); + } + + public List ipsecPolicies() { + List inner = this.innerModel().ipsecPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List trafficSelectorPolicies() { + List inner = this.innerModel().trafficSelectorPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableRateLimiting() { + return this.innerModel().enableRateLimiting(); + } + + public Boolean enableInternetSecurity() { + return this.innerModel().enableInternetSecurity(); + } + + public Boolean useLocalAzureIpAddress() { + return this.innerModel().useLocalAzureIpAddress(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List vpnLinkConnections() { + List inner = this.innerModel().vpnLinkConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VpnSiteLinkConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public RoutingConfiguration routingConfiguration() { + return this.innerModel().routingConfiguration(); + } + + public VpnConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java new file mode 100644 index 0000000000000..52a0ede02d19c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java @@ -0,0 +1,1898 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.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.network.generated.fluent.VpnConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.models.ListVpnConnectionsResult; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStopParameters; +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 VpnConnectionsClient. */ +public final class VpnConnectionsClientImpl implements VpnConnectionsClient { + private final ClientLogger logger = new ClientLogger(VpnConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VpnConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnConnections to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnConnectionInner vpnConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("vpnConnectionName") String vpnConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnConnectionPacketCaptureStartParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("vpnConnectionName") String vpnConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnConnectionPacketCaptureStopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnGateway( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnGatewayNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String gatewayName, String connectionName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String gatewayName, String connectionName) { + return getWithResponseAsync(resourceGroupName, gatewayName, connectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) { + return getAsync(resourceGroupName, gatewayName, connectionName).block(); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, gatewayName, connectionName, context).block(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (vpnConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null.")); + } else { + vpnConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + vpnConnectionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (vpnConnectionParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null.")); + } else { + vpnConnectionParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + vpnConnectionParameters, + accept, + context); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnConnectionInner.class, VpnConnectionInner.class, Context.NONE); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnConnectionInner.class, VpnConnectionInner.class, context); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters) + .getSyncPoller(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context) + .getSyncPoller(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnConnectionInner createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters) { + return createOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).block(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnConnectionInner createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context) + .block(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String connectionName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + accept, + context); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String connectionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName, connectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, gatewayName, connectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String connectionName) { + return beginDeleteAsync(resourceGroupName, gatewayName, connectionName).getSyncPoller(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String connectionName) { + return beginDeleteAsync(resourceGroupName, gatewayName, connectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, connectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 gatewayName, String connectionName) { + deleteAsync(resourceGroupName, gatewayName, connectionName).block(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 gatewayName, String connectionName, Context context) { + deleteAsync(resourceGroupName, gatewayName, connectionName, context).block(); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> startPacketCaptureWithResponseAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (vpnConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + vpnConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> startPacketCaptureWithResponseAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (vpnConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + vpnConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginStartPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters) { + Mono>> mono = + startPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginStartPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono startPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono startPacketCaptureAsync( + String resourceGroupName, String gatewayName, String vpnConnectionName) { + final VpnConnectionPacketCaptureStartParameters parameters = null; + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono startPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters) { + return startPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).block(); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String startPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName) { + final VpnConnectionPacketCaptureStartParameters parameters = null; + return startPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).block(); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context) { + return startPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context).block(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> stopPacketCaptureWithResponseAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (vpnConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + vpnConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> stopPacketCaptureWithResponseAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (vpnConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + vpnConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginStopPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters) { + Mono>> mono = + stopPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginStopPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono stopPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono stopPacketCaptureAsync( + String resourceGroupName, String gatewayName, String vpnConnectionName) { + final VpnConnectionPacketCaptureStopParameters parameters = null; + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono stopPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters) { + return stopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).block(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String stopPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName) { + final VpnConnectionPacketCaptureStopParameters parameters = null; + return stopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).block(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context) { + return stopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context).block(); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnGatewaySinglePageAsync( + String resourceGroupName, String gatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByVpnGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + 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())); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnGatewaySinglePageAsync( + String resourceGroupName, String gatewayName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVpnGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnGatewayAsync(String resourceGroupName, String gatewayName) { + return new PagedFlux<>( + () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), + nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnGatewayAsync( + String resourceGroupName, String gatewayName, Context context) { + return new PagedFlux<>( + () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName, context), + nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName) { + return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName)); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName, 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 result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnGatewayNextSinglePageAsync(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.listByVpnGatewayNext(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 result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnGatewayNextSinglePageAsync( + 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 + .listByVpnGatewayNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsImpl.java new file mode 100644 index 0000000000000..24f67e372729d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VpnConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.models.VpnConnection; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStopParameters; +import com.azure.resourcemanager.network.generated.models.VpnConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnConnectionsImpl implements VpnConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionsImpl.class); + + private final VpnConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnConnectionsImpl( + VpnConnectionsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnConnection get(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionInner inner = this.serviceClient().get(resourceGroupName, gatewayName, connectionName); + if (inner != null) { + return new VpnConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, gatewayName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VpnConnection createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters) { + VpnConnectionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters); + if (inner != null) { + return new VpnConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnConnection createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context) { + VpnConnectionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context); + if (inner != null) { + return new VpnConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String gatewayName, String connectionName) { + this.serviceClient().delete(resourceGroupName, gatewayName, connectionName); + } + + public void delete(String resourceGroupName, String gatewayName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, gatewayName, connectionName, context); + } + + public String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName, vpnConnectionName, parameters); + } + + public String startPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName, vpnConnectionName); + } + + public String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context) { + return this + .serviceClient() + .startPacketCapture(resourceGroupName, gatewayName, vpnConnectionName, parameters, context); + } + + public String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName, vpnConnectionName, parameters); + } + + public String stopPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName, vpnConnectionName); + } + + public String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, gatewayName, vpnConnectionName, parameters, context); + } + + public PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName) { + PagedIterable inner = this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName); + return Utils.mapPage(inner, inner1 -> new VpnConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName, context); + return Utils.mapPage(inner, inner1 -> new VpnConnectionImpl(inner1, this.manager())); + } + + private VpnConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.java new file mode 100644 index 0000000000000..a1f62db895211 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnConnection; +import com.azure.resourcemanager.network.generated.models.VpnGateway; +import com.azure.resourcemanager.network.generated.models.VpnGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStopParameters; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VpnGatewayImpl implements VpnGateway, VpnGateway.Definition, VpnGateway.Update { + private VpnGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public SubResource virtualHub() { + return this.innerModel().virtualHub(); + } + + public List connections() { + List inner = this.innerModel().connections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VpnConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public BgpSettings bgpSettings() { + return this.innerModel().bgpSettings(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Integer vpnGatewayScaleUnit() { + return this.innerModel().vpnGatewayScaleUnit(); + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean isRoutingPreferenceInternet() { + return this.innerModel().isRoutingPreferenceInternet(); + } + + public List natRules() { + List inner = this.innerModel().natRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VpnGatewayNatRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VpnGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String gatewayName; + + private TagsObject updateVpnGatewayParameters; + + public VpnGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VpnGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .createOrUpdate(resourceGroupName, gatewayName, this.innerModel(), Context.NONE); + return this; + } + + public VpnGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .createOrUpdate(resourceGroupName, gatewayName, this.innerModel(), context); + return this; + } + + VpnGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VpnGatewayInner(); + this.serviceManager = serviceManager; + this.gatewayName = name; + } + + public VpnGatewayImpl update() { + this.updateVpnGatewayParameters = new TagsObject(); + return this; + } + + public VpnGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .updateTags(resourceGroupName, gatewayName, updateVpnGatewayParameters, Context.NONE); + return this; + } + + public VpnGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .updateTags(resourceGroupName, gatewayName, updateVpnGatewayParameters, context); + return this; + } + + VpnGatewayImpl( + VpnGatewayInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "vpnGateways"); + } + + public VpnGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE) + .getValue(); + return this; + } + + public VpnGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, context) + .getValue(); + return this; + } + + public VpnGateway reset() { + return serviceManager.vpnGateways().reset(resourceGroupName, gatewayName); + } + + public VpnGateway reset(Context context) { + return serviceManager.vpnGateways().reset(resourceGroupName, gatewayName, context); + } + + public String startPacketCapture(VpnGatewayPacketCaptureStartParameters parameters) { + return serviceManager.vpnGateways().startPacketCapture(resourceGroupName, gatewayName, parameters); + } + + public String startPacketCapture() { + return serviceManager.vpnGateways().startPacketCapture(resourceGroupName, gatewayName); + } + + public String startPacketCapture(VpnGatewayPacketCaptureStartParameters parameters, Context context) { + return serviceManager.vpnGateways().startPacketCapture(resourceGroupName, gatewayName, parameters, context); + } + + public String stopPacketCapture(VpnGatewayPacketCaptureStopParameters parameters) { + return serviceManager.vpnGateways().stopPacketCapture(resourceGroupName, gatewayName, parameters); + } + + public String stopPacketCapture() { + return serviceManager.vpnGateways().stopPacketCapture(resourceGroupName, gatewayName); + } + + public String stopPacketCapture(VpnGatewayPacketCaptureStopParameters parameters, Context context) { + return serviceManager.vpnGateways().stopPacketCapture(resourceGroupName, gatewayName, parameters, context); + } + + public VpnGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VpnGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VpnGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVpnGatewayParameters.withTags(tags); + return this; + } + } + + public VpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public VpnGatewayImpl withConnections(List connections) { + this.innerModel().withConnections(connections); + return this; + } + + public VpnGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.innerModel().withBgpSettings(bgpSettings); + return this; + } + + public VpnGatewayImpl withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.innerModel().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); + return this; + } + + public VpnGatewayImpl withIsRoutingPreferenceInternet(Boolean isRoutingPreferenceInternet) { + this.innerModel().withIsRoutingPreferenceInternet(isRoutingPreferenceInternet); + return this; + } + + public VpnGatewayImpl withNatRules(List natRules) { + this.innerModel().withNatRules(natRules); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayNatRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayNatRuleImpl.java new file mode 100644 index 0000000000000..ea97d3b7c7ed7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayNatRuleImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import java.util.Collections; +import java.util.List; + +public final class VpnGatewayNatRuleImpl + implements VpnGatewayNatRule, VpnGatewayNatRule.Definition, VpnGatewayNatRule.Update { + private VpnGatewayNatRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VpnNatRuleType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public VpnNatRuleMode mode() { + return this.innerModel().mode(); + } + + public List internalMappings() { + List inner = this.innerModel().internalMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List externalMappings() { + List inner = this.innerModel().externalMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String ipConfigurationId() { + return this.innerModel().ipConfigurationId(); + } + + public List egressVpnSiteLinkConnections() { + List inner = this.innerModel().egressVpnSiteLinkConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List ingressVpnSiteLinkConnections() { + List inner = this.innerModel().ingressVpnSiteLinkConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnGatewayNatRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String gatewayName; + + private String natRuleName; + + public VpnGatewayNatRuleImpl withExistingVpnGateway(String resourceGroupName, String gatewayName) { + this.resourceGroupName = resourceGroupName; + this.gatewayName = gatewayName; + return this; + } + + public VpnGatewayNatRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .createOrUpdate(resourceGroupName, gatewayName, natRuleName, this.innerModel(), Context.NONE); + return this; + } + + public VpnGatewayNatRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .createOrUpdate(resourceGroupName, gatewayName, natRuleName, this.innerModel(), context); + return this; + } + + VpnGatewayNatRuleImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VpnGatewayNatRuleInner(); + this.serviceManager = serviceManager; + this.natRuleName = name; + } + + public VpnGatewayNatRuleImpl update() { + return this; + } + + public VpnGatewayNatRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .createOrUpdate(resourceGroupName, gatewayName, natRuleName, this.innerModel(), Context.NONE); + return this; + } + + public VpnGatewayNatRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .createOrUpdate(resourceGroupName, gatewayName, natRuleName, this.innerModel(), context); + return this; + } + + VpnGatewayNatRuleImpl( + VpnGatewayNatRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "vpnGateways"); + this.natRuleName = Utils.getValueFromIdByName(innerObject.id(), "natRules"); + } + + public VpnGatewayNatRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .getWithResponse(resourceGroupName, gatewayName, natRuleName, Context.NONE) + .getValue(); + return this; + } + + public VpnGatewayNatRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .getWithResponse(resourceGroupName, gatewayName, natRuleName, context) + .getValue(); + return this; + } + + public VpnGatewayNatRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VpnGatewayNatRuleImpl withTypePropertiesType(VpnNatRuleType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public VpnGatewayNatRuleImpl withMode(VpnNatRuleMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public VpnGatewayNatRuleImpl withInternalMappings(List internalMappings) { + this.innerModel().withInternalMappings(internalMappings); + return this; + } + + public VpnGatewayNatRuleImpl withExternalMappings(List externalMappings) { + this.innerModel().withExternalMappings(externalMappings); + return this; + } + + public VpnGatewayNatRuleImpl withIpConfigurationId(String ipConfigurationId) { + this.innerModel().withIpConfigurationId(ipConfigurationId); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java new file mode 100644 index 0000000000000..c3c8cc0936ab3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java @@ -0,0 +1,2434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import com.azure.resourcemanager.network.generated.models.ListVpnGatewaysResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStopParameters; +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 VpnGatewaysClient. */ +public final class VpnGatewaysClientImpl implements VpnGatewaysClient { + private final ClientLogger logger = new ClientLogger(VpnGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VpnGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnGateways to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnGatewaysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnGatewayInner vpnGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject vpnGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/reset") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reset( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/startpacketcapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnGatewayPacketCaptureStartParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/stoppacketcapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnGatewayPacketCaptureStopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnGateways") + @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.Network/vpnGateways") + @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("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String gatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String gatewayName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (vpnGatewayParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null.")); + } else { + vpnGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + vpnGatewayParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (vpnGatewayParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null.")); + } else { + vpnGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + vpnGatewayParameters, + accept, + context); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnGatewayInner.class, VpnGatewayInner.class, Context.NONE); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnGatewayInner> beginCreateOrUpdateAsync( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnGatewayInner.class, VpnGatewayInner.class, context); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters).getSyncPoller(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).getSyncPoller(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner createOrUpdate( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return createOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters).block(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner createOrUpdate( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).block(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (vpnGatewayParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null.")); + } else { + vpnGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + vpnGatewayParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (vpnGatewayParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null.")); + } else { + vpnGatewayParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + vpnGatewayParameters, + accept, + context); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnGatewayInner> beginUpdateTagsAsync( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnGatewayInner.class, VpnGatewayInner.class, Context.NONE); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnGatewayInner> beginUpdateTagsAsync( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnGatewayInner.class, VpnGatewayInner.class, context); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).getSyncPoller(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).getSyncPoller(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { + return updateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).block(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner updateTags( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { + return updateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).block(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, gatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName) { + return beginDeleteAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName) { + return beginDeleteAsync(resourceGroupName, gatewayName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 gatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 gatewayName) { + deleteAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 gatewayName, Context context) { + deleteAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reset( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync( + String resourceGroupName, String gatewayName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reset( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnGatewayInner> beginResetAsync( + String resourceGroupName, String gatewayName) { + Mono>> mono = resetWithResponseAsync(resourceGroupName, gatewayName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnGatewayInner.class, VpnGatewayInner.class, Context.NONE); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnGatewayInner> beginResetAsync( + String resourceGroupName, String gatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = resetWithResponseAsync(resourceGroupName, gatewayName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnGatewayInner.class, VpnGatewayInner.class, context); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName) { + return beginResetAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName, Context context) { + return beginResetAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String gatewayName) { + return beginResetAsync(resourceGroupName, gatewayName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String gatewayName, Context context) { + return beginResetAsync(resourceGroupName, gatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner reset(String resourceGroupName, String gatewayName) { + return resetAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner reset(String resourceGroupName, String gatewayName, Context context) { + return resetAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> startPacketCaptureWithResponseAsync( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> startPacketCaptureWithResponseAsync( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginStartPacketCaptureAsync( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters) { + Mono>> mono = + startPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginStartPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, parameters).getSyncPoller(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context).getSyncPoller(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono startPacketCaptureAsync( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono startPacketCaptureAsync(String resourceGroupName, String gatewayName) { + final VpnGatewayPacketCaptureStartParameters parameters = null; + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono startPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String startPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters) { + return startPacketCaptureAsync(resourceGroupName, gatewayName, parameters).block(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String startPacketCapture(String resourceGroupName, String gatewayName) { + final VpnGatewayPacketCaptureStartParameters parameters = null; + return startPacketCaptureAsync(resourceGroupName, gatewayName, parameters).block(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String startPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context) { + return startPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context).block(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> stopPacketCaptureWithResponseAsync( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> stopPacketCaptureWithResponseAsync( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginStopPacketCaptureAsync( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters) { + Mono>> mono = + stopPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginStopPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).getSyncPoller(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context).getSyncPoller(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono stopPacketCaptureAsync( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono stopPacketCaptureAsync(String resourceGroupName, String gatewayName) { + final VpnGatewayPacketCaptureStopParameters parameters = null; + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono stopPacketCaptureAsync( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String stopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters) { + return stopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).block(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String stopPacketCapture(String resourceGroupName, String gatewayName) { + final VpnGatewayPacketCaptureStopParameters parameters = null; + return stopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).block(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String stopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context) { + return stopPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context).block(); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + @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 result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 result of the request to list VpnGateways. + */ + @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 result of the request to list VpnGateways. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysImpl.java new file mode 100644 index 0000000000000..44e2577f9f520 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysImpl.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.network.generated.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.network.generated.fluent.VpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import com.azure.resourcemanager.network.generated.models.VpnGateway; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStopParameters; +import com.azure.resourcemanager.network.generated.models.VpnGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnGatewaysImpl implements VpnGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewaysImpl.class); + + private final VpnGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnGatewaysImpl( + VpnGatewaysClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnGateway getByResourceGroup(String resourceGroupName, String gatewayName) { + VpnGatewayInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, gatewayName); + if (inner != null) { + return new VpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, gatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String gatewayName) { + this.serviceClient().delete(resourceGroupName, gatewayName); + } + + public void delete(String resourceGroupName, String gatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, gatewayName, context); + } + + public VpnGateway reset(String resourceGroupName, String gatewayName) { + VpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName); + if (inner != null) { + return new VpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnGateway reset(String resourceGroupName, String gatewayName, Context context) { + VpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName, context); + if (inner != null) { + return new VpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public String startPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName, parameters); + } + + public String startPacketCapture(String resourceGroupName, String gatewayName) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName); + } + + public String startPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName, parameters, context); + } + + public String stopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName, parameters); + } + + public String stopPacketCapture(String resourceGroupName, String gatewayName) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName); + } + + public String stopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName, parameters, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public VpnGateway 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 gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, 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 gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, 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 gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, 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 gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, context); + } + + private VpnGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnGatewayImpl define(String name) { + return new VpnGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java new file mode 100644 index 0000000000000..610e78f8d68bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java @@ -0,0 +1,1001 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.network.generated.fluent.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.ListVpnSiteLinkConnectionsResult; +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 VpnLinkConnectionsClient. */ +public final class VpnLinkConnectionsClientImpl implements VpnLinkConnectionsClient { + private final ClientLogger logger = new ClientLogger(VpnLinkConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnLinkConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnLinkConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnLinkConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VpnLinkConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnLinkConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnLinkConnectionsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}" + + "/resetconnection") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetConnection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @PathParam("linkConnectionName") String linkConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getIkeSas( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @PathParam("linkConnectionName") String linkConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnConnection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnConnectionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> resetConnectionWithResponseAsync( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (linkConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter linkConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + linkConnectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> resetConnectionWithResponseAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (linkConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter linkConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + linkConnectionName, + apiVersion, + accept, + context); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetConnectionAsync( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + Mono>> mono = + resetConnectionWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetConnectionAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetConnectionWithResponseAsync( + resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return beginResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName) + .getSyncPoller(); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginResetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return beginResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context) + .getSyncPoller(); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resetConnectionAsync( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return beginResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resetConnectionAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return beginResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + resetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).block(); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + resetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context).block(); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> getIkeSasWithResponseAsync( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (linkConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter linkConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getIkeSas( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + linkConnectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono>> getIkeSasWithResponseAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (linkConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter linkConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getIkeSas( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + linkConnectionName, + apiVersion, + accept, + context); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginGetIkeSasAsync( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + Mono>> mono = + getIkeSasWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), String.class, String.class, Context.NONE); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private PollerFlux, String> beginGetIkeSasAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getIkeSasWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, context); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginGetIkeSas( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return beginGetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).getSyncPoller(); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 SyncPoller, String> beginGetIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return beginGetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context) + .getSyncPoller(); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono getIkeSasAsync( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return beginGetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono getIkeSasAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return beginGetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String getIkeSas( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return getIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).block(); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 String getIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return getIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context).block(); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnConnectionSinglePageAsync( + String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByVpnConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + 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())); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnConnectionSinglePageAsync( + String resourceGroupName, String gatewayName, String connectionName, 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVpnConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnConnectionAsync( + String resourceGroupName, String gatewayName, String connectionName) { + return new PagedFlux<>( + () -> listByVpnConnectionSinglePageAsync(resourceGroupName, gatewayName, connectionName), + nextLink -> listByVpnConnectionNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnConnectionAsync( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + return new PagedFlux<>( + () -> listByVpnConnectionSinglePageAsync(resourceGroupName, gatewayName, connectionName, context), + nextLink -> listByVpnConnectionNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName) { + return new PagedIterable<>(listByVpnConnectionAsync(resourceGroupName, gatewayName, connectionName)); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + return new PagedIterable<>(listByVpnConnectionAsync(resourceGroupName, gatewayName, connectionName, 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 result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnConnectionNextSinglePageAsync(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.listByVpnConnectionNext(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 result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnConnectionNextSinglePageAsync( + 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 + .listByVpnConnectionNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsImpl.java new file mode 100644 index 0000000000000..8c78517e1178e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsImpl.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.network.generated.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.network.generated.fluent.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnections; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnLinkConnectionsImpl implements VpnLinkConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnLinkConnectionsImpl.class); + + private final VpnLinkConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnLinkConnectionsImpl( + VpnLinkConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void resetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + this.serviceClient().resetConnection(resourceGroupName, gatewayName, connectionName, linkConnectionName); + } + + public void resetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + this + .serviceClient() + .resetConnection(resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + } + + public String getIkeSas( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return this.serviceClient().getIkeSas(resourceGroupName, gatewayName, connectionName, linkConnectionName); + } + + public String getIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return this + .serviceClient() + .getIkeSas(resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + } + + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName) { + PagedIterable inner = + this.serviceClient().listByVpnConnection(resourceGroupName, gatewayName, connectionName); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnConnection(resourceGroupName, gatewayName, connectionName, context); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkConnectionImpl(inner1, this.manager())); + } + + private VpnLinkConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java new file mode 100644 index 0000000000000..f72d4f53d11de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.VpnProfileResponse; + +public final class VpnProfileResponseImpl implements VpnProfileResponse { + private VpnProfileResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnProfileResponseImpl( + VpnProfileResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String profileUrl() { + return this.innerModel().profileUrl(); + } + + public VpnProfileResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java new file mode 100644 index 0000000000000..de368c4374a31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.azure.resourcemanager.network.generated.models.AadAuthenticationParameters; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateway; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnAuthenticationType; +import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfiguration; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VpnServerConfigurationImpl + implements VpnServerConfiguration, VpnServerConfiguration.Definition, VpnServerConfiguration.Update { + private VpnServerConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public List vpnProtocols() { + List inner = this.innerModel().vpnProtocols(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List vpnAuthenticationTypes() { + List inner = this.innerModel().vpnAuthenticationTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List vpnClientRootCertificates() { + List inner = this.innerModel().vpnClientRootCertificates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List vpnClientRevokedCertificates() { + List inner = this.innerModel().vpnClientRevokedCertificates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List radiusServerRootCertificates() { + List inner = this.innerModel().radiusServerRootCertificates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List radiusClientRootCertificates() { + List inner = this.innerModel().radiusClientRootCertificates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List vpnClientIpsecPolicies() { + List inner = this.innerModel().vpnClientIpsecPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String radiusServerAddress() { + return this.innerModel().radiusServerAddress(); + } + + public String radiusServerSecret() { + return this.innerModel().radiusServerSecret(); + } + + public List radiusServers() { + List inner = this.innerModel().radiusServers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AadAuthenticationParameters aadAuthenticationParameters() { + return this.innerModel().aadAuthenticationParameters(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public List p2SVpnGateways() { + List inner = this.innerModel().p2SVpnGateways(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String etagPropertiesEtag() { + return this.innerModel().etagPropertiesEtag(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VpnServerConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vpnServerConfigurationName; + + private TagsObject updateVpnServerConfigurationParameters; + + public VpnServerConfigurationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VpnServerConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .createOrUpdate(resourceGroupName, vpnServerConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public VpnServerConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .createOrUpdate(resourceGroupName, vpnServerConfigurationName, this.innerModel(), context); + return this; + } + + VpnServerConfigurationImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VpnServerConfigurationInner(); + this.serviceManager = serviceManager; + this.vpnServerConfigurationName = name; + } + + public VpnServerConfigurationImpl update() { + this.updateVpnServerConfigurationParameters = new TagsObject(); + return this; + } + + public VpnServerConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .updateTagsWithResponse( + resourceGroupName, vpnServerConfigurationName, updateVpnServerConfigurationParameters, Context.NONE) + .getValue(); + return this; + } + + public VpnServerConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .updateTagsWithResponse( + resourceGroupName, vpnServerConfigurationName, updateVpnServerConfigurationParameters, context) + .getValue(); + return this; + } + + VpnServerConfigurationImpl( + VpnServerConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnServerConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "vpnServerConfigurations"); + } + + public VpnServerConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public VpnServerConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, context) + .getValue(); + return this; + } + + public VpnServerConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VpnServerConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VpnServerConfigurationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVpnServerConfigurationParameters.withTags(tags); + return this; + } + } + + public VpnServerConfigurationImpl withNamePropertiesName(String namePropertiesName) { + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; + } + + public VpnServerConfigurationImpl withVpnProtocols(List vpnProtocols) { + this.innerModel().withVpnProtocols(vpnProtocols); + return this; + } + + public VpnServerConfigurationImpl withVpnAuthenticationTypes(List vpnAuthenticationTypes) { + this.innerModel().withVpnAuthenticationTypes(vpnAuthenticationTypes); + return this; + } + + public VpnServerConfigurationImpl withVpnClientRootCertificates( + List vpnClientRootCertificates) { + this.innerModel().withVpnClientRootCertificates(vpnClientRootCertificates); + return this; + } + + public VpnServerConfigurationImpl withVpnClientRevokedCertificates( + List vpnClientRevokedCertificates) { + this.innerModel().withVpnClientRevokedCertificates(vpnClientRevokedCertificates); + return this; + } + + public VpnServerConfigurationImpl withRadiusServerRootCertificates( + List radiusServerRootCertificates) { + this.innerModel().withRadiusServerRootCertificates(radiusServerRootCertificates); + return this; + } + + public VpnServerConfigurationImpl withRadiusClientRootCertificates( + List radiusClientRootCertificates) { + this.innerModel().withRadiusClientRootCertificates(radiusClientRootCertificates); + return this; + } + + public VpnServerConfigurationImpl withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.innerModel().withVpnClientIpsecPolicies(vpnClientIpsecPolicies); + return this; + } + + public VpnServerConfigurationImpl withRadiusServerAddress(String radiusServerAddress) { + this.innerModel().withRadiusServerAddress(radiusServerAddress); + return this; + } + + public VpnServerConfigurationImpl withRadiusServerSecret(String radiusServerSecret) { + this.innerModel().withRadiusServerSecret(radiusServerSecret); + return this; + } + + public VpnServerConfigurationImpl withRadiusServers(List radiusServers) { + this.innerModel().withRadiusServers(radiusServers); + return this; + } + + public VpnServerConfigurationImpl withAadAuthenticationParameters( + AadAuthenticationParameters aadAuthenticationParameters) { + this.innerModel().withAadAuthenticationParameters(aadAuthenticationParameters); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.java new file mode 100644 index 0000000000000..e6bfac00aea2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.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.network.generated.fluent.VpnServerConfigurationsAssociatedWithVirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; +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 + * VpnServerConfigurationsAssociatedWithVirtualWansClient. + */ +public final class VpnServerConfigurationsAssociatedWithVirtualWansClientImpl + implements VpnServerConfigurationsAssociatedWithVirtualWansClient { + private final ClientLogger logger = + new ClientLogger(VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnServerConfigurationsAssociatedWithVirtualWansService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnServerConfigurationsAssociatedWithVirtualWansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnServerConfigurationsAssociatedWithVirtualWansClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + VpnServerConfigurationsAssociatedWithVirtualWansService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * NetworkManagementClientVpnServerConfigurationsAssociatedWithVirtualWans to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnServerConfigurationsAssociatedWithVirtualWansService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{virtualWANName}/vpnServerConfigurations") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listWithResponseAsync(String resourceGroupName, String virtualWanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listWithResponseAsync( + String resourceGroupName, String virtualWanName, 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 (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + accept, + context); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnServerConfigurationsResponseInner> + beginListAsync(String resourceGroupName, String virtualWanName) { + Mono>> mono = listWithResponseAsync(resourceGroupName, virtualWanName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnServerConfigurationsResponseInner.class, + VpnServerConfigurationsResponseInner.class, + Context.NONE); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnServerConfigurationsResponseInner> + beginListAsync(String resourceGroupName, String virtualWanName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = listWithResponseAsync(resourceGroupName, virtualWanName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnServerConfigurationsResponseInner.class, + VpnServerConfigurationsResponseInner.class, + context); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnServerConfigurationsResponseInner> beginList( + String resourceGroupName, String virtualWanName) { + return beginListAsync(resourceGroupName, virtualWanName).getSyncPoller(); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnServerConfigurationsResponseInner> beginList( + String resourceGroupName, String virtualWanName, Context context) { + return beginListAsync(resourceGroupName, virtualWanName, context).getSyncPoller(); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String virtualWanName) { + return beginListAsync(resourceGroupName, virtualWanName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String virtualWanName, Context context) { + return beginListAsync(resourceGroupName, virtualWanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationsResponseInner list(String resourceGroupName, String virtualWanName) { + return listAsync(resourceGroupName, virtualWanName).block(); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationsResponseInner list(String resourceGroupName, String virtualWanName, Context context) { + return listAsync(resourceGroupName, virtualWanName, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansImpl.java new file mode 100644 index 0000000000000..99749622430f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansImpl.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.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnServerConfigurationsAssociatedWithVirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsAssociatedWithVirtualWans; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnServerConfigurationsAssociatedWithVirtualWansImpl + implements VpnServerConfigurationsAssociatedWithVirtualWans { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VpnServerConfigurationsAssociatedWithVirtualWansImpl.class); + + private final VpnServerConfigurationsAssociatedWithVirtualWansClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnServerConfigurationsAssociatedWithVirtualWansImpl( + VpnServerConfigurationsAssociatedWithVirtualWansClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnServerConfigurationsResponse list(String resourceGroupName, String virtualWanName) { + VpnServerConfigurationsResponseInner inner = this.serviceClient().list(resourceGroupName, virtualWanName); + if (inner != null) { + return new VpnServerConfigurationsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnServerConfigurationsResponse list(String resourceGroupName, String virtualWanName, Context context) { + VpnServerConfigurationsResponseInner inner = + this.serviceClient().list(resourceGroupName, virtualWanName, context); + if (inner != null) { + return new VpnServerConfigurationsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private VpnServerConfigurationsAssociatedWithVirtualWansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsClientImpl.java new file mode 100644 index 0000000000000..d9e2efbe9cd33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsClientImpl.java @@ -0,0 +1,1529 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VpnServerConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ListVpnServerConfigurationsResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 VpnServerConfigurationsClient. */ +public final class VpnServerConfigurationsClientImpl implements VpnServerConfigurationsClient { + private final ClientLogger logger = new ClientLogger(VpnServerConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnServerConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnServerConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnServerConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VpnServerConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnServerConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnServerConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations/{vpnServerConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations/{vpnServerConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnServerConfigurationInner vpnServerConfigurationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations/{vpnServerConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject vpnServerConfigurationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations/{vpnServerConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations") + @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.Network/vpnServerConfigurations") + @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("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vpnServerConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnServerConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnServerConfigurationName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vpnServerConfigurationName, 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 (vpnServerConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnServerConfigurationName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String vpnServerConfigurationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnServerConfigurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationInner getByResourceGroup(String resourceGroupName, String vpnServerConfigurationName) { + return getByResourceGroupAsync(resourceGroupName, vpnServerConfigurationName).block(); + } + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnServerConfigurationName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnServerConfigurationName, context).block(); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnServerConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationName is required and cannot be null.")); + } + if (vpnServerConfigurationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationParameters is required and cannot be null.")); + } else { + vpnServerConfigurationParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnServerConfigurationName, + apiVersion, + vpnServerConfigurationParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters, + 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 (vpnServerConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationName is required and cannot be null.")); + } + if (vpnServerConfigurationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationParameters is required and cannot be null.")); + } else { + vpnServerConfigurationParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnServerConfigurationName, + apiVersion, + vpnServerConfigurationParameters, + accept, + context); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnServerConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnServerConfigurationInner.class, + VpnServerConfigurationInner.class, + Context.NONE); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnServerConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnServerConfigurationInner.class, + VpnServerConfigurationInner.class, + context); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnServerConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters) + .getSyncPoller(); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnServerConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, context) + .getSyncPoller(); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationInner createOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters) { + return createOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters) + .block(); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationInner createOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, context) + .block(); + } + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnServerConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationName is required and cannot be null.")); + } + if (vpnServerConfigurationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationParameters is required and cannot be null.")); + } else { + vpnServerConfigurationParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnServerConfigurationName, + apiVersion, + vpnServerConfigurationParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String vpnServerConfigurationName, + TagsObject vpnServerConfigurationParameters, + 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 (vpnServerConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationName is required and cannot be null.")); + } + if (vpnServerConfigurationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationParameters is required and cannot be null.")); + } else { + vpnServerConfigurationParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnServerConfigurationName, + apiVersion, + vpnServerConfigurationParameters, + accept, + context); + } + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters) { + return updateTagsWithResponseAsync( + resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationInner updateTags( + String resourceGroupName, String vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters) { + return updateTagsAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters).block(); + } + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, + String vpnServerConfigurationName, + TagsObject vpnServerConfigurationParameters, + Context context) { + return updateTagsWithResponseAsync( + resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, context) + .block(); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnServerConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnServerConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnServerConfigurationName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnServerConfigurationName, 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 (vpnServerConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vpnServerConfigurationName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnServerConfigurationName, + apiVersion, + accept, + context); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnServerConfigurationName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vpnServerConfigurationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnServerConfigurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vpnServerConfigurationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnServerConfigurationName) { + return beginDeleteAsync(resourceGroupName, vpnServerConfigurationName).getSyncPoller(); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnServerConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, vpnServerConfigurationName, context).getSyncPoller(); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnServerConfigurationName) { + return beginDeleteAsync(resourceGroupName, vpnServerConfigurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnServerConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, vpnServerConfigurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vpnServerConfigurationName) { + deleteAsync(resourceGroupName, vpnServerConfigurationName).block(); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vpnServerConfigurationName, Context context) { + deleteAsync(resourceGroupName, vpnServerConfigurationName, context).block(); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + @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 result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 result of the request to list all VpnServerConfigurations. + */ + @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 result of the request to list all VpnServerConfigurations. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsImpl.java new file mode 100644 index 0000000000000..0b86f2a69e75d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsImpl.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.network.generated.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.network.generated.fluent.VpnServerConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.azure.resourcemanager.network.generated.models.VpnServerConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnServerConfigurationsImpl implements VpnServerConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigurationsImpl.class); + + private final VpnServerConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnServerConfigurationsImpl( + VpnServerConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnServerConfiguration getByResourceGroup(String resourceGroupName, String vpnServerConfigurationName) { + VpnServerConfigurationInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, vpnServerConfigurationName); + if (inner != null) { + return new VpnServerConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnServerConfigurationName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnServerConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String vpnServerConfigurationName) { + this.serviceClient().delete(resourceGroupName, vpnServerConfigurationName); + } + + public void delete(String resourceGroupName, String vpnServerConfigurationName, Context context) { + this.serviceClient().delete(resourceGroupName, vpnServerConfigurationName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public VpnServerConfiguration 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 vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, 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 vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, 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 vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + this.delete(resourceGroupName, vpnServerConfigurationName, 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 vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + this.delete(resourceGroupName, vpnServerConfigurationName, context); + } + + private VpnServerConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnServerConfigurationImpl define(String name) { + return new VpnServerConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.java new file mode 100644 index 0000000000000..0e4c654761afa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.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.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsResponse; +import java.util.Collections; +import java.util.List; + +public final class VpnServerConfigurationsResponseImpl implements VpnServerConfigurationsResponse { + private VpnServerConfigurationsResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnServerConfigurationsResponseImpl( + VpnServerConfigurationsResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List vpnServerConfigurationResourceIds() { + List inner = this.innerModel().vpnServerConfigurationResourceIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnServerConfigurationsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.java new file mode 100644 index 0000000000000..d1201c4dcc769 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.DeviceProperties; +import com.azure.resourcemanager.network.generated.models.O365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnSite; +import com.azure.resourcemanager.network.generated.models.VpnSiteLink; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VpnSiteImpl implements VpnSite, VpnSite.Definition, VpnSite.Update { + private VpnSiteInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public SubResource virtualWan() { + return this.innerModel().virtualWan(); + } + + public DeviceProperties deviceProperties() { + return this.innerModel().deviceProperties(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public String siteKey() { + return this.innerModel().siteKey(); + } + + public AddressSpace addressSpace() { + return this.innerModel().addressSpace(); + } + + public BgpSettings bgpProperties() { + return this.innerModel().bgpProperties(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean isSecuritySite() { + return this.innerModel().isSecuritySite(); + } + + public List vpnSiteLinks() { + List inner = this.innerModel().vpnSiteLinks(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VpnSiteLinkImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public O365PolicyProperties o365Policy() { + return this.innerModel().o365Policy(); + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VpnSiteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vpnSiteName; + + private TagsObject updateVpnSiteParameters; + + public VpnSiteImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VpnSite create() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .createOrUpdate(resourceGroupName, vpnSiteName, this.innerModel(), Context.NONE); + return this; + } + + public VpnSite create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .createOrUpdate(resourceGroupName, vpnSiteName, this.innerModel(), context); + return this; + } + + VpnSiteImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VpnSiteInner(); + this.serviceManager = serviceManager; + this.vpnSiteName = name; + } + + public VpnSiteImpl update() { + this.updateVpnSiteParameters = new TagsObject(); + return this; + } + + public VpnSite apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .updateTagsWithResponse(resourceGroupName, vpnSiteName, updateVpnSiteParameters, Context.NONE) + .getValue(); + return this; + } + + public VpnSite apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .updateTagsWithResponse(resourceGroupName, vpnSiteName, updateVpnSiteParameters, context) + .getValue(); + return this; + } + + VpnSiteImpl(VpnSiteInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnSiteName = Utils.getValueFromIdByName(innerObject.id(), "vpnSites"); + } + + public VpnSite refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, Context.NONE) + .getValue(); + return this; + } + + public VpnSite refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, context) + .getValue(); + return this; + } + + public VpnSiteImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VpnSiteImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VpnSiteImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVpnSiteParameters.withTags(tags); + return this; + } + } + + public VpnSiteImpl withVirtualWan(SubResource virtualWan) { + this.innerModel().withVirtualWan(virtualWan); + return this; + } + + public VpnSiteImpl withDeviceProperties(DeviceProperties deviceProperties) { + this.innerModel().withDeviceProperties(deviceProperties); + return this; + } + + public VpnSiteImpl withIpAddress(String ipAddress) { + this.innerModel().withIpAddress(ipAddress); + return this; + } + + public VpnSiteImpl withSiteKey(String siteKey) { + this.innerModel().withSiteKey(siteKey); + return this; + } + + public VpnSiteImpl withAddressSpace(AddressSpace addressSpace) { + this.innerModel().withAddressSpace(addressSpace); + return this; + } + + public VpnSiteImpl withBgpProperties(BgpSettings bgpProperties) { + this.innerModel().withBgpProperties(bgpProperties); + return this; + } + + public VpnSiteImpl withIsSecuritySite(Boolean isSecuritySite) { + this.innerModel().withIsSecuritySite(isSecuritySite); + return this; + } + + public VpnSiteImpl withVpnSiteLinks(List vpnSiteLinks) { + this.innerModel().withVpnSiteLinks(vpnSiteLinks); + return this; + } + + public VpnSiteImpl withO365Policy(O365PolicyProperties o365Policy) { + this.innerModel().withO365Policy(o365Policy); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.java new file mode 100644 index 0000000000000..fe0eaad7342b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.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.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnectionMode; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; +import java.util.Collections; +import java.util.List; + +public final class VpnSiteLinkConnectionImpl implements VpnSiteLinkConnection { + private VpnSiteLinkConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnSiteLinkConnectionImpl( + VpnSiteLinkConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource vpnSiteLink() { + return this.innerModel().vpnSiteLink(); + } + + public Integer routingWeight() { + return this.innerModel().routingWeight(); + } + + public VpnLinkConnectionMode vpnLinkConnectionMode() { + return this.innerModel().vpnLinkConnectionMode(); + } + + public VpnConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.innerModel().vpnConnectionProtocolType(); + } + + public Long ingressBytesTransferred() { + return this.innerModel().ingressBytesTransferred(); + } + + public Long egressBytesTransferred() { + return this.innerModel().egressBytesTransferred(); + } + + public Integer connectionBandwidth() { + return this.innerModel().connectionBandwidth(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public Boolean enableBgp() { + return this.innerModel().enableBgp(); + } + + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerModel().usePolicyBasedTrafficSelectors(); + } + + public List ipsecPolicies() { + List inner = this.innerModel().ipsecPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableRateLimiting() { + return this.innerModel().enableRateLimiting(); + } + + public Boolean useLocalAzureIpAddress() { + return this.innerModel().useLocalAzureIpAddress(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List ingressNatRules() { + List inner = this.innerModel().ingressNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List egressNatRules() { + List inner = this.innerModel().egressNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnSiteLinkConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsClientImpl.java new file mode 100644 index 0000000000000..318772fabd8c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsClientImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnSiteLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinkConnectionsClient. */ +public final class VpnSiteLinkConnectionsClientImpl implements VpnSiteLinkConnectionsClient { + private final ClientLogger logger = new ClientLogger(VpnSiteLinkConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnSiteLinkConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSiteLinkConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnSiteLinkConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VpnSiteLinkConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnSiteLinkConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnSiteLinkConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @PathParam("linkConnectionName") String linkConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (linkConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter linkConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + linkConnectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + 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 (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (linkConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter linkConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + linkConnectionName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return getWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteLinkConnectionInner get( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return getAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).block(); + } + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return getWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context) + .block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsImpl.java new file mode 100644 index 0000000000000..e542c1fced175 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VpnSiteLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnSiteLinkConnectionsImpl implements VpnSiteLinkConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinkConnectionsImpl.class); + + private final VpnSiteLinkConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnSiteLinkConnectionsImpl( + VpnSiteLinkConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnSiteLinkConnection get( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + VpnSiteLinkConnectionInner inner = + this.serviceClient().get(resourceGroupName, gatewayName, connectionName, linkConnectionName); + if (inner != null) { + return new VpnSiteLinkConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnSiteLinkConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private VpnSiteLinkConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkImpl.java new file mode 100644 index 0000000000000..ec8629f491cb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import com.azure.resourcemanager.network.generated.models.VpnSiteLink; + +public final class VpnSiteLinkImpl implements VpnSiteLink { + private VpnSiteLinkInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnSiteLinkImpl( + VpnSiteLinkInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public VpnLinkProviderProperties linkProperties() { + return this.innerModel().linkProperties(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public VpnLinkBgpSettings bgpProperties() { + return this.innerModel().bgpProperties(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VpnSiteLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java new file mode 100644 index 0000000000000..d0d404687a78c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java @@ -0,0 +1,522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VpnSiteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.ListVpnSiteLinksResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinksClient. */ +public final class VpnSiteLinksClientImpl implements VpnSiteLinksClient { + private final ClientLogger logger = new ClientLogger(VpnSiteLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnSiteLinksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSiteLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnSiteLinksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VpnSiteLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnSiteLinks to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnSiteLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @PathParam("vpnSiteLinkName") String vpnSiteLinkName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}/vpnSiteLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnSite( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnSiteNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vpnSiteName, String vpnSiteLinkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + if (vpnSiteLinkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnSiteLinkName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + vpnSiteLinkName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, 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 (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + if (vpnSiteLinkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnSiteLinkName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + vpnSiteLinkName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName) { + return getWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteLinkInner get(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName) { + return getAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName).block(); + } + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, Context context) { + return getWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName, context).block(); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnSiteSinglePageAsync( + String resourceGroupName, String vpnSiteName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByVpnSite( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnSiteSinglePageAsync( + String resourceGroupName, String vpnSiteName, 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 (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVpnSite( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnSiteAsync(String resourceGroupName, String vpnSiteName) { + return new PagedFlux<>( + () -> listByVpnSiteSinglePageAsync(resourceGroupName, vpnSiteName), + nextLink -> listByVpnSiteNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnSiteAsync( + String resourceGroupName, String vpnSiteName, Context context) { + return new PagedFlux<>( + () -> listByVpnSiteSinglePageAsync(resourceGroupName, vpnSiteName, context), + nextLink -> listByVpnSiteNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName) { + return new PagedIterable<>(listByVpnSiteAsync(resourceGroupName, vpnSiteName)); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnSite( + String resourceGroupName, String vpnSiteName, Context context) { + return new PagedIterable<>(listByVpnSiteAsync(resourceGroupName, vpnSiteName, 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 result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnSiteNextSinglePageAsync(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.listByVpnSiteNext(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 result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnSiteNextSinglePageAsync(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 + .listByVpnSiteNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksImpl.java new file mode 100644 index 0000000000000..935542d9b0b35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksImpl.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.network.generated.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.network.generated.fluent.VpnSiteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.VpnSiteLink; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnSiteLinksImpl implements VpnSiteLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinksImpl.class); + + private final VpnSiteLinksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnSiteLinksImpl( + VpnSiteLinksClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnSiteLink get(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName) { + VpnSiteLinkInner inner = this.serviceClient().get(resourceGroupName, vpnSiteName, vpnSiteLinkName); + if (inner != null) { + return new VpnSiteLinkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vpnSiteName, vpnSiteLinkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnSiteLinkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName) { + PagedIterable inner = this.serviceClient().listByVpnSite(resourceGroupName, vpnSiteName); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnSite(resourceGroupName, vpnSiteName, context); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkImpl(inner1, this.manager())); + } + + private VpnSiteLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.java new file mode 100644 index 0000000000000..75668688b9c30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.java @@ -0,0 +1,1432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VpnSitesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.models.ListVpnSitesResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 VpnSitesClient. */ +public final class VpnSitesClientImpl implements VpnSitesClient { + private final ClientLogger logger = new ClientLogger(VpnSitesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnSitesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnSitesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(VpnSitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnSites to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnSitesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnSiteInner vpnSiteParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject vpnSiteParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites") + @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.Network/vpnSites") + @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("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vpnSiteName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vpnSiteName, 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 (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + accept, + context); + } + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnSiteName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupAsync(resourceGroupName, vpnSiteName).block(); + } + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnSiteName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnSiteName, context).block(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + if (vpnSiteParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null.")); + } else { + vpnSiteParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + vpnSiteParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, 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 (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + if (vpnSiteParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null.")); + } else { + vpnSiteParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + vpnSiteParameters, + accept, + context); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnSiteInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnSiteInner.class, VpnSiteInner.class, Context.NONE); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VpnSiteInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnSiteInner.class, VpnSiteInner.class, context); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnSiteInner> beginCreateOrUpdate( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).getSyncPoller(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VpnSiteInner> beginCreateOrUpdate( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context).getSyncPoller(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return createOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).block(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteInner createOrUpdate( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context).block(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + if (vpnSiteParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null.")); + } else { + vpnSiteParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + vpnSiteParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, 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 (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + if (vpnSiteParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null.")); + } else { + vpnSiteParameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + vpnSiteParameters, + accept, + context); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { + return updateTagsWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { + return updateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).block(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context).block(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnSiteName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnSiteName, 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 (vpnSiteName == null) { + return Mono.error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + accept, + context); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnSiteName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vpnSiteName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnSiteName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vpnSiteName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnSiteName) { + return beginDeleteAsync(resourceGroupName, vpnSiteName).getSyncPoller(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnSiteName, Context context) { + return beginDeleteAsync(resourceGroupName, vpnSiteName, context).getSyncPoller(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnSiteName) { + return beginDeleteAsync(resourceGroupName, vpnSiteName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vpnSiteName, Context context) { + return beginDeleteAsync(resourceGroupName, vpnSiteName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vpnSiteName) { + deleteAsync(resourceGroupName, vpnSiteName).block(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vpnSiteName, Context context) { + deleteAsync(resourceGroupName, vpnSiteName, context).block(); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + @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 result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 result of the request to list VpnSites. + */ + @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 result of the request to list VpnSites. + */ + @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsClientImpl.java new file mode 100644 index 0000000000000..6dd51117d50ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsClientImpl.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.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.network.generated.fluent.VpnSitesConfigurationsClient; +import com.azure.resourcemanager.network.generated.models.GetVpnSitesConfigurationRequest; +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 VpnSitesConfigurationsClient. */ +public final class VpnSitesConfigurationsClientImpl implements VpnSitesConfigurationsClient { + private final ClientLogger logger = new ClientLogger(VpnSitesConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnSitesConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnSitesConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VpnSitesConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnSitesConfigurations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnSitesConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{virtualWANName}/vpnConfiguration") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> download( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GetVpnSitesConfigurationRequest request, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadWithResponseAsync( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .download( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + request, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadWithResponseAsync( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, 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 (virtualWanName == null) { + return Mono.error(new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .download( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + request, + accept, + context); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDownloadAsync( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { + Mono>> mono = downloadWithResponseAsync(resourceGroupName, virtualWanName, request); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDownloadAsync( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + downloadWithResponseAsync(resourceGroupName, virtualWanName, request, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDownload( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { + return beginDownloadAsync(resourceGroupName, virtualWanName, request).getSyncPoller(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDownload( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { + return beginDownloadAsync(resourceGroupName, virtualWanName, request, context).getSyncPoller(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadAsync( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { + return beginDownloadAsync(resourceGroupName, virtualWanName, request) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadAsync( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { + return beginDownloadAsync(resourceGroupName, virtualWanName, request, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void download(String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { + downloadAsync(resourceGroupName, virtualWanName, request).block(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void download( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { + downloadAsync(resourceGroupName, virtualWanName, request, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsImpl.java new file mode 100644 index 0000000000000..343d0a6735cff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsImpl.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.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnSitesConfigurationsClient; +import com.azure.resourcemanager.network.generated.models.GetVpnSitesConfigurationRequest; +import com.azure.resourcemanager.network.generated.models.VpnSitesConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnSitesConfigurationsImpl implements VpnSitesConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSitesConfigurationsImpl.class); + + private final VpnSitesConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnSitesConfigurationsImpl( + VpnSitesConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void download(String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { + this.serviceClient().download(resourceGroupName, virtualWanName, request); + } + + public void download( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { + this.serviceClient().download(resourceGroupName, virtualWanName, request, context); + } + + private VpnSitesConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesImpl.java new file mode 100644 index 0000000000000..0decaf7b39b95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.VpnSitesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.models.VpnSite; +import com.azure.resourcemanager.network.generated.models.VpnSites; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnSitesImpl implements VpnSites { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSitesImpl.class); + + private final VpnSitesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnSitesImpl( + VpnSitesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnSite getByResourceGroup(String resourceGroupName, String vpnSiteName) { + VpnSiteInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vpnSiteName); + if (inner != null) { + return new VpnSiteImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnSiteName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnSiteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String vpnSiteName) { + this.serviceClient().delete(resourceGroupName, vpnSiteName); + } + + public void delete(String resourceGroupName, String vpnSiteName, Context context) { + this.serviceClient().delete(resourceGroupName, vpnSiteName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public VpnSite 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 vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, 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 vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, 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 vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + this.delete(resourceGroupName, vpnSiteName, 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 vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + this.delete(resourceGroupName, vpnSiteName, context); + } + + private VpnSitesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnSiteImpl define(String name) { + return new VpnSiteImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java new file mode 100644 index 0000000000000..cdd0fd5a897df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java @@ -0,0 +1,1160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.WebApplicationFirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyListResult; +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 WebApplicationFirewallPoliciesClient. */ +public final class WebApplicationFirewallPoliciesClientImpl implements WebApplicationFirewallPoliciesClient { + private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WebApplicationFirewallPoliciesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of WebApplicationFirewallPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebApplicationFirewallPoliciesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + WebApplicationFirewallPoliciesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientWebApplicationFirewallPolicies to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface WebApplicationFirewallPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies") + @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.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WebApplicationFirewallPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @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> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + 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 protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the WAF policies 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 all the WAF policies in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the WAF policies 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 all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the WAF policies 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 all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String policyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String policyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String policyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName) { + return getByResourceGroupAsync(resourceGroupName, policyName).block(); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName, context).block(); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, policyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, policyName, parameters).block(); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, policyName, parameters, context).block(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required 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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, policyName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, policyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName) { + return beginDeleteAsync(resourceGroupName, policyName).getSyncPoller(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName, Context context) { + return beginDeleteAsync(resourceGroupName, policyName, context).getSyncPoller(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName) { + return beginDeleteAsync(resourceGroupName, policyName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName, Context context) { + return beginDeleteAsync(resourceGroupName, policyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 policyName) { + deleteAsync(resourceGroupName, policyName).block(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 policyName, Context context) { + deleteAsync(resourceGroupName, policyName, 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 result of the request to list WebApplicationFirewallPolicies. + */ + @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 result of the request to list WebApplicationFirewallPolicies. + */ + @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 result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync( + 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 + .listAllNext(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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesImpl.java new file mode 100644 index 0000000000000..80218dbd1013d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesImpl.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.network.generated.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.network.generated.fluent.WebApplicationFirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicies; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WebApplicationFirewallPoliciesImpl implements WebApplicationFirewallPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPoliciesImpl.class); + + private final WebApplicationFirewallPoliciesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public WebApplicationFirewallPoliciesImpl( + WebApplicationFirewallPoliciesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public WebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName) { + WebApplicationFirewallPolicyInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, policyName); + if (inner != null) { + return new WebApplicationFirewallPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, policyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WebApplicationFirewallPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String policyName) { + this.serviceClient().delete(resourceGroupName, policyName); + } + + public void delete(String resourceGroupName, String policyName, Context context) { + this.serviceClient().delete(resourceGroupName, policyName, context); + } + + public WebApplicationFirewallPolicy 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 policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, 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 policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, 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 policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + this.delete(resourceGroupName, policyName, 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 policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + this.delete(resourceGroupName, policyName, context); + } + + private WebApplicationFirewallPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public WebApplicationFirewallPolicyImpl define(String name) { + return new WebApplicationFirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.java new file mode 100644 index 0000000000000..d2f130e191c7b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGateway; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicy; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyResourceState; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class WebApplicationFirewallPolicyImpl + implements WebApplicationFirewallPolicy, + WebApplicationFirewallPolicy.Definition, + WebApplicationFirewallPolicy.Update { + private WebApplicationFirewallPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + 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 String etag() { + return this.innerModel().etag(); + } + + public PolicySettings policySettings() { + return this.innerModel().policySettings(); + } + + public List customRules() { + List inner = this.innerModel().customRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List applicationGateways() { + List inner = this.innerModel().applicationGateways(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationGatewayImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public WebApplicationFirewallPolicyResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public ManagedRulesDefinition managedRules() { + return this.innerModel().managedRules(); + } + + public List httpListeners() { + List inner = this.innerModel().httpListeners(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List pathBasedRules() { + List inner = this.innerModel().pathBasedRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public WebApplicationFirewallPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String policyName; + + public WebApplicationFirewallPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public WebApplicationFirewallPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getWebApplicationFirewallPolicies() + .createOrUpdateWithResponse(resourceGroupName, policyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public WebApplicationFirewallPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebApplicationFirewallPolicies() + .createOrUpdateWithResponse(resourceGroupName, policyName, this.innerModel(), context) + .getValue(); + return this; + } + + WebApplicationFirewallPolicyImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new WebApplicationFirewallPolicyInner(); + this.serviceManager = serviceManager; + this.policyName = name; + } + + public WebApplicationFirewallPolicyImpl update() { + return this; + } + + public WebApplicationFirewallPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWebApplicationFirewallPolicies() + .createOrUpdateWithResponse(resourceGroupName, policyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public WebApplicationFirewallPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebApplicationFirewallPolicies() + .createOrUpdateWithResponse(resourceGroupName, policyName, this.innerModel(), context) + .getValue(); + return this; + } + + WebApplicationFirewallPolicyImpl( + WebApplicationFirewallPolicyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.policyName = + Utils.getValueFromIdByName(innerObject.id(), "ApplicationGatewayWebApplicationFirewallPolicies"); + } + + public WebApplicationFirewallPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWebApplicationFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE) + .getValue(); + return this; + } + + public WebApplicationFirewallPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebApplicationFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, context) + .getValue(); + return this; + } + + public WebApplicationFirewallPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public WebApplicationFirewallPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public WebApplicationFirewallPolicyImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public WebApplicationFirewallPolicyImpl withPolicySettings(PolicySettings policySettings) { + this.innerModel().withPolicySettings(policySettings); + return this; + } + + public WebApplicationFirewallPolicyImpl withCustomRules(List customRules) { + this.innerModel().withCustomRules(customRules); + return this; + } + + public WebApplicationFirewallPolicyImpl withManagedRules(ManagedRulesDefinition managedRules) { + this.innerModel().withManagedRules(managedRules); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesClientImpl.java new file mode 100644 index 0000000000000..2223d9e5e097e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesClientImpl.java @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.WebCategoriesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.azure.resourcemanager.network.generated.models.AzureWebCategoryListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WebCategoriesClient. */ +public final class WebCategoriesClientImpl implements WebCategoriesClient { + private final ClientLogger logger = new ClientLogger(WebCategoriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WebCategoriesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of WebCategoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebCategoriesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(WebCategoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientWebCategories to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface WebCategoriesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String name, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + name, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String name, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), name, apiVersion, this.client.getSubscriptionId(), expand, accept, context); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String name, String expand) { + return getWithResponseAsync(name, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String name) { + final String expand = null; + return getWithResponseAsync(name, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureWebCategoryInner get(String name) { + final String expand = null; + return getAsync(name, expand).block(); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String name, String expand, Context context) { + return getWithResponseAsync(name, expand, context).block(); + } + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Azure Web Categories 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 all the Azure Web Categories in a subscription. + */ + @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 apiVersion = "2021-02-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Azure Web Categories 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 all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Azure Web Categories 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 all the Azure Web Categories in a subscription. + */ + @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 response for ListAzureWebCategories API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response for ListAzureWebCategories API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesImpl.java new file mode 100644 index 0000000000000..36c89b8dac6b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.network.generated.fluent.WebCategoriesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.azure.resourcemanager.network.generated.models.AzureWebCategory; +import com.azure.resourcemanager.network.generated.models.WebCategories; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WebCategoriesImpl implements WebCategories { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebCategoriesImpl.class); + + private final WebCategoriesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public WebCategoriesImpl( + WebCategoriesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AzureWebCategory get(String name) { + AzureWebCategoryInner inner = this.serviceClient().get(name); + if (inner != null) { + return new AzureWebCategoryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String name, String expand, Context context) { + Response inner = this.serviceClient().getWithResponse(name, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureWebCategoryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AzureWebCategoryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureWebCategoryImpl(inner1, this.manager())); + } + + private WebCategoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java new file mode 100644 index 0000000000000..1af957c3ce12b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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 NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.implementation; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.java new file mode 100644 index 0000000000000..f131d38664e4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.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.network.generated.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; + +/** AAD Vpn authentication type related parameters. */ +@Fluent +public final class AadAuthenticationParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadAuthenticationParameters.class); + + /* + * AAD Vpn authentication parameter AAD tenant. + */ + @JsonProperty(value = "aadTenant") + private String aadTenant; + + /* + * AAD Vpn authentication parameter AAD audience. + */ + @JsonProperty(value = "aadAudience") + private String aadAudience; + + /* + * AAD Vpn authentication parameter AAD issuer. + */ + @JsonProperty(value = "aadIssuer") + private String aadIssuer; + + /** + * Get the aadTenant property: AAD Vpn authentication parameter AAD tenant. + * + * @return the aadTenant value. + */ + public String aadTenant() { + return this.aadTenant; + } + + /** + * Set the aadTenant property: AAD Vpn authentication parameter AAD tenant. + * + * @param aadTenant the aadTenant value to set. + * @return the AadAuthenticationParameters object itself. + */ + public AadAuthenticationParameters withAadTenant(String aadTenant) { + this.aadTenant = aadTenant; + return this; + } + + /** + * Get the aadAudience property: AAD Vpn authentication parameter AAD audience. + * + * @return the aadAudience value. + */ + public String aadAudience() { + return this.aadAudience; + } + + /** + * Set the aadAudience property: AAD Vpn authentication parameter AAD audience. + * + * @param aadAudience the aadAudience value to set. + * @return the AadAuthenticationParameters object itself. + */ + public AadAuthenticationParameters withAadAudience(String aadAudience) { + this.aadAudience = aadAudience; + return this; + } + + /** + * Get the aadIssuer property: AAD Vpn authentication parameter AAD issuer. + * + * @return the aadIssuer value. + */ + public String aadIssuer() { + return this.aadIssuer; + } + + /** + * Set the aadIssuer property: AAD Vpn authentication parameter AAD issuer. + * + * @param aadIssuer the aadIssuer value to set. + * @return the AadAuthenticationParameters object itself. + */ + public AadAuthenticationParameters withAadIssuer(String aadIssuer) { + this.aadIssuer = aadIssuer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Access.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Access.java new file mode 100644 index 0000000000000..9c4ff18411b3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Access.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Access. */ +public final class Access extends ExpandableStringEnum { + /** Static value Allow for Access. */ + public static final Access ALLOW = fromString("Allow"); + + /** Static value Deny for Access. */ + public static final Access DENY = fromString("Deny"); + + /** + * Creates or finds a Access from its string representation. + * + * @param name a name to look for. + * @return the corresponding Access. + */ + @JsonCreator + public static Access fromString(String name) { + return fromString(name, Access.class); + } + + /** @return known Access values. */ + public static Collection values() { + return values(Access.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressSpace.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressSpace.java new file mode 100644 index 0000000000000..7094963b81261 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressSpace.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.network.generated.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; + +/** AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. */ +@Fluent +public final class AddressSpace { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressSpace.class); + + /* + * A list of address blocks reserved for this virtual network in CIDR + * notation. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /** + * Get the addressPrefixes property: A list of address blocks reserved for this virtual network in CIDR notation. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: A list of address blocks reserved for this virtual network in CIDR notation. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the AddressSpace object itself. + */ + public AddressSpace withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateway.java new file mode 100644 index 0000000000000..5eb3f975b6305 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateway.java @@ -0,0 +1,936 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApplicationGateway. */ +public interface ApplicationGateway { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the identity property: The identity of the application gateway, if configured. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the sku property: SKU of the application gateway resource. + * + * @return the sku value. + */ + ApplicationGatewaySku sku(); + + /** + * Gets the sslPolicy property: SSL policy of the application gateway resource. + * + * @return the sslPolicy value. + */ + ApplicationGatewaySslPolicy sslPolicy(); + + /** + * Gets the operationalState property: Operational state of the application gateway resource. + * + * @return the operationalState value. + */ + ApplicationGatewayOperationalState operationalState(); + + /** + * Gets the gatewayIpConfigurations property: Subnets of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the gatewayIpConfigurations value. + */ + List gatewayIpConfigurations(); + + /** + * Gets the authenticationCertificates property: Authentication certificates of the application gateway resource. + * For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the authenticationCertificates value. + */ + List authenticationCertificates(); + + /** + * Gets the trustedRootCertificates property: Trusted Root certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the trustedRootCertificates value. + */ + List trustedRootCertificates(); + + /** + * Gets the trustedClientCertificates property: Trusted client certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the trustedClientCertificates value. + */ + List trustedClientCertificates(); + + /** + * Gets the sslCertificates property: SSL certificates of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the sslCertificates value. + */ + List sslCertificates(); + + /** + * Gets the frontendIpConfigurations property: Frontend IP addresses of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the frontendIpConfigurations value. + */ + List frontendIpConfigurations(); + + /** + * Gets the frontendPorts property: Frontend ports of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the frontendPorts value. + */ + List frontendPorts(); + + /** + * Gets the probes property: Probes of the application gateway resource. + * + * @return the probes value. + */ + List probes(); + + /** + * Gets the backendAddressPools property: Backend address pool of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * Gets the backendHttpSettingsCollection property: Backend http settings of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the backendHttpSettingsCollection value. + */ + List backendHttpSettingsCollection(); + + /** + * Gets the httpListeners property: Http listeners of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the httpListeners value. + */ + List httpListeners(); + + /** + * Gets the sslProfiles property: SSL profiles of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the sslProfiles value. + */ + List sslProfiles(); + + /** + * Gets the urlPathMaps property: URL path map of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the urlPathMaps value. + */ + List urlPathMaps(); + + /** + * Gets the requestRoutingRules property: Request routing rules of the application gateway resource. + * + * @return the requestRoutingRules value. + */ + List requestRoutingRules(); + + /** + * Gets the rewriteRuleSets property: Rewrite rules for the application gateway resource. + * + * @return the rewriteRuleSets value. + */ + List rewriteRuleSets(); + + /** + * Gets the redirectConfigurations property: Redirect configurations of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the redirectConfigurations value. + */ + List redirectConfigurations(); + + /** + * Gets the webApplicationFirewallConfiguration property: Web application firewall configuration. + * + * @return the webApplicationFirewallConfiguration value. + */ + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration(); + + /** + * Gets the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @return the firewallPolicy value. + */ + SubResource firewallPolicy(); + + /** + * Gets the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource. + * + * @return the enableHttp2 value. + */ + Boolean enableHttp2(); + + /** + * Gets the enableFips property: Whether FIPS is enabled on the application gateway resource. + * + * @return the enableFips value. + */ + Boolean enableFips(); + + /** + * Gets the autoscaleConfiguration property: Autoscale Configuration. + * + * @return the autoscaleConfiguration value. + */ + ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration(); + + /** + * Gets the privateLinkConfigurations property: PrivateLink configurations on application gateway. + * + * @return the privateLinkConfigurations value. + */ + List privateLinkConfigurations(); + + /** + * Gets the privateEndpointConnections property: Private Endpoint connections on application gateway. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the resourceGuid property: The resource GUID property of the application gateway resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the application gateway resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the customErrorConfigurations property: Custom error configurations of the application gateway resource. + * + * @return the customErrorConfigurations value. + */ + List customErrorConfigurations(); + + /** + * Gets the forceFirewallPolicyAssociation property: If true, associates a firewall policy with an application + * gateway regardless whether the policy differs from the WAF Config. + * + * @return the forceFirewallPolicyAssociation value. + */ + Boolean forceFirewallPolicyAssociation(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.ApplicationGatewayInner object. + * + * @return the inner object. + */ + ApplicationGatewayInner innerModel(); + + /** The entirety of the ApplicationGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ApplicationGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ApplicationGateway 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 ApplicationGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ApplicationGateway 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.WithZones, + DefinitionStages.WithIdentity, + DefinitionStages.WithSku, + DefinitionStages.WithSslPolicy, + DefinitionStages.WithGatewayIpConfigurations, + DefinitionStages.WithAuthenticationCertificates, + DefinitionStages.WithTrustedRootCertificates, + DefinitionStages.WithTrustedClientCertificates, + DefinitionStages.WithSslCertificates, + DefinitionStages.WithFrontendIpConfigurations, + DefinitionStages.WithFrontendPorts, + DefinitionStages.WithProbes, + DefinitionStages.WithBackendAddressPools, + DefinitionStages.WithBackendHttpSettingsCollection, + DefinitionStages.WithHttpListeners, + DefinitionStages.WithSslProfiles, + DefinitionStages.WithUrlPathMaps, + DefinitionStages.WithRequestRoutingRules, + DefinitionStages.WithRewriteRuleSets, + DefinitionStages.WithRedirectConfigurations, + DefinitionStages.WithWebApplicationFirewallConfiguration, + DefinitionStages.WithFirewallPolicy, + DefinitionStages.WithEnableHttp2, + DefinitionStages.WithEnableFips, + DefinitionStages.WithAutoscaleConfiguration, + DefinitionStages.WithPrivateLinkConfigurations, + DefinitionStages.WithCustomErrorConfigurations, + DefinitionStages.WithForceFirewallPolicyAssociation { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationGateway create(Context context); + } + /** The stage of the ApplicationGateway 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 ApplicationGateway definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting where the resource needs to come + * from.. + * + * @param zones A list of availability zones denoting where the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the ApplicationGateway definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the application gateway, if configured.. + * + * @param identity The identity of the application gateway, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the ApplicationGateway definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU of the application gateway resource.. + * + * @param sku SKU of the application gateway resource. + * @return the next definition stage. + */ + WithCreate withSku(ApplicationGatewaySku sku); + } + /** The stage of the ApplicationGateway definition allowing to specify sslPolicy. */ + interface WithSslPolicy { + /** + * Specifies the sslPolicy property: SSL policy of the application gateway resource.. + * + * @param sslPolicy SSL policy of the application gateway resource. + * @return the next definition stage. + */ + WithCreate withSslPolicy(ApplicationGatewaySslPolicy sslPolicy); + } + /** The stage of the ApplicationGateway definition allowing to specify gatewayIpConfigurations. */ + interface WithGatewayIpConfigurations { + /** + * Specifies the gatewayIpConfigurations property: Subnets of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param gatewayIpConfigurations Subnets of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withGatewayIpConfigurations(List gatewayIpConfigurations); + } + /** The stage of the ApplicationGateway definition allowing to specify authenticationCertificates. */ + interface WithAuthenticationCertificates { + /** + * Specifies the authenticationCertificates property: Authentication certificates of the application gateway + * resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param authenticationCertificates Authentication certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withAuthenticationCertificates( + List authenticationCertificates); + } + /** The stage of the ApplicationGateway definition allowing to specify trustedRootCertificates. */ + interface WithTrustedRootCertificates { + /** + * Specifies the trustedRootCertificates property: Trusted Root certificates of the application gateway + * resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param trustedRootCertificates Trusted Root certificates of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withTrustedRootCertificates( + List trustedRootCertificates); + } + /** The stage of the ApplicationGateway definition allowing to specify trustedClientCertificates. */ + interface WithTrustedClientCertificates { + /** + * Specifies the trustedClientCertificates property: Trusted client certificates of the application gateway + * resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param trustedClientCertificates Trusted client certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withTrustedClientCertificates( + List trustedClientCertificates); + } + /** The stage of the ApplicationGateway definition allowing to specify sslCertificates. */ + interface WithSslCertificates { + /** + * Specifies the sslCertificates property: SSL certificates of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param sslCertificates SSL certificates of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withSslCertificates(List sslCertificates); + } + /** The stage of the ApplicationGateway definition allowing to specify frontendIpConfigurations. */ + interface WithFrontendIpConfigurations { + /** + * Specifies the frontendIpConfigurations property: Frontend IP addresses of the application gateway + * resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param frontendIpConfigurations Frontend IP addresses of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withFrontendIpConfigurations( + List frontendIpConfigurations); + } + /** The stage of the ApplicationGateway definition allowing to specify frontendPorts. */ + interface WithFrontendPorts { + /** + * Specifies the frontendPorts property: Frontend ports of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param frontendPorts Frontend ports of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withFrontendPorts(List frontendPorts); + } + /** The stage of the ApplicationGateway definition allowing to specify probes. */ + interface WithProbes { + /** + * Specifies the probes property: Probes of the application gateway resource.. + * + * @param probes Probes of the application gateway resource. + * @return the next definition stage. + */ + WithCreate withProbes(List probes); + } + /** The stage of the ApplicationGateway definition allowing to specify backendAddressPools. */ + interface WithBackendAddressPools { + /** + * Specifies the backendAddressPools property: Backend address pool of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param backendAddressPools Backend address pool of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withBackendAddressPools(List backendAddressPools); + } + /** The stage of the ApplicationGateway definition allowing to specify backendHttpSettingsCollection. */ + interface WithBackendHttpSettingsCollection { + /** + * Specifies the backendHttpSettingsCollection property: Backend http settings of the application gateway + * resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param backendHttpSettingsCollection Backend http settings of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withBackendHttpSettingsCollection( + List backendHttpSettingsCollection); + } + /** The stage of the ApplicationGateway definition allowing to specify httpListeners. */ + interface WithHttpListeners { + /** + * Specifies the httpListeners property: Http listeners of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param httpListeners Http listeners of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withHttpListeners(List httpListeners); + } + /** The stage of the ApplicationGateway definition allowing to specify sslProfiles. */ + interface WithSslProfiles { + /** + * Specifies the sslProfiles property: SSL profiles of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param sslProfiles SSL profiles of the application gateway resource. For default limits, see [Application + * Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withSslProfiles(List sslProfiles); + } + /** The stage of the ApplicationGateway definition allowing to specify urlPathMaps. */ + interface WithUrlPathMaps { + /** + * Specifies the urlPathMaps property: URL path map of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param urlPathMaps URL path map of the application gateway resource. For default limits, see [Application + * Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withUrlPathMaps(List urlPathMaps); + } + /** The stage of the ApplicationGateway definition allowing to specify requestRoutingRules. */ + interface WithRequestRoutingRules { + /** + * Specifies the requestRoutingRules property: Request routing rules of the application gateway resource.. + * + * @param requestRoutingRules Request routing rules of the application gateway resource. + * @return the next definition stage. + */ + WithCreate withRequestRoutingRules(List requestRoutingRules); + } + /** The stage of the ApplicationGateway definition allowing to specify rewriteRuleSets. */ + interface WithRewriteRuleSets { + /** + * Specifies the rewriteRuleSets property: Rewrite rules for the application gateway resource.. + * + * @param rewriteRuleSets Rewrite rules for the application gateway resource. + * @return the next definition stage. + */ + WithCreate withRewriteRuleSets(List rewriteRuleSets); + } + /** The stage of the ApplicationGateway definition allowing to specify redirectConfigurations. */ + interface WithRedirectConfigurations { + /** + * Specifies the redirectConfigurations property: Redirect configurations of the application gateway + * resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param redirectConfigurations Redirect configurations of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withRedirectConfigurations(List redirectConfigurations); + } + /** The stage of the ApplicationGateway definition allowing to specify webApplicationFirewallConfiguration. */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies the webApplicationFirewallConfiguration property: Web application firewall configuration.. + * + * @param webApplicationFirewallConfiguration Web application firewall configuration. + * @return the next definition stage. + */ + WithCreate withWebApplicationFirewallConfiguration( + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + /** The stage of the ApplicationGateway definition allowing to specify firewallPolicy. */ + interface WithFirewallPolicy { + /** + * Specifies the firewallPolicy property: Reference to the FirewallPolicy resource.. + * + * @param firewallPolicy Reference to the FirewallPolicy resource. + * @return the next definition stage. + */ + WithCreate withFirewallPolicy(SubResource firewallPolicy); + } + /** The stage of the ApplicationGateway definition allowing to specify enableHttp2. */ + interface WithEnableHttp2 { + /** + * Specifies the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource.. + * + * @param enableHttp2 Whether HTTP2 is enabled on the application gateway resource. + * @return the next definition stage. + */ + WithCreate withEnableHttp2(Boolean enableHttp2); + } + /** The stage of the ApplicationGateway definition allowing to specify enableFips. */ + interface WithEnableFips { + /** + * Specifies the enableFips property: Whether FIPS is enabled on the application gateway resource.. + * + * @param enableFips Whether FIPS is enabled on the application gateway resource. + * @return the next definition stage. + */ + WithCreate withEnableFips(Boolean enableFips); + } + /** The stage of the ApplicationGateway definition allowing to specify autoscaleConfiguration. */ + interface WithAutoscaleConfiguration { + /** + * Specifies the autoscaleConfiguration property: Autoscale Configuration.. + * + * @param autoscaleConfiguration Autoscale Configuration. + * @return the next definition stage. + */ + WithCreate withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + /** The stage of the ApplicationGateway definition allowing to specify privateLinkConfigurations. */ + interface WithPrivateLinkConfigurations { + /** + * Specifies the privateLinkConfigurations property: PrivateLink configurations on application gateway.. + * + * @param privateLinkConfigurations PrivateLink configurations on application gateway. + * @return the next definition stage. + */ + WithCreate withPrivateLinkConfigurations( + List privateLinkConfigurations); + } + /** The stage of the ApplicationGateway definition allowing to specify customErrorConfigurations. */ + interface WithCustomErrorConfigurations { + /** + * Specifies the customErrorConfigurations property: Custom error configurations of the application gateway + * resource.. + * + * @param customErrorConfigurations Custom error configurations of the application gateway resource. + * @return the next definition stage. + */ + WithCreate withCustomErrorConfigurations(List customErrorConfigurations); + } + /** The stage of the ApplicationGateway definition allowing to specify forceFirewallPolicyAssociation. */ + interface WithForceFirewallPolicyAssociation { + /** + * Specifies the forceFirewallPolicyAssociation property: If true, associates a firewall policy with an + * application gateway regardless whether the policy differs from the WAF Config.. + * + * @param forceFirewallPolicyAssociation If true, associates a firewall policy with an application gateway + * regardless whether the policy differs from the WAF Config. + * @return the next definition stage. + */ + WithCreate withForceFirewallPolicyAssociation(Boolean forceFirewallPolicyAssociation); + } + } + /** + * Begins update for the ApplicationGateway resource. + * + * @return the stage of resource update. + */ + ApplicationGateway.Update update(); + + /** The template for ApplicationGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApplicationGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApplicationGateway apply(Context context); + } + /** The ApplicationGateway update stages. */ + interface UpdateStages { + /** The stage of the ApplicationGateway 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationGateway refresh(Context context); + + /** + * Starts the specified application gateway. + * + * @throws com.azure.core.management.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 start(); + + /** + * Starts the specified application gateway. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(Context context); + + /** + * Stops the specified application gateway in a resource group. + * + * @throws com.azure.core.management.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 stop(); + + /** + * Stops the specified application gateway in a resource 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. + */ + void stop(Context context); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth(String expand); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth(); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth(String expand, Context context); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + ApplicationGatewayOnDemandProbe probeRequest, String expand); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand(ApplicationGatewayOnDemandProbe probeRequest); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAuthenticationCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAuthenticationCertificate.java new file mode 100644 index 0000000000000..c79b204351908 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAuthenticationCertificate.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authentication certificates of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayAuthenticationCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayAuthenticationCertificate.class); + + /* + * Name of the authentication certificate that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Certificate public data. + */ + @JsonProperty(value = "properties.data") + private String data; + + /* + * The provisioning state of the authentication certificate resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the authentication certificate that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the authentication certificate that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the data property: Certificate public data. + * + * @return the data value. + */ + public String data() { + return this.data; + } + + /** + * Set the data property: Certificate public data. + * + * @param data the data value to set. + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the authentication certificate resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayAuthenticationCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAutoscaleConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAutoscaleConfiguration.java new file mode 100644 index 0000000000000..2cdccb0dde0e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAutoscaleConfiguration.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.network.generated.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; + +/** Application Gateway autoscale configuration. */ +@Fluent +public final class ApplicationGatewayAutoscaleConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayAutoscaleConfiguration.class); + + /* + * Lower bound on number of Application Gateway capacity. + */ + @JsonProperty(value = "minCapacity", required = true) + private int minCapacity; + + /* + * Upper bound on number of Application Gateway capacity. + */ + @JsonProperty(value = "maxCapacity") + private Integer maxCapacity; + + /** + * Get the minCapacity property: Lower bound on number of Application Gateway capacity. + * + * @return the minCapacity value. + */ + public int minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity property: Lower bound on number of Application Gateway capacity. + * + * @param minCapacity the minCapacity value to set. + * @return the ApplicationGatewayAutoscaleConfiguration object itself. + */ + public ApplicationGatewayAutoscaleConfiguration withMinCapacity(int minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Get the maxCapacity property: Upper bound on number of Application Gateway capacity. + * + * @return the maxCapacity value. + */ + public Integer maxCapacity() { + return this.maxCapacity; + } + + /** + * Set the maxCapacity property: Upper bound on number of Application Gateway capacity. + * + * @param maxCapacity the maxCapacity value to set. + * @return the ApplicationGatewayAutoscaleConfiguration object itself. + */ + public ApplicationGatewayAutoscaleConfiguration withMaxCapacity(Integer maxCapacity) { + this.maxCapacity = maxCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslOptions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslOptions.java new file mode 100644 index 0000000000000..1348fe343902a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslOptions.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.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApplicationGatewayAvailableSslOptions. */ +public interface ApplicationGatewayAvailableSslOptions { + /** + * 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 predefinedPolicies property: List of available Ssl predefined policy. + * + * @return the predefinedPolicies value. + */ + List predefinedPolicies(); + + /** + * Gets the defaultPolicy property: Name of the Ssl predefined policy applied by default to application gateway. + * + * @return the defaultPolicy value. + */ + ApplicationGatewaySslPolicyName defaultPolicy(); + + /** + * Gets the availableCipherSuites property: List of available Ssl cipher suites. + * + * @return the availableCipherSuites value. + */ + List availableCipherSuites(); + + /** + * Gets the availableProtocols property: List of available Ssl protocols. + * + * @return the availableProtocols value. + */ + List availableProtocols(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner object. + * + * @return the inner object. + */ + ApplicationGatewayAvailableSslOptionsInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslPredefinedPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslPredefinedPolicies.java new file mode 100644 index 0000000000000..5d5ff873a9ddf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslPredefinedPolicies.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayAvailableSslOptions API service call. */ +@Fluent +public final class ApplicationGatewayAvailableSslPredefinedPolicies { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableSslPredefinedPolicies.class); + + /* + * List of available Ssl predefined policy. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of available Ssl predefined policy. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of available Ssl predefined policy. + * + * @param value the value value to set. + * @return the ApplicationGatewayAvailableSslPredefinedPolicies object itself. + */ + public ApplicationGatewayAvailableSslPredefinedPolicies withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationGatewayAvailableSslPredefinedPolicies object itself. + */ + public ApplicationGatewayAvailableSslPredefinedPolicies withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java new file mode 100644 index 0000000000000..0c5a08586e750 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewayAvailableWafRuleSetsResult. */ +public interface ApplicationGatewayAvailableWafRuleSetsResult { + /** + * Gets the value property: The list of application gateway rule sets. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner + * object. + * + * @return the inner object. + */ + ApplicationGatewayAvailableWafRuleSetsResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.java new file mode 100644 index 0000000000000..ea5efe8b7075b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.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.network.generated.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; + +/** Backend address of an application gateway. */ +@Fluent +public final class ApplicationGatewayBackendAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendAddress.class); + + /* + * Fully qualified domain name (FQDN). + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * Get the fqdn property: Fully qualified domain name (FQDN). + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Fully qualified domain name (FQDN). + * + * @param fqdn the fqdn value to set. + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the ipAddress property: IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddressPool.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddressPool.java new file mode 100644 index 0000000000000..8b8027ea8d7ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddressPool.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Backend Address Pool of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayBackendAddressPool extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendAddressPool.class); + + /* + * Name of the backend address pool that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Collection of references to IPs defined in network interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List backendIpConfigurations; + + /* + * Backend addresses. + */ + @JsonProperty(value = "properties.backendAddresses") + private List backendAddresses; + + /* + * The provisioning state of the backend address pool resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the backend address pool that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the backend address pool that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the backendIpConfigurations property: Collection of references to IPs defined in network interfaces. + * + * @return the backendIpConfigurations value. + */ + public List backendIpConfigurations() { + return this.backendIpConfigurations; + } + + /** + * Get the backendAddresses property: Backend addresses. + * + * @return the backendAddresses value. + */ + public List backendAddresses() { + return this.backendAddresses; + } + + /** + * Set the backendAddresses property: Backend addresses. + * + * @param backendAddresses the backendAddresses value to set. + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withBackendAddresses( + List backendAddresses) { + this.backendAddresses = backendAddresses; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the backend address pool resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayBackendAddressPool withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendIpConfigurations() != null) { + backendIpConfigurations().forEach(e -> e.validate()); + } + if (backendAddresses() != null) { + backendAddresses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealth.java new file mode 100644 index 0000000000000..ea3f07d9fe718 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealth.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewayBackendHealth. */ +public interface ApplicationGatewayBackendHealth { + /** + * Gets the backendAddressPools property: A list of ApplicationGatewayBackendHealthPool resources. + * + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner + * object. + * + * @return the inner object. + */ + ApplicationGatewayBackendHealthInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthHttpSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthHttpSettings.java new file mode 100644 index 0000000000000..ea1e24e383eb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthHttpSettings.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application gateway BackendHealthHttp settings. */ +@Fluent +public final class ApplicationGatewayBackendHealthHttpSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthHttpSettings.class); + + /* + * Reference to an ApplicationGatewayBackendHttpSettings resource. + */ + @JsonProperty(value = "backendHttpSettings") + private ApplicationGatewayBackendHttpSettings backendHttpSettings; + + /* + * List of ApplicationGatewayBackendHealthServer resources. + */ + @JsonProperty(value = "servers") + private List servers; + + /** + * Get the backendHttpSettings property: Reference to an ApplicationGatewayBackendHttpSettings resource. + * + * @return the backendHttpSettings value. + */ + public ApplicationGatewayBackendHttpSettings backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set the backendHttpSettings property: Reference to an ApplicationGatewayBackendHttpSettings resource. + * + * @param backendHttpSettings the backendHttpSettings value to set. + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withBackendHttpSettings( + ApplicationGatewayBackendHttpSettings backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get the servers property: List of ApplicationGatewayBackendHealthServer resources. + * + * @return the servers value. + */ + public List servers() { + return this.servers; + } + + /** + * Set the servers property: List of ApplicationGatewayBackendHealthServer resources. + * + * @param servers the servers value to set. + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withServers( + List servers) { + this.servers = servers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendHttpSettings() != null) { + backendHttpSettings().validate(); + } + if (servers() != null) { + servers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.java new file mode 100644 index 0000000000000..890d6baacbd45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; + +/** An immutable client-side representation of ApplicationGatewayBackendHealthOnDemand. */ +public interface ApplicationGatewayBackendHealthOnDemand { + /** + * Gets the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value. + */ + ApplicationGatewayBackendAddressPool backendAddressPool(); + + /** + * Gets the backendHealthHttpSettings property: Application gateway BackendHealthHttp settings. + * + * @return the backendHealthHttpSettings value. + */ + ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner object. + * + * @return the inner object. + */ + ApplicationGatewayBackendHealthOnDemandInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java new file mode 100644 index 0000000000000..8b427bb340ad8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Application gateway BackendHealth pool. */ +@Fluent +public final class ApplicationGatewayBackendHealthPool { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthPool.class); + + /* + * Reference to an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /* + * List of ApplicationGatewayBackendHealthHttpSettings resources. + */ + @JsonProperty(value = "backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Get the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value. + */ + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendAddressPool( + ApplicationGatewayBackendAddressPool backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendHttpSettingsCollection property: List of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @return the backendHttpSettingsCollection value. + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set the backendHttpSettingsCollection property: List of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set. + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendHttpSettingsCollection( + List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendAddressPool() != null) { + backendAddressPool().validate(); + } + if (backendHttpSettingsCollection() != null) { + backendHttpSettingsCollection().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.java new file mode 100644 index 0000000000000..f0aa53696f06c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner; + +/** An immutable client-side representation of ApplicationGatewayBackendHealthServer. */ +public interface ApplicationGatewayBackendHealthServer { + /** + * Gets the address property: IP address or FQDN of backend server. + * + * @return the address value. + */ + String address(); + + /** + * Gets the ipConfiguration property: Reference to IP configuration of backend server. + * + * @return the ipConfiguration value. + */ + NetworkInterfaceIpConfiguration ipConfiguration(); + + /** + * Gets the health property: Health of backend server. + * + * @return the health value. + */ + ApplicationGatewayBackendHealthServerHealth health(); + + /** + * Gets the healthProbeLog property: Health Probe Log. + * + * @return the healthProbeLog value. + */ + String healthProbeLog(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner object. + * + * @return the inner object. + */ + ApplicationGatewayBackendHealthServerInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.java new file mode 100644 index 0000000000000..b18a8b030fab6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayBackendHealthServerHealth. */ +public final class ApplicationGatewayBackendHealthServerHealth + extends ExpandableStringEnum { + /** Static value Unknown for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UNKNOWN = fromString("Unknown"); + + /** Static value Up for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UP = fromString("Up"); + + /** Static value Down for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DOWN = fromString("Down"); + + /** Static value Partial for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth PARTIAL = fromString("Partial"); + + /** Static value Draining for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DRAINING = fromString("Draining"); + + /** + * Creates or finds a ApplicationGatewayBackendHealthServerHealth from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayBackendHealthServerHealth. + */ + @JsonCreator + public static ApplicationGatewayBackendHealthServerHealth fromString(String name) { + return fromString(name, ApplicationGatewayBackendHealthServerHealth.class); + } + + /** @return known ApplicationGatewayBackendHealthServerHealth values. */ + public static Collection values() { + return values(ApplicationGatewayBackendHealthServerHealth.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHttpSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHttpSettings.java new file mode 100644 index 0000000000000..57b929c0c1ff2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHttpSettings.java @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Backend address pool settings of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayBackendHttpSettings extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHttpSettings.class); + + /* + * Name of the backend http settings that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The destination port on the backend. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /* + * The protocol used to communicate with the backend. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Cookie based affinity. + */ + @JsonProperty(value = "properties.cookieBasedAffinity") + private ApplicationGatewayCookieBasedAffinity cookieBasedAffinity; + + /* + * Request timeout in seconds. Application Gateway will fail the request if + * response is not received within RequestTimeout. Acceptable values are + * from 1 second to 86400 seconds. + */ + @JsonProperty(value = "properties.requestTimeout") + private Integer requestTimeout; + + /* + * Probe resource of an application gateway. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /* + * Array of references to application gateway authentication certificates. + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /* + * Array of references to application gateway trusted root certificates. + */ + @JsonProperty(value = "properties.trustedRootCertificates") + private List trustedRootCertificates; + + /* + * Connection draining of the backend http settings resource. + */ + @JsonProperty(value = "properties.connectionDraining") + private ApplicationGatewayConnectionDraining connectionDraining; + + /* + * Host header to be sent to the backend servers. + */ + @JsonProperty(value = "properties.hostName") + private String hostname; + + /* + * Whether to pick host header should be picked from the host name of the + * backend server. Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendAddress") + private Boolean pickHostnameFromBackendAddress; + + /* + * Cookie name to use for the affinity cookie. + */ + @JsonProperty(value = "properties.affinityCookieName") + private String affinityCookieName; + + /* + * Whether the probe is enabled. Default value is false. + */ + @JsonProperty(value = "properties.probeEnabled") + private Boolean probeEnabled; + + /* + * Path which should be used as a prefix for all HTTP requests. Null means + * no path will be prefixed. Default value is null. + */ + @JsonProperty(value = "properties.path") + private String path; + + /* + * The provisioning state of the backend HTTP settings resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the backend http settings that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the backend http settings that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the port property: The destination port on the backend. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The destination port on the backend. + * + * @param port the port value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the protocol property: The protocol used to communicate with the backend. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol used to communicate with the backend. + * + * @param protocol the protocol value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the cookieBasedAffinity property: Cookie based affinity. + * + * @return the cookieBasedAffinity value. + */ + public ApplicationGatewayCookieBasedAffinity cookieBasedAffinity() { + return this.cookieBasedAffinity; + } + + /** + * Set the cookieBasedAffinity property: Cookie based affinity. + * + * @param cookieBasedAffinity the cookieBasedAffinity value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withCookieBasedAffinity( + ApplicationGatewayCookieBasedAffinity cookieBasedAffinity) { + this.cookieBasedAffinity = cookieBasedAffinity; + return this; + } + + /** + * Get the requestTimeout property: Request timeout in seconds. Application Gateway will fail the request if + * response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @return the requestTimeout value. + */ + public Integer requestTimeout() { + return this.requestTimeout; + } + + /** + * Set the requestTimeout property: Request timeout in seconds. Application Gateway will fail the request if + * response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @param requestTimeout the requestTimeout value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withRequestTimeout(Integer requestTimeout) { + this.requestTimeout = requestTimeout; + return this; + } + + /** + * Get the probe property: Probe resource of an application gateway. + * + * @return the probe value. + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set the probe property: Probe resource of an application gateway. + * + * @param probe the probe value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get the authenticationCertificates property: Array of references to application gateway authentication + * certificates. + * + * @return the authenticationCertificates value. + */ + public List authenticationCertificates() { + return this.authenticationCertificates; + } + + /** + * Set the authenticationCertificates property: Array of references to application gateway authentication + * certificates. + * + * @param authenticationCertificates the authenticationCertificates value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAuthenticationCertificates( + List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get the trustedRootCertificates property: Array of references to application gateway trusted root certificates. + * + * @return the trustedRootCertificates value. + */ + public List trustedRootCertificates() { + return this.trustedRootCertificates; + } + + /** + * Set the trustedRootCertificates property: Array of references to application gateway trusted root certificates. + * + * @param trustedRootCertificates the trustedRootCertificates value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withTrustedRootCertificates( + List trustedRootCertificates) { + this.trustedRootCertificates = trustedRootCertificates; + return this; + } + + /** + * Get the connectionDraining property: Connection draining of the backend http settings resource. + * + * @return the connectionDraining value. + */ + public ApplicationGatewayConnectionDraining connectionDraining() { + return this.connectionDraining; + } + + /** + * Set the connectionDraining property: Connection draining of the backend http settings resource. + * + * @param connectionDraining the connectionDraining value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withConnectionDraining( + ApplicationGatewayConnectionDraining connectionDraining) { + this.connectionDraining = connectionDraining; + return this; + } + + /** + * Get the hostname property: Host header to be sent to the backend servers. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Host header to be sent to the backend servers. + * + * @param hostname the hostname value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the pickHostnameFromBackendAddress property: Whether to pick host header should be picked from the host name + * of the backend server. Default value is false. + * + * @return the pickHostnameFromBackendAddress value. + */ + public Boolean pickHostnameFromBackendAddress() { + return this.pickHostnameFromBackendAddress; + } + + /** + * Set the pickHostnameFromBackendAddress property: Whether to pick host header should be picked from the host name + * of the backend server. Default value is false. + * + * @param pickHostnameFromBackendAddress the pickHostnameFromBackendAddress value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPickHostnameFromBackendAddress( + Boolean pickHostnameFromBackendAddress) { + this.pickHostnameFromBackendAddress = pickHostnameFromBackendAddress; + return this; + } + + /** + * Get the affinityCookieName property: Cookie name to use for the affinity cookie. + * + * @return the affinityCookieName value. + */ + public String affinityCookieName() { + return this.affinityCookieName; + } + + /** + * Set the affinityCookieName property: Cookie name to use for the affinity cookie. + * + * @param affinityCookieName the affinityCookieName value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAffinityCookieName(String affinityCookieName) { + this.affinityCookieName = affinityCookieName; + return this; + } + + /** + * Get the probeEnabled property: Whether the probe is enabled. Default value is false. + * + * @return the probeEnabled value. + */ + public Boolean probeEnabled() { + return this.probeEnabled; + } + + /** + * Set the probeEnabled property: Whether the probe is enabled. Default value is false. + * + * @param probeEnabled the probeEnabled value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbeEnabled(Boolean probeEnabled) { + this.probeEnabled = probeEnabled; + return this; + } + + /** + * Get the path property: Path which should be used as a prefix for all HTTP requests. Null means no path will be + * prefixed. Default value is null. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path which should be used as a prefix for all HTTP requests. Null means no path will be + * prefixed. Default value is null. + * + * @param path the path value to set. + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the backend HTTP settings resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayBackendHttpSettings withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionDraining() != null) { + connectionDraining().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientAuthConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientAuthConfiguration.java new file mode 100644 index 0000000000000..3634d3838d4d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientAuthConfiguration.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.network.generated.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; + +/** Application gateway client authentication configuration. */ +@Fluent +public final class ApplicationGatewayClientAuthConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayClientAuthConfiguration.class); + + /* + * Verify client certificate issuer name on the application gateway. + */ + @JsonProperty(value = "verifyClientCertIssuerDN") + private Boolean verifyClientCertIssuerDN; + + /** + * Get the verifyClientCertIssuerDN property: Verify client certificate issuer name on the application gateway. + * + * @return the verifyClientCertIssuerDN value. + */ + public Boolean verifyClientCertIssuerDN() { + return this.verifyClientCertIssuerDN; + } + + /** + * Set the verifyClientCertIssuerDN property: Verify client certificate issuer name on the application gateway. + * + * @param verifyClientCertIssuerDN the verifyClientCertIssuerDN value to set. + * @return the ApplicationGatewayClientAuthConfiguration object itself. + */ + public ApplicationGatewayClientAuthConfiguration withVerifyClientCertIssuerDN(Boolean verifyClientCertIssuerDN) { + this.verifyClientCertIssuerDN = verifyClientCertIssuerDN; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayConnectionDraining.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayConnectionDraining.java new file mode 100644 index 0000000000000..320c4f8d3e2b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayConnectionDraining.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.network.generated.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; + +/** + * Connection draining allows open connections to a backend server to be active for a specified time after the backend + * server got removed from the configuration. + */ +@Fluent +public final class ApplicationGatewayConnectionDraining { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayConnectionDraining.class); + + /* + * Whether connection draining is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The number of seconds connection draining is active. Acceptable values + * are from 1 second to 3600 seconds. + */ + @JsonProperty(value = "drainTimeoutInSec", required = true) + private int drainTimeoutInSec; + + /** + * Get the enabled property: Whether connection draining is enabled or not. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether connection draining is enabled or not. + * + * @param enabled the enabled value to set. + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the drainTimeoutInSec property: The number of seconds connection draining is active. Acceptable values are + * from 1 second to 3600 seconds. + * + * @return the drainTimeoutInSec value. + */ + public int drainTimeoutInSec() { + return this.drainTimeoutInSec; + } + + /** + * Set the drainTimeoutInSec property: The number of seconds connection draining is active. Acceptable values are + * from 1 second to 3600 seconds. + * + * @param drainTimeoutInSec the drainTimeoutInSec value to set. + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withDrainTimeoutInSec(int drainTimeoutInSec) { + this.drainTimeoutInSec = drainTimeoutInSec; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCookieBasedAffinity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCookieBasedAffinity.java new file mode 100644 index 0000000000000..79535131e4562 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCookieBasedAffinity.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayCookieBasedAffinity. */ +public final class ApplicationGatewayCookieBasedAffinity + extends ExpandableStringEnum { + /** Static value Enabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity ENABLED = fromString("Enabled"); + + /** Static value Disabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ApplicationGatewayCookieBasedAffinity from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayCookieBasedAffinity. + */ + @JsonCreator + public static ApplicationGatewayCookieBasedAffinity fromString(String name) { + return fromString(name, ApplicationGatewayCookieBasedAffinity.class); + } + + /** @return known ApplicationGatewayCookieBasedAffinity values. */ + public static Collection values() { + return values(ApplicationGatewayCookieBasedAffinity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomError.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomError.java new file mode 100644 index 0000000000000..a5447bf727762 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomError.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.network.generated.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; + +/** Customer error of an application gateway. */ +@Fluent +public final class ApplicationGatewayCustomError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayCustomError.class); + + /* + * Status code of the application gateway customer error. + */ + @JsonProperty(value = "statusCode") + private ApplicationGatewayCustomErrorStatusCode statusCode; + + /* + * Error page URL of the application gateway customer error. + */ + @JsonProperty(value = "customErrorPageUrl") + private String customErrorPageUrl; + + /** + * Get the statusCode property: Status code of the application gateway customer error. + * + * @return the statusCode value. + */ + public ApplicationGatewayCustomErrorStatusCode statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: Status code of the application gateway customer error. + * + * @param statusCode the statusCode value to set. + * @return the ApplicationGatewayCustomError object itself. + */ + public ApplicationGatewayCustomError withStatusCode(ApplicationGatewayCustomErrorStatusCode statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the customErrorPageUrl property: Error page URL of the application gateway customer error. + * + * @return the customErrorPageUrl value. + */ + public String customErrorPageUrl() { + return this.customErrorPageUrl; + } + + /** + * Set the customErrorPageUrl property: Error page URL of the application gateway customer error. + * + * @param customErrorPageUrl the customErrorPageUrl value to set. + * @return the ApplicationGatewayCustomError object itself. + */ + public ApplicationGatewayCustomError withCustomErrorPageUrl(String customErrorPageUrl) { + this.customErrorPageUrl = customErrorPageUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomErrorStatusCode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomErrorStatusCode.java new file mode 100644 index 0000000000000..6f0bd2d98ef78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomErrorStatusCode.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayCustomErrorStatusCode. */ +public final class ApplicationGatewayCustomErrorStatusCode + extends ExpandableStringEnum { + /** Static value HttpStatus403 for ApplicationGatewayCustomErrorStatusCode. */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS403 = fromString("HttpStatus403"); + + /** Static value HttpStatus502 for ApplicationGatewayCustomErrorStatusCode. */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS502 = fromString("HttpStatus502"); + + /** + * Creates or finds a ApplicationGatewayCustomErrorStatusCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayCustomErrorStatusCode. + */ + @JsonCreator + public static ApplicationGatewayCustomErrorStatusCode fromString(String name) { + return fromString(name, ApplicationGatewayCustomErrorStatusCode.class); + } + + /** @return known ApplicationGatewayCustomErrorStatusCode values. */ + public static Collection values() { + return values(ApplicationGatewayCustomErrorStatusCode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallDisabledRuleGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallDisabledRuleGroup.java new file mode 100644 index 0000000000000..bdbbc5d26cd88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallDisabledRuleGroup.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Allows to disable rules within a rule group or an entire rule group. */ +@Fluent +public final class ApplicationGatewayFirewallDisabledRuleGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallDisabledRuleGroup.class); + + /* + * The name of the rule group that will be disabled. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * The list of rules that will be disabled. If null, all rules of the rule + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the ruleGroupName property: The name of the rule group that will be disabled. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: The name of the rule group that will be disabled. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the rules property: The list of rules that will be disabled. If null, all rules of the rule group will be + * disabled. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The list of rules that will be disabled. If null, all rules of the rule group will be + * disabled. + * + * @param rules the rules value to set. + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroupName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model" + + " ApplicationGatewayFirewallDisabledRuleGroup")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallExclusion.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallExclusion.java new file mode 100644 index 0000000000000..c3675b672bf20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallExclusion.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Allow to exclude some variable satisfy the condition for the WAF check. */ +@Fluent +public final class ApplicationGatewayFirewallExclusion { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallExclusion.class); + + /* + * The variable to be excluded. + */ + @JsonProperty(value = "matchVariable", required = true) + private String matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selectorMatchOperator", required = true) + private String selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which + * elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selector", required = true) + private String selector; + + /** + * Get the matchVariable property: The variable to be excluded. + * + * @return the matchVariable value. + */ + public String matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: The variable to be excluded. + * + * @param matchVariable the matchVariable value to set. + * @return the ApplicationGatewayFirewallExclusion object itself. + */ + public ApplicationGatewayFirewallExclusion withMatchVariable(String matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + * + * @return the selectorMatchOperator value. + */ + public String selectorMatchOperator() { + return this.selectorMatchOperator; + } + + /** + * Set the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + * + * @param selectorMatchOperator the selectorMatchOperator value to set. + * @return the ApplicationGatewayFirewallExclusion object itself. + */ + public ApplicationGatewayFirewallExclusion withSelectorMatchOperator(String selectorMatchOperator) { + this.selectorMatchOperator = selectorMatchOperator; + return this; + } + + /** + * Get the selector property: When matchVariable is a collection, operator used to specify which elements in the + * collection this exclusion applies to. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: When matchVariable is a collection, operator used to specify which elements in the + * collection this exclusion applies to. + * + * @param selector the selector value to set. + * @return the ApplicationGatewayFirewallExclusion object itself. + */ + public ApplicationGatewayFirewallExclusion withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchVariable in model ApplicationGatewayFirewallExclusion")); + } + if (selectorMatchOperator() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectorMatchOperator in model" + + " ApplicationGatewayFirewallExclusion")); + } + if (selector() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selector in model ApplicationGatewayFirewallExclusion")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallMode.java new file mode 100644 index 0000000000000..3a8bde59b609a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallMode.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayFirewallMode. */ +public final class ApplicationGatewayFirewallMode extends ExpandableStringEnum { + /** Static value Detection for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode DETECTION = fromString("Detection"); + + /** Static value Prevention for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode PREVENTION = fromString("Prevention"); + + /** + * Creates or finds a ApplicationGatewayFirewallMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayFirewallMode. + */ + @JsonCreator + public static ApplicationGatewayFirewallMode fromString(String name) { + return fromString(name, ApplicationGatewayFirewallMode.class); + } + + /** @return known ApplicationGatewayFirewallMode values. */ + public static Collection values() { + return values(ApplicationGatewayFirewallMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRule.java new file mode 100644 index 0000000000000..c4f2f32f85547 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRule.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.network.generated.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; + +/** A web application firewall rule. */ +@Fluent +public final class ApplicationGatewayFirewallRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRule.class); + + /* + * The identifier of the web application firewall rule. + */ + @JsonProperty(value = "ruleId", required = true) + private int ruleId; + + /* + * The description of the web application firewall rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the ruleId property: The identifier of the web application firewall rule. + * + * @return the ruleId value. + */ + public int ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: The identifier of the web application firewall rule. + * + * @param ruleId the ruleId value to set. + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withRuleId(int ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the description property: The description of the web application firewall rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the web application firewall rule. + * + * @param description the description value to set. + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java new file mode 100644 index 0000000000000..beacd6ac2f0cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** A web application firewall rule group. */ +@Fluent +public final class ApplicationGatewayFirewallRuleGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRuleGroup.class); + + /* + * The name of the web application firewall rule group. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * The description of the web application firewall rule group. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The rules of the web application firewall rule group. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the ruleGroupName property: The name of the web application firewall rule group. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: The name of the web application firewall rule group. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the description property: The description of the web application firewall rule group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the web application firewall rule group. + * + * @param description the description value to set. + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rules property: The rules of the web application firewall rule group. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The rules of the web application firewall rule group. + * + * @param rules the rules value to set. + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroupName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model ApplicationGatewayFirewallRuleGroup")); + } + if (rules() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rules in model ApplicationGatewayFirewallRuleGroup")); + } else { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.java new file mode 100644 index 0000000000000..1392419331fda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A web application firewall rule set. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayFirewallRuleSet extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRuleSet.class); + + /* + * The provisioning state of the web application firewall rule set. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The type of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleSetType") + private String ruleSetType; + + /* + * The version of the web application firewall rule set type. + */ + @JsonProperty(value = "properties.ruleSetVersion") + private String ruleSetVersion; + + /* + * The rule groups of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleGroups") + private List ruleGroups; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the provisioningState property: The provisioning state of the web application firewall rule set. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ruleSetType property: The type of the web application firewall rule set. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the ruleSetType property: The type of the web application firewall rule set. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the ruleSetVersion property: The version of the web application firewall rule set type. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the ruleSetVersion property: The version of the web application firewall rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the ruleGroups property: The rule groups of the web application firewall rule set. + * + * @return the ruleGroups value. + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Set the ruleGroups property: The rule groups of the web application firewall rule set. + * + * @param ruleGroups the ruleGroups value to set. + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayFirewallRuleSet withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayFirewallRuleSet withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendIpConfiguration.java new file mode 100644 index 0000000000000..d4d0c472c62a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendIpConfiguration.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Frontend IP configuration of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayFrontendIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFrontendIpConfiguration.class); + + /* + * Name of the frontend IP configuration that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * PrivateIPAddress of the network interface IP Configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Reference to the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /* + * Reference to the PublicIP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIpAddress; + + /* + * Reference to the application gateway private link configuration. + */ + @JsonProperty(value = "properties.privateLinkConfiguration") + private SubResource privateLinkConfiguration; + + /* + * The provisioning state of the frontend IP configuration resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the frontend IP configuration that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the frontend IP configuration that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayFrontendIpConfiguration object itself. + */ + public ApplicationGatewayFrontendIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the privateIpAddress property: PrivateIPAddress of the network interface IP Configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: PrivateIPAddress of the network interface IP Configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the ApplicationGatewayFrontendIpConfiguration object itself. + */ + public ApplicationGatewayFrontendIpConfiguration withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: The private IP address allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the ApplicationGatewayFrontendIpConfiguration object itself. + */ + public ApplicationGatewayFrontendIpConfiguration withPrivateIpAllocationMethod( + IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnet property: Reference to the subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Reference to the subnet resource. + * + * @param subnet the subnet value to set. + * @return the ApplicationGatewayFrontendIpConfiguration object itself. + */ + public ApplicationGatewayFrontendIpConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the publicIpAddress property: Reference to the PublicIP resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: Reference to the PublicIP resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the ApplicationGatewayFrontendIpConfiguration object itself. + */ + public ApplicationGatewayFrontendIpConfiguration withPublicIpAddress(SubResource publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the privateLinkConfiguration property: Reference to the application gateway private link configuration. + * + * @return the privateLinkConfiguration value. + */ + public SubResource privateLinkConfiguration() { + return this.privateLinkConfiguration; + } + + /** + * Set the privateLinkConfiguration property: Reference to the application gateway private link configuration. + * + * @param privateLinkConfiguration the privateLinkConfiguration value to set. + * @return the ApplicationGatewayFrontendIpConfiguration object itself. + */ + public ApplicationGatewayFrontendIpConfiguration withPrivateLinkConfiguration( + SubResource privateLinkConfiguration) { + this.privateLinkConfiguration = privateLinkConfiguration; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the frontend IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayFrontendIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendPort.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendPort.java new file mode 100644 index 0000000000000..fad4f79e1f808 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendPort.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Frontend port of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayFrontendPort extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFrontendPort.class); + + /* + * Name of the frontend port that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Frontend port. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /* + * The provisioning state of the frontend port resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the frontend port that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the frontend port that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the port property: Frontend port. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Frontend port. + * + * @param port the port value to set. + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the frontend port resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayFrontendPort withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHeaderConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHeaderConfiguration.java new file mode 100644 index 0000000000000..f01c85ad92d56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHeaderConfiguration.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.network.generated.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; + +/** Header configuration of the Actions set in Application Gateway. */ +@Fluent +public final class ApplicationGatewayHeaderConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayHeaderConfiguration.class); + + /* + * Header name of the header configuration. + */ + @JsonProperty(value = "headerName") + private String headerName; + + /* + * Header value of the header configuration. + */ + @JsonProperty(value = "headerValue") + private String headerValue; + + /** + * Get the headerName property: Header name of the header configuration. + * + * @return the headerName value. + */ + public String headerName() { + return this.headerName; + } + + /** + * Set the headerName property: Header name of the header configuration. + * + * @param headerName the headerName value to set. + * @return the ApplicationGatewayHeaderConfiguration object itself. + */ + public ApplicationGatewayHeaderConfiguration withHeaderName(String headerName) { + this.headerName = headerName; + return this; + } + + /** + * Get the headerValue property: Header value of the header configuration. + * + * @return the headerValue value. + */ + public String headerValue() { + return this.headerValue; + } + + /** + * Set the headerValue property: Header value of the header configuration. + * + * @param headerValue the headerValue value to set. + * @return the ApplicationGatewayHeaderConfiguration object itself. + */ + public ApplicationGatewayHeaderConfiguration withHeaderValue(String headerValue) { + this.headerValue = headerValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.java new file mode 100644 index 0000000000000..a8599ef7186af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Http listener of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayHttpListener extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayHttpListener.class); + + /* + * Name of the HTTP listener that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Frontend IP configuration resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIpConfiguration; + + /* + * Frontend port resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendPort") + private SubResource frontendPort; + + /* + * Protocol of the HTTP listener. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Host name of HTTP listener. + */ + @JsonProperty(value = "properties.hostName") + private String hostname; + + /* + * SSL certificate resource of an application gateway. + */ + @JsonProperty(value = "properties.sslCertificate") + private SubResource sslCertificate; + + /* + * SSL profile resource of the application gateway. + */ + @JsonProperty(value = "properties.sslProfile") + private SubResource sslProfile; + + /* + * Applicable only if protocol is https. Enables SNI for multi-hosting. + */ + @JsonProperty(value = "properties.requireServerNameIndication") + private Boolean requireServerNameIndication; + + /* + * The provisioning state of the HTTP listener resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Custom error configurations of the HTTP listener. + */ + @JsonProperty(value = "properties.customErrorConfigurations") + private List customErrorConfigurations; + + /* + * Reference to the FirewallPolicy resource. + */ + @JsonProperty(value = "properties.firewallPolicy") + private SubResource firewallPolicy; + + /* + * List of Host names for HTTP Listener that allows special wildcard + * characters as well. + */ + @JsonProperty(value = "properties.hostNames") + private List hostNames; + + /** + * Get the name property: Name of the HTTP listener that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the HTTP listener that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the frontendIpConfiguration property: Frontend IP configuration resource of an application gateway. + * + * @return the frontendIpConfiguration value. + */ + public SubResource frontendIpConfiguration() { + return this.frontendIpConfiguration; + } + + /** + * Set the frontendIpConfiguration property: Frontend IP configuration resource of an application gateway. + * + * @param frontendIpConfiguration the frontendIpConfiguration value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendIpConfiguration(SubResource frontendIpConfiguration) { + this.frontendIpConfiguration = frontendIpConfiguration; + return this; + } + + /** + * Get the frontendPort property: Frontend port resource of an application gateway. + * + * @return the frontendPort value. + */ + public SubResource frontendPort() { + return this.frontendPort; + } + + /** + * Set the frontendPort property: Frontend port resource of an application gateway. + * + * @param frontendPort the frontendPort value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendPort(SubResource frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the protocol property: Protocol of the HTTP listener. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol of the HTTP listener. + * + * @param protocol the protocol value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the hostname property: Host name of HTTP listener. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Host name of HTTP listener. + * + * @param hostname the hostname value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the sslCertificate property: SSL certificate resource of an application gateway. + * + * @return the sslCertificate value. + */ + public SubResource sslCertificate() { + return this.sslCertificate; + } + + /** + * Set the sslCertificate property: SSL certificate resource of an application gateway. + * + * @param sslCertificate the sslCertificate value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withSslCertificate(SubResource sslCertificate) { + this.sslCertificate = sslCertificate; + return this; + } + + /** + * Get the sslProfile property: SSL profile resource of the application gateway. + * + * @return the sslProfile value. + */ + public SubResource sslProfile() { + return this.sslProfile; + } + + /** + * Set the sslProfile property: SSL profile resource of the application gateway. + * + * @param sslProfile the sslProfile value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withSslProfile(SubResource sslProfile) { + this.sslProfile = sslProfile; + return this; + } + + /** + * Get the requireServerNameIndication property: Applicable only if protocol is https. Enables SNI for + * multi-hosting. + * + * @return the requireServerNameIndication value. + */ + public Boolean requireServerNameIndication() { + return this.requireServerNameIndication; + } + + /** + * Set the requireServerNameIndication property: Applicable only if protocol is https. Enables SNI for + * multi-hosting. + * + * @param requireServerNameIndication the requireServerNameIndication value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withRequireServerNameIndication(Boolean requireServerNameIndication) { + this.requireServerNameIndication = requireServerNameIndication; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the HTTP listener resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the customErrorConfigurations property: Custom error configurations of the HTTP listener. + * + * @return the customErrorConfigurations value. + */ + public List customErrorConfigurations() { + return this.customErrorConfigurations; + } + + /** + * Set the customErrorConfigurations property: Custom error configurations of the HTTP listener. + * + * @param customErrorConfigurations the customErrorConfigurations value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withCustomErrorConfigurations( + List customErrorConfigurations) { + this.customErrorConfigurations = customErrorConfigurations; + return this; + } + + /** + * Get the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @return the firewallPolicy value. + */ + public SubResource firewallPolicy() { + return this.firewallPolicy; + } + + /** + * Set the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @param firewallPolicy the firewallPolicy value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFirewallPolicy(SubResource firewallPolicy) { + this.firewallPolicy = firewallPolicy; + return this; + } + + /** + * Get the hostNames property: List of Host names for HTTP Listener that allows special wildcard characters as well. + * + * @return the hostNames value. + */ + public List hostNames() { + return this.hostNames; + } + + /** + * Set the hostNames property: List of Host names for HTTP Listener that allows special wildcard characters as well. + * + * @param hostNames the hostNames value to set. + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withHostNames(List hostNames) { + this.hostNames = hostNames; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayHttpListener withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customErrorConfigurations() != null) { + customErrorConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayIpConfiguration.java new file mode 100644 index 0000000000000..e10118d5f7a90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayIpConfiguration.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration of an application gateway. Currently 1 public and 1 private IP configuration is allowed. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayIpConfiguration.class); + + /* + * Name of the IP configuration that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Reference to the subnet resource. A subnet from where application + * gateway gets its private address. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /* + * The provisioning state of the application gateway IP configuration + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the IP configuration that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the IP configuration that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayIpConfiguration object itself. + */ + public ApplicationGatewayIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the subnet property: Reference to the subnet resource. A subnet from where application gateway gets its + * private address. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Reference to the subnet resource. A subnet from where application gateway gets its + * private address. + * + * @param subnet the subnet value to set. + * @return the ApplicationGatewayIpConfiguration object itself. + */ + public ApplicationGatewayIpConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the application gateway IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListResult.java new file mode 100644 index 0000000000000..3ec8d018bb63f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListApplicationGateways API service call. */ +@Fluent +public final class ApplicationGatewayListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayListResult.class); + + /* + * List of an application gateways in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of an application gateways in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of an application gateways in a resource group. + * + * @param value the value value to set. + * @return the ApplicationGatewayListResult object itself. + */ + public ApplicationGatewayListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationGatewayListResult object itself. + */ + public ApplicationGatewayListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOnDemandProbe.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOnDemandProbe.java new file mode 100644 index 0000000000000..916aeca5c5f6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOnDemandProbe.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of on demand test probe request. */ +@Fluent +public final class ApplicationGatewayOnDemandProbe { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayOnDemandProbe.class); + + /* + * The protocol used for the probe. + */ + @JsonProperty(value = "protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Host name to send the probe to. + */ + @JsonProperty(value = "host") + private String host; + + /* + * Relative path of probe. Valid path starts from '/'. Probe is sent to + * ://:. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The probe timeout in seconds. Probe marked as failed if valid response + * is not received with this timeout period. Acceptable values are from 1 + * second to 86400 seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * Whether the host header should be picked from the backend http settings. + * Default value is false. + */ + @JsonProperty(value = "pickHostNameFromBackendHttpSettings") + private Boolean pickHostnameFromBackendHttpSettings; + + /* + * Criterion for classifying a healthy probe response. + */ + @JsonProperty(value = "match") + private ApplicationGatewayProbeHealthResponseMatch match; + + /* + * Reference to backend pool of application gateway to which probe request + * will be sent. + */ + @JsonProperty(value = "backendAddressPool") + private SubResource backendAddressPool; + + /* + * Reference to backend http setting of application gateway to be used for + * test probe. + */ + @JsonProperty(value = "backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Get the protocol property: The protocol used for the probe. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol used for the probe. + * + * @param protocol the protocol value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the host property: Host name to send the probe to. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: Host name to send the probe to. + * + * @param host the host value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + * + * @param path the path value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the timeout property: The probe timeout in seconds. Probe marked as failed if valid response is not received + * with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The probe timeout in seconds. Probe marked as failed if valid response is not received + * with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @param timeout the timeout value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend + * http settings. Default value is false. + * + * @return the pickHostnameFromBackendHttpSettings value. + */ + public Boolean pickHostnameFromBackendHttpSettings() { + return this.pickHostnameFromBackendHttpSettings; + } + + /** + * Set the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend + * http settings. Default value is false. + * + * @param pickHostnameFromBackendHttpSettings the pickHostnameFromBackendHttpSettings value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withPickHostnameFromBackendHttpSettings( + Boolean pickHostnameFromBackendHttpSettings) { + this.pickHostnameFromBackendHttpSettings = pickHostnameFromBackendHttpSettings; + return this; + } + + /** + * Get the match property: Criterion for classifying a healthy probe response. + * + * @return the match value. + */ + public ApplicationGatewayProbeHealthResponseMatch match() { + return this.match; + } + + /** + * Set the match property: Criterion for classifying a healthy probe response. + * + * @param match the match value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withMatch(ApplicationGatewayProbeHealthResponseMatch match) { + this.match = match; + return this; + } + + /** + * Get the backendAddressPool property: Reference to backend pool of application gateway to which probe request will + * be sent. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: Reference to backend pool of application gateway to which probe request will + * be sent. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendHttpSettings property: Reference to backend http setting of application gateway to be used for + * test probe. + * + * @return the backendHttpSettings value. + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set the backendHttpSettings property: Reference to backend http setting of application gateway to be used for + * test probe. + * + * @param backendHttpSettings the backendHttpSettings value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (match() != null) { + match().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOperationalState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOperationalState.java new file mode 100644 index 0000000000000..dd88f9fceb0e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOperationalState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayOperationalState. */ +public final class ApplicationGatewayOperationalState extends ExpandableStringEnum { + /** Static value Stopped for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPED = fromString("Stopped"); + + /** Static value Starting for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STARTING = fromString("Starting"); + + /** Static value Running for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState RUNNING = fromString("Running"); + + /** Static value Stopping for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPING = fromString("Stopping"); + + /** + * Creates or finds a ApplicationGatewayOperationalState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayOperationalState. + */ + @JsonCreator + public static ApplicationGatewayOperationalState fromString(String name) { + return fromString(name, ApplicationGatewayOperationalState.class); + } + + /** @return known ApplicationGatewayOperationalState values. */ + public static Collection values() { + return values(ApplicationGatewayOperationalState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPathRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPathRule.java new file mode 100644 index 0000000000000..ae4ec6485db19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPathRule.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Path rule of URL path map of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayPathRule extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPathRule.class); + + /* + * Name of the path rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Path rules of URL path map. + */ + @JsonProperty(value = "properties.paths") + private List paths; + + /* + * Backend address pool resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /* + * Backend http settings resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /* + * Redirect configuration resource of URL path map path rule. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /* + * Rewrite rule set resource of URL path map path rule. + */ + @JsonProperty(value = "properties.rewriteRuleSet") + private SubResource rewriteRuleSet; + + /* + * The provisioning state of the path rule resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Reference to the FirewallPolicy resource. + */ + @JsonProperty(value = "properties.firewallPolicy") + private SubResource firewallPolicy; + + /** + * Get the name property: Name of the path rule that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the path rule that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the paths property: Path rules of URL path map. + * + * @return the paths value. + */ + public List paths() { + return this.paths; + } + + /** + * Set the paths property: Path rules of URL path map. + * + * @param paths the paths value to set. + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withPaths(List paths) { + this.paths = paths; + return this; + } + + /** + * Get the backendAddressPool property: Backend address pool resource of URL path map path rule. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: Backend address pool resource of URL path map path rule. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendHttpSettings property: Backend http settings resource of URL path map path rule. + * + * @return the backendHttpSettings value. + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set the backendHttpSettings property: Backend http settings resource of URL path map path rule. + * + * @param backendHttpSettings the backendHttpSettings value to set. + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get the redirectConfiguration property: Redirect configuration resource of URL path map path rule. + * + * @return the redirectConfiguration value. + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set the redirectConfiguration property: Redirect configuration resource of URL path map path rule. + * + * @param redirectConfiguration the redirectConfiguration value to set. + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get the rewriteRuleSet property: Rewrite rule set resource of URL path map path rule. + * + * @return the rewriteRuleSet value. + */ + public SubResource rewriteRuleSet() { + return this.rewriteRuleSet; + } + + /** + * Set the rewriteRuleSet property: Rewrite rule set resource of URL path map path rule. + * + * @param rewriteRuleSet the rewriteRuleSet value to set. + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withRewriteRuleSet(SubResource rewriteRuleSet) { + this.rewriteRuleSet = rewriteRuleSet; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the path rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @return the firewallPolicy value. + */ + public SubResource firewallPolicy() { + return this.firewallPolicy; + } + + /** + * Set the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @param firewallPolicy the firewallPolicy value to set. + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withFirewallPolicy(SubResource firewallPolicy) { + this.firewallPolicy = firewallPolicy; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayPathRule withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnection.java new file mode 100644 index 0000000000000..0127495c5e034 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnection.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; + +/** An immutable client-side representation of ApplicationGatewayPrivateEndpointConnection. */ +public interface ApplicationGatewayPrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the private endpoint connection on an application gateway. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the application gateway private endpoint + * connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the linkIdentifier property: The consumer link id. + * + * @return the linkIdentifier value. + */ + String linkIdentifier(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + ApplicationGatewayPrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..56f67ae15ae64 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private endpoint connections + * for an application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionListResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateEndpointConnectionListResult.class); + + /* + * List of private endpoint connections on an application gateway. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of private endpoint connections on an application gateway. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of private endpoint connections on an application gateway. + * + * @param value the value value to set. + * @return the ApplicationGatewayPrivateEndpointConnectionListResult object itself. + */ + public ApplicationGatewayPrivateEndpointConnectionListResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationGatewayPrivateEndpointConnectionListResult object itself. + */ + public ApplicationGatewayPrivateEndpointConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnections.java new file mode 100644 index 0000000000000..e3a49e6b4a063 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnections.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; + +/** Resource collection API of ApplicationGatewayPrivateEndpointConnections. */ +public interface ApplicationGatewayPrivateEndpointConnections { + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 applicationGatewayName, String connectionName); + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 applicationGatewayName, String connectionName, Context context); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + ApplicationGatewayPrivateEndpointConnection update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + ApplicationGatewayPrivateEndpointConnection update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context); + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + ApplicationGatewayPrivateEndpointConnection get( + String resourceGroupName, String applicationGatewayName, String connectionName); + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + Response getWithResponse( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context); + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + PagedIterable list( + String resourceGroupName, String applicationGatewayName); + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkConfiguration.java new file mode 100644 index 0000000000000..87452cf10dc57 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkConfiguration.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Private Link Configuration on an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayPrivateLinkConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkConfiguration.class); + + /* + * Name of the private link configuration that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * An array of application gateway private link ip configurations. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * The provisioning state of the application gateway private link + * configuration. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the private link configuration that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the private link configuration that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayPrivateLinkConfiguration object itself. + */ + public ApplicationGatewayPrivateLinkConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the ipConfigurations property: An array of application gateway private link ip configurations. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: An array of application gateway private link ip configurations. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the ApplicationGatewayPrivateLinkConfiguration object itself. + */ + public ApplicationGatewayPrivateLinkConfiguration withIpConfigurations( + List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the application gateway private link configuration. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayPrivateLinkConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkIpConfiguration.java new file mode 100644 index 0000000000000..b73ad6ac8e773 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkIpConfiguration.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The application gateway private link ip configuration. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayPrivateLinkIpConfiguration extends SubResource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkIpConfiguration.class); + + /* + * The name of application gateway private link ip configuration. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Reference to the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /* + * Whether the ip configuration is primary or not. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * The provisioning state of the application gateway private link IP + * configuration. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of application gateway private link ip configuration. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of application gateway private link ip configuration. + * + * @param name the name value to set. + * @return the ApplicationGatewayPrivateLinkIpConfiguration object itself. + */ + public ApplicationGatewayPrivateLinkIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the ApplicationGatewayPrivateLinkIpConfiguration object itself. + */ + public ApplicationGatewayPrivateLinkIpConfiguration withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: The private IP address allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the ApplicationGatewayPrivateLinkIpConfiguration object itself. + */ + public ApplicationGatewayPrivateLinkIpConfiguration withPrivateIpAllocationMethod( + IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnet property: Reference to the subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Reference to the subnet resource. + * + * @param subnet the subnet value to set. + * @return the ApplicationGatewayPrivateLinkIpConfiguration object itself. + */ + public ApplicationGatewayPrivateLinkIpConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the primary property: Whether the ip configuration is primary or not. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Whether the ip configuration is primary or not. + * + * @param primary the primary value to set. + * @return the ApplicationGatewayPrivateLinkIpConfiguration object itself. + */ + public ApplicationGatewayPrivateLinkIpConfiguration withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the application gateway private link IP + * configuration. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayPrivateLinkIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResource.java new file mode 100644 index 0000000000000..24fa564ee8997 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResource.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewayPrivateLinkResource. */ +public interface ApplicationGatewayPrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the private link resource that is unique within an Application Gateway. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the groupId property: Group identifier of private link resource. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: Required member names of private link resource. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner object. + * + * @return the inner object. + */ + ApplicationGatewayPrivateLinkResourceInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResourceListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..8f146c098b23a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResourceListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListApplicationGatewayPrivateLinkResources API service call. Gets all private link resources for an + * application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkResourceListResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkResourceListResult.class); + + /* + * List of private link resources of an application gateway. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of private link resources of an application gateway. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of private link resources of an application gateway. + * + * @param value the value value to set. + * @return the ApplicationGatewayPrivateLinkResourceListResult object itself. + */ + public ApplicationGatewayPrivateLinkResourceListResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationGatewayPrivateLinkResourceListResult object itself. + */ + public ApplicationGatewayPrivateLinkResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResources.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResources.java new file mode 100644 index 0000000000000..8970b7468bd5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResources.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ApplicationGatewayPrivateLinkResources. */ +public interface ApplicationGatewayPrivateLinkResources { + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + PagedIterable list(String resourceGroupName, String applicationGatewayName); + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbe.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbe.java new file mode 100644 index 0000000000000..e283e51104b77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbe.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Probe of the application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayProbe extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayProbe.class); + + /* + * Name of the probe that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The protocol used for the probe. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Host name to send the probe to. + */ + @JsonProperty(value = "properties.host") + private String host; + + /* + * Relative path of probe. Valid path starts from '/'. Probe is sent to + * ://:. + */ + @JsonProperty(value = "properties.path") + private String path; + + /* + * The probing interval in seconds. This is the time interval between two + * consecutive probes. Acceptable values are from 1 second to 86400 + * seconds. + */ + @JsonProperty(value = "properties.interval") + private Integer interval; + + /* + * The probe timeout in seconds. Probe marked as failed if valid response + * is not received with this timeout period. Acceptable values are from 1 + * second to 86400 seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /* + * The probe retry count. Backend server is marked down after consecutive + * probe failure count reaches UnhealthyThreshold. Acceptable values are + * from 1 second to 20. + */ + @JsonProperty(value = "properties.unhealthyThreshold") + private Integer unhealthyThreshold; + + /* + * Whether the host header should be picked from the backend http settings. + * Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendHttpSettings") + private Boolean pickHostnameFromBackendHttpSettings; + + /* + * Minimum number of servers that are always marked healthy. Default value + * is 0. + */ + @JsonProperty(value = "properties.minServers") + private Integer minServers; + + /* + * Criterion for classifying a healthy probe response. + */ + @JsonProperty(value = "properties.match") + private ApplicationGatewayProbeHealthResponseMatch match; + + /* + * The provisioning state of the probe resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Custom port which will be used for probing the backend servers. The + * valid value ranges from 1 to 65535. In case not set, port from http + * settings will be used. This property is valid for Standard_v2 and WAF_v2 + * only. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * Get the name property: Name of the probe that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the probe that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the protocol property: The protocol used for the probe. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol used for the probe. + * + * @param protocol the protocol value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the host property: Host name to send the probe to. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: Host name to send the probe to. + * + * @param host the host value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + * + * @param path the path value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the interval property: The probing interval in seconds. This is the time interval between two consecutive + * probes. Acceptable values are from 1 second to 86400 seconds. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the interval property: The probing interval in seconds. This is the time interval between two consecutive + * probes. Acceptable values are from 1 second to 86400 seconds. + * + * @param interval the interval value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the timeout property: The probe timeout in seconds. Probe marked as failed if valid response is not received + * with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The probe timeout in seconds. Probe marked as failed if valid response is not received + * with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @param timeout the timeout value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the unhealthyThreshold property: The probe retry count. Backend server is marked down after consecutive probe + * failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. + * + * @return the unhealthyThreshold value. + */ + public Integer unhealthyThreshold() { + return this.unhealthyThreshold; + } + + /** + * Set the unhealthyThreshold property: The probe retry count. Backend server is marked down after consecutive probe + * failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. + * + * @param unhealthyThreshold the unhealthyThreshold value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + /** + * Get the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend + * http settings. Default value is false. + * + * @return the pickHostnameFromBackendHttpSettings value. + */ + public Boolean pickHostnameFromBackendHttpSettings() { + return this.pickHostnameFromBackendHttpSettings; + } + + /** + * Set the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend + * http settings. Default value is false. + * + * @param pickHostnameFromBackendHttpSettings the pickHostnameFromBackendHttpSettings value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPickHostnameFromBackendHttpSettings( + Boolean pickHostnameFromBackendHttpSettings) { + this.pickHostnameFromBackendHttpSettings = pickHostnameFromBackendHttpSettings; + return this; + } + + /** + * Get the minServers property: Minimum number of servers that are always marked healthy. Default value is 0. + * + * @return the minServers value. + */ + public Integer minServers() { + return this.minServers; + } + + /** + * Set the minServers property: Minimum number of servers that are always marked healthy. Default value is 0. + * + * @param minServers the minServers value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMinServers(Integer minServers) { + this.minServers = minServers; + return this; + } + + /** + * Get the match property: Criterion for classifying a healthy probe response. + * + * @return the match value. + */ + public ApplicationGatewayProbeHealthResponseMatch match() { + return this.match; + } + + /** + * Set the match property: Criterion for classifying a healthy probe response. + * + * @param match the match value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMatch(ApplicationGatewayProbeHealthResponseMatch match) { + this.match = match; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the probe resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the port property: Custom port which will be used for probing the backend servers. The valid value ranges + * from 1 to 65535. In case not set, port from http settings will be used. This property is valid for Standard_v2 + * and WAF_v2 only. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Custom port which will be used for probing the backend servers. The valid value ranges + * from 1 to 65535. In case not set, port from http settings will be used. This property is valid for Standard_v2 + * and WAF_v2 only. + * + * @param port the port value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPort(Integer port) { + this.port = port; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayProbe withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (match() != null) { + match().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbeHealthResponseMatch.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbeHealthResponseMatch.java new file mode 100644 index 0000000000000..8c0334160e188 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbeHealthResponseMatch.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Application gateway probe health response match. */ +@Fluent +public final class ApplicationGatewayProbeHealthResponseMatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayProbeHealthResponseMatch.class); + + /* + * Body that must be contained in the health response. Default value is + * empty. + */ + @JsonProperty(value = "body") + private String body; + + /* + * Allowed ranges of healthy status codes. Default range of healthy status + * codes is 200-399. + */ + @JsonProperty(value = "statusCodes") + private List statusCodes; + + /** + * Get the body property: Body that must be contained in the health response. Default value is empty. + * + * @return the body value. + */ + public String body() { + return this.body; + } + + /** + * Set the body property: Body that must be contained in the health response. Default value is empty. + * + * @param body the body value to set. + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withBody(String body) { + this.body = body; + return this; + } + + /** + * Get the statusCodes property: Allowed ranges of healthy status codes. Default range of healthy status codes is + * 200-399. + * + * @return the statusCodes value. + */ + public List statusCodes() { + return this.statusCodes; + } + + /** + * Set the statusCodes property: Allowed ranges of healthy status codes. Default range of healthy status codes is + * 200-399. + * + * @param statusCodes the statusCodes value to set. + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withStatusCodes(List statusCodes) { + this.statusCodes = statusCodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProtocol.java new file mode 100644 index 0000000000000..60515feeb705c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayProtocol. */ +public final class ApplicationGatewayProtocol extends ExpandableStringEnum { + /** Static value Http for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTP = fromString("Http"); + + /** Static value Https for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ApplicationGatewayProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayProtocol. + */ + @JsonCreator + public static ApplicationGatewayProtocol fromString(String name) { + return fromString(name, ApplicationGatewayProtocol.class); + } + + /** @return known ApplicationGatewayProtocol values. */ + public static Collection values() { + return values(ApplicationGatewayProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectConfiguration.java new file mode 100644 index 0000000000000..3a275f432abe1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectConfiguration.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Redirect configuration of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayRedirectConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRedirectConfiguration.class); + + /* + * Name of the redirect configuration that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * HTTP redirection type. + */ + @JsonProperty(value = "properties.redirectType") + private ApplicationGatewayRedirectType redirectType; + + /* + * Reference to a listener to redirect the request to. + */ + @JsonProperty(value = "properties.targetListener") + private SubResource targetListener; + + /* + * Url to redirect the request to. + */ + @JsonProperty(value = "properties.targetUrl") + private String targetUrl; + + /* + * Include path in the redirected url. + */ + @JsonProperty(value = "properties.includePath") + private Boolean includePath; + + /* + * Include query string in the redirected url. + */ + @JsonProperty(value = "properties.includeQueryString") + private Boolean includeQueryString; + + /* + * Request routing specifying redirect configuration. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /* + * Url path maps specifying default redirect configuration. + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /* + * Path rules specifying redirect configuration. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /** + * Get the name property: Name of the redirect configuration that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the redirect configuration that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the redirectType property: HTTP redirection type. + * + * @return the redirectType value. + */ + public ApplicationGatewayRedirectType redirectType() { + return this.redirectType; + } + + /** + * Set the redirectType property: HTTP redirection type. + * + * @param redirectType the redirectType value to set. + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRedirectType(ApplicationGatewayRedirectType redirectType) { + this.redirectType = redirectType; + return this; + } + + /** + * Get the targetListener property: Reference to a listener to redirect the request to. + * + * @return the targetListener value. + */ + public SubResource targetListener() { + return this.targetListener; + } + + /** + * Set the targetListener property: Reference to a listener to redirect the request to. + * + * @param targetListener the targetListener value to set. + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetListener(SubResource targetListener) { + this.targetListener = targetListener; + return this; + } + + /** + * Get the targetUrl property: Url to redirect the request to. + * + * @return the targetUrl value. + */ + public String targetUrl() { + return this.targetUrl; + } + + /** + * Set the targetUrl property: Url to redirect the request to. + * + * @param targetUrl the targetUrl value to set. + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * Get the includePath property: Include path in the redirected url. + * + * @return the includePath value. + */ + public Boolean includePath() { + return this.includePath; + } + + /** + * Set the includePath property: Include path in the redirected url. + * + * @param includePath the includePath value to set. + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludePath(Boolean includePath) { + this.includePath = includePath; + return this; + } + + /** + * Get the includeQueryString property: Include query string in the redirected url. + * + * @return the includeQueryString value. + */ + public Boolean includeQueryString() { + return this.includeQueryString; + } + + /** + * Set the includeQueryString property: Include query string in the redirected url. + * + * @param includeQueryString the includeQueryString value to set. + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludeQueryString(Boolean includeQueryString) { + this.includeQueryString = includeQueryString; + return this; + } + + /** + * Get the requestRoutingRules property: Request routing specifying redirect configuration. + * + * @return the requestRoutingRules value. + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set the requestRoutingRules property: Request routing specifying redirect configuration. + * + * @param requestRoutingRules the requestRoutingRules value to set. + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get the urlPathMaps property: Url path maps specifying default redirect configuration. + * + * @return the urlPathMaps value. + */ + public List urlPathMaps() { + return this.urlPathMaps; + } + + /** + * Set the urlPathMaps property: Url path maps specifying default redirect configuration. + * + * @param urlPathMaps the urlPathMaps value to set. + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get the pathRules property: Path rules specifying redirect configuration. + * + * @return the pathRules value. + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set the pathRules property: Path rules specifying redirect configuration. + * + * @param pathRules the pathRules value to set. + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayRedirectConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectType.java new file mode 100644 index 0000000000000..e5e4d5c839121 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayRedirectType. */ +public final class ApplicationGatewayRedirectType extends ExpandableStringEnum { + /** Static value Permanent for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType PERMANENT = fromString("Permanent"); + + /** Static value Found for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType FOUND = fromString("Found"); + + /** Static value SeeOther for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType SEE_OTHER = fromString("SeeOther"); + + /** Static value Temporary for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType TEMPORARY = fromString("Temporary"); + + /** + * Creates or finds a ApplicationGatewayRedirectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayRedirectType. + */ + @JsonCreator + public static ApplicationGatewayRedirectType fromString(String name) { + return fromString(name, ApplicationGatewayRedirectType.class); + } + + /** @return known ApplicationGatewayRedirectType values. */ + public static Collection values() { + return values(ApplicationGatewayRedirectType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRule.java new file mode 100644 index 0000000000000..66c42df01cf2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRule.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request routing rule of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayRequestRoutingRule extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRequestRoutingRule.class); + + /* + * Name of the request routing rule that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Rule type. + */ + @JsonProperty(value = "properties.ruleType") + private ApplicationGatewayRequestRoutingRuleType ruleType; + + /* + * Priority of the request routing rule. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /* + * Backend address pool resource of the application gateway. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /* + * Backend http settings resource of the application gateway. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /* + * Http listener resource of the application gateway. + */ + @JsonProperty(value = "properties.httpListener") + private SubResource httpListener; + + /* + * URL path map resource of the application gateway. + */ + @JsonProperty(value = "properties.urlPathMap") + private SubResource urlPathMap; + + /* + * Rewrite Rule Set resource in Basic rule of the application gateway. + */ + @JsonProperty(value = "properties.rewriteRuleSet") + private SubResource rewriteRuleSet; + + /* + * Redirect configuration resource of the application gateway. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /* + * The provisioning state of the request routing rule resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the request routing rule that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the request routing rule that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the ruleType property: Rule type. + * + * @return the ruleType value. + */ + public ApplicationGatewayRequestRoutingRuleType ruleType() { + return this.ruleType; + } + + /** + * Set the ruleType property: Rule type. + * + * @param ruleType the ruleType value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRuleType(ApplicationGatewayRequestRoutingRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get the priority property: Priority of the request routing rule. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the request routing rule. + * + * @param priority the priority value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the backendAddressPool property: Backend address pool resource of the application gateway. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: Backend address pool resource of the application gateway. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendHttpSettings property: Backend http settings resource of the application gateway. + * + * @return the backendHttpSettings value. + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set the backendHttpSettings property: Backend http settings resource of the application gateway. + * + * @param backendHttpSettings the backendHttpSettings value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get the httpListener property: Http listener resource of the application gateway. + * + * @return the httpListener value. + */ + public SubResource httpListener() { + return this.httpListener; + } + + /** + * Set the httpListener property: Http listener resource of the application gateway. + * + * @param httpListener the httpListener value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withHttpListener(SubResource httpListener) { + this.httpListener = httpListener; + return this; + } + + /** + * Get the urlPathMap property: URL path map resource of the application gateway. + * + * @return the urlPathMap value. + */ + public SubResource urlPathMap() { + return this.urlPathMap; + } + + /** + * Set the urlPathMap property: URL path map resource of the application gateway. + * + * @param urlPathMap the urlPathMap value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withUrlPathMap(SubResource urlPathMap) { + this.urlPathMap = urlPathMap; + return this; + } + + /** + * Get the rewriteRuleSet property: Rewrite Rule Set resource in Basic rule of the application gateway. + * + * @return the rewriteRuleSet value. + */ + public SubResource rewriteRuleSet() { + return this.rewriteRuleSet; + } + + /** + * Set the rewriteRuleSet property: Rewrite Rule Set resource in Basic rule of the application gateway. + * + * @param rewriteRuleSet the rewriteRuleSet value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRewriteRuleSet(SubResource rewriteRuleSet) { + this.rewriteRuleSet = rewriteRuleSet; + return this; + } + + /** + * Get the redirectConfiguration property: Redirect configuration resource of the application gateway. + * + * @return the redirectConfiguration value. + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set the redirectConfiguration property: Redirect configuration resource of the application gateway. + * + * @param redirectConfiguration the redirectConfiguration value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the request routing rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayRequestRoutingRule withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRuleType.java new file mode 100644 index 0000000000000..48b3636d28c8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRuleType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayRequestRoutingRuleType. */ +public final class ApplicationGatewayRequestRoutingRuleType + extends ExpandableStringEnum { + /** Static value Basic for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType BASIC = fromString("Basic"); + + /** Static value PathBasedRouting for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType PATH_BASED_ROUTING = fromString("PathBasedRouting"); + + /** + * Creates or finds a ApplicationGatewayRequestRoutingRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayRequestRoutingRuleType. + */ + @JsonCreator + public static ApplicationGatewayRequestRoutingRuleType fromString(String name) { + return fromString(name, ApplicationGatewayRequestRoutingRuleType.class); + } + + /** @return known ApplicationGatewayRequestRoutingRuleType values. */ + public static Collection values() { + return values(ApplicationGatewayRequestRoutingRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRule.java new file mode 100644 index 0000000000000..e727734b2d6e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRule.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.network.generated.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; + +/** Rewrite rule of an application gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRule.class); + + /* + * Name of the rewrite rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Rule Sequence of the rewrite rule that determines the order of execution + * of a particular rule in a RewriteRuleSet. + */ + @JsonProperty(value = "ruleSequence") + private Integer ruleSequence; + + /* + * Conditions based on which the action set execution will be evaluated. + */ + @JsonProperty(value = "conditions") + private List conditions; + + /* + * Set of actions to be done as part of the rewrite Rule. + */ + @JsonProperty(value = "actionSet") + private ApplicationGatewayRewriteRuleActionSet actionSet; + + /** + * Get the name property: Name of the rewrite rule that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the rewrite rule that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayRewriteRule object itself. + */ + public ApplicationGatewayRewriteRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ruleSequence property: Rule Sequence of the rewrite rule that determines the order of execution of a + * particular rule in a RewriteRuleSet. + * + * @return the ruleSequence value. + */ + public Integer ruleSequence() { + return this.ruleSequence; + } + + /** + * Set the ruleSequence property: Rule Sequence of the rewrite rule that determines the order of execution of a + * particular rule in a RewriteRuleSet. + * + * @param ruleSequence the ruleSequence value to set. + * @return the ApplicationGatewayRewriteRule object itself. + */ + public ApplicationGatewayRewriteRule withRuleSequence(Integer ruleSequence) { + this.ruleSequence = ruleSequence; + return this; + } + + /** + * Get the conditions property: Conditions based on which the action set execution will be evaluated. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: Conditions based on which the action set execution will be evaluated. + * + * @param conditions the conditions value to set. + * @return the ApplicationGatewayRewriteRule object itself. + */ + public ApplicationGatewayRewriteRule withConditions(List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Get the actionSet property: Set of actions to be done as part of the rewrite Rule. + * + * @return the actionSet value. + */ + public ApplicationGatewayRewriteRuleActionSet actionSet() { + return this.actionSet; + } + + /** + * Set the actionSet property: Set of actions to be done as part of the rewrite Rule. + * + * @param actionSet the actionSet value to set. + * @return the ApplicationGatewayRewriteRule object itself. + */ + public ApplicationGatewayRewriteRule withActionSet(ApplicationGatewayRewriteRuleActionSet actionSet) { + this.actionSet = actionSet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + if (actionSet() != null) { + actionSet().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleActionSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleActionSet.java new file mode 100644 index 0000000000000..058c9b284780f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleActionSet.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Set of actions in the Rewrite Rule in Application Gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRuleActionSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleActionSet.class); + + /* + * Request Header Actions in the Action Set. + */ + @JsonProperty(value = "requestHeaderConfigurations") + private List requestHeaderConfigurations; + + /* + * Response Header Actions in the Action Set. + */ + @JsonProperty(value = "responseHeaderConfigurations") + private List responseHeaderConfigurations; + + /* + * Url Configuration Action in the Action Set. + */ + @JsonProperty(value = "urlConfiguration") + private ApplicationGatewayUrlConfiguration urlConfiguration; + + /** + * Get the requestHeaderConfigurations property: Request Header Actions in the Action Set. + * + * @return the requestHeaderConfigurations value. + */ + public List requestHeaderConfigurations() { + return this.requestHeaderConfigurations; + } + + /** + * Set the requestHeaderConfigurations property: Request Header Actions in the Action Set. + * + * @param requestHeaderConfigurations the requestHeaderConfigurations value to set. + * @return the ApplicationGatewayRewriteRuleActionSet object itself. + */ + public ApplicationGatewayRewriteRuleActionSet withRequestHeaderConfigurations( + List requestHeaderConfigurations) { + this.requestHeaderConfigurations = requestHeaderConfigurations; + return this; + } + + /** + * Get the responseHeaderConfigurations property: Response Header Actions in the Action Set. + * + * @return the responseHeaderConfigurations value. + */ + public List responseHeaderConfigurations() { + return this.responseHeaderConfigurations; + } + + /** + * Set the responseHeaderConfigurations property: Response Header Actions in the Action Set. + * + * @param responseHeaderConfigurations the responseHeaderConfigurations value to set. + * @return the ApplicationGatewayRewriteRuleActionSet object itself. + */ + public ApplicationGatewayRewriteRuleActionSet withResponseHeaderConfigurations( + List responseHeaderConfigurations) { + this.responseHeaderConfigurations = responseHeaderConfigurations; + return this; + } + + /** + * Get the urlConfiguration property: Url Configuration Action in the Action Set. + * + * @return the urlConfiguration value. + */ + public ApplicationGatewayUrlConfiguration urlConfiguration() { + return this.urlConfiguration; + } + + /** + * Set the urlConfiguration property: Url Configuration Action in the Action Set. + * + * @param urlConfiguration the urlConfiguration value to set. + * @return the ApplicationGatewayRewriteRuleActionSet object itself. + */ + public ApplicationGatewayRewriteRuleActionSet withUrlConfiguration( + ApplicationGatewayUrlConfiguration urlConfiguration) { + this.urlConfiguration = urlConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requestHeaderConfigurations() != null) { + requestHeaderConfigurations().forEach(e -> e.validate()); + } + if (responseHeaderConfigurations() != null) { + responseHeaderConfigurations().forEach(e -> e.validate()); + } + if (urlConfiguration() != null) { + urlConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleCondition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleCondition.java new file mode 100644 index 0000000000000..12031647d6ff7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleCondition.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.network.generated.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; + +/** Set of conditions in the Rewrite Rule in Application Gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRuleCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleCondition.class); + + /* + * The condition parameter of the RewriteRuleCondition. + */ + @JsonProperty(value = "variable") + private String variable; + + /* + * The pattern, either fixed string or regular expression, that evaluates + * the truthfulness of the condition. + */ + @JsonProperty(value = "pattern") + private String pattern; + + /* + * Setting this parameter to truth value with force the pattern to do a + * case in-sensitive comparison. + */ + @JsonProperty(value = "ignoreCase") + private Boolean ignoreCase; + + /* + * Setting this value as truth will force to check the negation of the + * condition given by the user. + */ + @JsonProperty(value = "negate") + private Boolean negate; + + /** + * Get the variable property: The condition parameter of the RewriteRuleCondition. + * + * @return the variable value. + */ + public String variable() { + return this.variable; + } + + /** + * Set the variable property: The condition parameter of the RewriteRuleCondition. + * + * @param variable the variable value to set. + * @return the ApplicationGatewayRewriteRuleCondition object itself. + */ + public ApplicationGatewayRewriteRuleCondition withVariable(String variable) { + this.variable = variable; + return this; + } + + /** + * Get the pattern property: The pattern, either fixed string or regular expression, that evaluates the truthfulness + * of the condition. + * + * @return the pattern value. + */ + public String pattern() { + return this.pattern; + } + + /** + * Set the pattern property: The pattern, either fixed string or regular expression, that evaluates the truthfulness + * of the condition. + * + * @param pattern the pattern value to set. + * @return the ApplicationGatewayRewriteRuleCondition object itself. + */ + public ApplicationGatewayRewriteRuleCondition withPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the ignoreCase property: Setting this parameter to truth value with force the pattern to do a case + * in-sensitive comparison. + * + * @return the ignoreCase value. + */ + public Boolean ignoreCase() { + return this.ignoreCase; + } + + /** + * Set the ignoreCase property: Setting this parameter to truth value with force the pattern to do a case + * in-sensitive comparison. + * + * @param ignoreCase the ignoreCase value to set. + * @return the ApplicationGatewayRewriteRuleCondition object itself. + */ + public ApplicationGatewayRewriteRuleCondition withIgnoreCase(Boolean ignoreCase) { + this.ignoreCase = ignoreCase; + return this; + } + + /** + * Get the negate property: Setting this value as truth will force to check the negation of the condition given by + * the user. + * + * @return the negate value. + */ + public Boolean negate() { + return this.negate; + } + + /** + * Set the negate property: Setting this value as truth will force to check the negation of the condition given by + * the user. + * + * @param negate the negate value to set. + * @return the ApplicationGatewayRewriteRuleCondition object itself. + */ + public ApplicationGatewayRewriteRuleCondition withNegate(Boolean negate) { + this.negate = negate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleSet.java new file mode 100644 index 0000000000000..d604929e702b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleSet.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rewrite rule set of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayRewriteRuleSet extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleSet.class); + + /* + * Name of the rewrite rule set that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Rewrite rules in the rewrite rule set. + */ + @JsonProperty(value = "properties.rewriteRules") + private List rewriteRules; + + /* + * The provisioning state of the rewrite rule set resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the rewrite rule set that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the rewrite rule set that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayRewriteRuleSet object itself. + */ + public ApplicationGatewayRewriteRuleSet withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the rewriteRules property: Rewrite rules in the rewrite rule set. + * + * @return the rewriteRules value. + */ + public List rewriteRules() { + return this.rewriteRules; + } + + /** + * Set the rewriteRules property: Rewrite rules in the rewrite rule set. + * + * @param rewriteRules the rewriteRules value to set. + * @return the ApplicationGatewayRewriteRuleSet object itself. + */ + public ApplicationGatewayRewriteRuleSet withRewriteRules(List rewriteRules) { + this.rewriteRules = rewriteRules; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the rewrite rule set resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayRewriteRuleSet withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rewriteRules() != null) { + rewriteRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySku.java new file mode 100644 index 0000000000000..80592b869a44f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySku.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.network.generated.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; + +/** SKU of an application gateway. */ +@Fluent +public final class ApplicationGatewaySku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySku.class); + + /* + * Name of an application gateway SKU. + */ + @JsonProperty(value = "name") + private ApplicationGatewaySkuName name; + + /* + * Tier of an application gateway. + */ + @JsonProperty(value = "tier") + private ApplicationGatewayTier tier; + + /* + * Capacity (instance count) of an application gateway. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: Name of an application gateway SKU. + * + * @return the name value. + */ + public ApplicationGatewaySkuName name() { + return this.name; + } + + /** + * Set the name property: Name of an application gateway SKU. + * + * @param name the name value to set. + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withName(ApplicationGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of an application gateway. + * + * @return the tier value. + */ + public ApplicationGatewayTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of an application gateway. + * + * @param tier the tier value to set. + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withTier(ApplicationGatewayTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Capacity (instance count) of an application gateway. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Capacity (instance count) of an application gateway. + * + * @param capacity the capacity value to set. + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.java new file mode 100644 index 0000000000000..a3a650cee3afd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySkuName. */ +public final class ApplicationGatewaySkuName extends ExpandableStringEnum { + /** Static value Standard_Small for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_SMALL = fromString("Standard_Small"); + + /** Static value Standard_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_MEDIUM = fromString("Standard_Medium"); + + /** Static value Standard_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_LARGE = fromString("Standard_Large"); + + /** Static value WAF_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_MEDIUM = fromString("WAF_Medium"); + + /** Static value WAF_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_LARGE = fromString("WAF_Large"); + + /** Static value Standard_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewaySkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySkuName. + */ + @JsonCreator + public static ApplicationGatewaySkuName fromString(String name) { + return fromString(name, ApplicationGatewaySkuName.class); + } + + /** @return known ApplicationGatewaySkuName values. */ + public static Collection values() { + return values(ApplicationGatewaySkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCertificate.java new file mode 100644 index 0000000000000..0d50d107d7210 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCertificate.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SSL certificates of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewaySslCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslCertificate.class); + + /* + * Name of the SSL certificate that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Base-64 encoded pfx certificate. Only applicable in PUT Request. + */ + @JsonProperty(value = "properties.data") + private String data; + + /* + * Password for the pfx file specified in data. Only applicable in PUT + * request. + */ + @JsonProperty(value = "properties.password") + private String password; + + /* + * Base-64 encoded Public cert data corresponding to pfx specified in data. + * Only applicable in GET request. + */ + @JsonProperty(value = "properties.publicCertData", access = JsonProperty.Access.WRITE_ONLY) + private String publicCertData; + + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + */ + @JsonProperty(value = "properties.keyVaultSecretId") + private String keyVaultSecretId; + + /* + * The provisioning state of the SSL certificate resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the SSL certificate that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the SSL certificate that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the data property: Base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @return the data value. + */ + public String data() { + return this.data; + } + + /** + * Set the data property: Base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @param data the data value to set. + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get the password property: Password for the pfx file specified in data. Only applicable in PUT request. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password for the pfx file specified in data. Only applicable in PUT request. + * + * @param password the password value to set. + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the publicCertData property: Base-64 encoded Public cert data corresponding to pfx specified in data. Only + * applicable in GET request. + * + * @return the publicCertData value. + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Get the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + * + * @return the keyVaultSecretId value. + */ + public String keyVaultSecretId() { + return this.keyVaultSecretId; + } + + /** + * Set the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + * + * @param keyVaultSecretId the keyVaultSecretId value to set. + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withKeyVaultSecretId(String keyVaultSecretId) { + this.keyVaultSecretId = keyVaultSecretId; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the SSL certificate resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewaySslCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCipherSuite.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCipherSuite.java new file mode 100644 index 0000000000000..9c78775882880 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCipherSuite.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySslCipherSuite. */ +public final class ApplicationGatewaySslCipherSuite extends ExpandableStringEnum { + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = + fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = + fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = + fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = + fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = + fromString("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = + fromString("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = + fromString("TLS_DHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = + fromString("TLS_DHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_GCM_SHA384 = + fromString("TLS_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_GCM_SHA256 = + fromString("TLS_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = + fromString("TLS_RSA_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = + fromString("TLS_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = + fromString("TLS_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = + fromString("TLS_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = + fromString("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = + fromString("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = + fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = + fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = + fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = + fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = + fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = + fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = + fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = + fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_3DES_EDE_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = + fromString("TLS_RSA_WITH_3DES_EDE_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = + fromString("TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = + fromString("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = + fromString("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"); + + /** + * Creates or finds a ApplicationGatewaySslCipherSuite from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslCipherSuite. + */ + @JsonCreator + public static ApplicationGatewaySslCipherSuite fromString(String name) { + return fromString(name, ApplicationGatewaySslCipherSuite.class); + } + + /** @return known ApplicationGatewaySslCipherSuite values. */ + public static Collection values() { + return values(ApplicationGatewaySslCipherSuite.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicy.java new file mode 100644 index 0000000000000..44c1ae1ae969d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicy.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.network.generated.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; + +/** Application Gateway Ssl policy. */ +@Fluent +public final class ApplicationGatewaySslPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslPolicy.class); + + /* + * Ssl protocols to be disabled on application gateway. + */ + @JsonProperty(value = "disabledSslProtocols") + private List disabledSslProtocols; + + /* + * Type of Ssl Policy. + */ + @JsonProperty(value = "policyType") + private ApplicationGatewaySslPolicyType policyType; + + /* + * Name of Ssl predefined policy. + */ + @JsonProperty(value = "policyName") + private ApplicationGatewaySslPolicyName policyName; + + /* + * Ssl cipher suites to be enabled in the specified order to application + * gateway. + */ + @JsonProperty(value = "cipherSuites") + private List cipherSuites; + + /* + * Minimum version of Ssl protocol to be supported on application gateway. + */ + @JsonProperty(value = "minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get the disabledSslProtocols property: Ssl protocols to be disabled on application gateway. + * + * @return the disabledSslProtocols value. + */ + public List disabledSslProtocols() { + return this.disabledSslProtocols; + } + + /** + * Set the disabledSslProtocols property: Ssl protocols to be disabled on application gateway. + * + * @param disabledSslProtocols the disabledSslProtocols value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withDisabledSslProtocols( + List disabledSslProtocols) { + this.disabledSslProtocols = disabledSslProtocols; + return this; + } + + /** + * Get the policyType property: Type of Ssl Policy. + * + * @return the policyType value. + */ + public ApplicationGatewaySslPolicyType policyType() { + return this.policyType; + } + + /** + * Set the policyType property: Type of Ssl Policy. + * + * @param policyType the policyType value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyType(ApplicationGatewaySslPolicyType policyType) { + this.policyType = policyType; + return this; + } + + /** + * Get the policyName property: Name of Ssl predefined policy. + * + * @return the policyName value. + */ + public ApplicationGatewaySslPolicyName policyName() { + return this.policyName; + } + + /** + * Set the policyName property: Name of Ssl predefined policy. + * + * @param policyName the policyName value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyName(ApplicationGatewaySslPolicyName policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the cipherSuites property: Ssl cipher suites to be enabled in the specified order to application gateway. + * + * @return the cipherSuites value. + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set the cipherSuites property: Ssl cipher suites to be enabled in the specified order to application gateway. + * + * @param cipherSuites the cipherSuites value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withCipherSuites(List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. + * + * @return the minProtocolVersion value. + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. + * + * @param minProtocolVersion the minProtocolVersion value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyName.java new file mode 100644 index 0000000000000..97c1e820a943a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyName.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySslPolicyName. */ +public final class ApplicationGatewaySslPolicyName extends ExpandableStringEnum { + /** Static value AppGwSslPolicy20150501 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20150501 = + fromString("AppGwSslPolicy20150501"); + + /** Static value AppGwSslPolicy20170401 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401 = + fromString("AppGwSslPolicy20170401"); + + /** Static value AppGwSslPolicy20170401S for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401S = + fromString("AppGwSslPolicy20170401S"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslPolicyName. + */ + @JsonCreator + public static ApplicationGatewaySslPolicyName fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyName.class); + } + + /** @return known ApplicationGatewaySslPolicyName values. */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyType.java new file mode 100644 index 0000000000000..d09a08e7702ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySslPolicyType. */ +public final class ApplicationGatewaySslPolicyType extends ExpandableStringEnum { + /** Static value Predefined for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType PREDEFINED = fromString("Predefined"); + + /** Static value Custom for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslPolicyType. + */ + @JsonCreator + public static ApplicationGatewaySslPolicyType fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyType.class); + } + + /** @return known ApplicationGatewaySslPolicyType values. */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPredefinedPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPredefinedPolicy.java new file mode 100644 index 0000000000000..f4d30389d497a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPredefinedPolicy.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewaySslPredefinedPolicy. */ +public interface ApplicationGatewaySslPredefinedPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the Ssl predefined policy. + * + * @return the name value. + */ + String name(); + + /** + * Gets the cipherSuites property: Ssl cipher suites to be enabled in the specified order for application gateway. + * + * @return the cipherSuites value. + */ + List cipherSuites(); + + /** + * Gets the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. + * + * @return the minProtocolVersion value. + */ + ApplicationGatewaySslProtocol minProtocolVersion(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner object. + * + * @return the inner object. + */ + ApplicationGatewaySslPredefinedPolicyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.java new file mode 100644 index 0000000000000..f874ed8c67907 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSL profile of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewaySslProfile extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslProfile.class); + + /* + * Name of the SSL profile that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Array of references to application gateway trusted client certificates. + */ + @JsonProperty(value = "properties.trustedClientCertificates") + private List trustedClientCertificates; + + /* + * SSL policy of the application gateway resource. + */ + @JsonProperty(value = "properties.sslPolicy") + private ApplicationGatewaySslPolicy sslPolicy; + + /* + * Client authentication configuration of the application gateway resource. + */ + @JsonProperty(value = "properties.clientAuthConfiguration") + private ApplicationGatewayClientAuthConfiguration clientAuthConfiguration; + + /* + * The provisioning state of the HTTP listener resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the SSL profile that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the SSL profile that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewaySslProfile object itself. + */ + public ApplicationGatewaySslProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the trustedClientCertificates property: Array of references to application gateway trusted client + * certificates. + * + * @return the trustedClientCertificates value. + */ + public List trustedClientCertificates() { + return this.trustedClientCertificates; + } + + /** + * Set the trustedClientCertificates property: Array of references to application gateway trusted client + * certificates. + * + * @param trustedClientCertificates the trustedClientCertificates value to set. + * @return the ApplicationGatewaySslProfile object itself. + */ + public ApplicationGatewaySslProfile withTrustedClientCertificates(List trustedClientCertificates) { + this.trustedClientCertificates = trustedClientCertificates; + return this; + } + + /** + * Get the sslPolicy property: SSL policy of the application gateway resource. + * + * @return the sslPolicy value. + */ + public ApplicationGatewaySslPolicy sslPolicy() { + return this.sslPolicy; + } + + /** + * Set the sslPolicy property: SSL policy of the application gateway resource. + * + * @param sslPolicy the sslPolicy value to set. + * @return the ApplicationGatewaySslProfile object itself. + */ + public ApplicationGatewaySslProfile withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + /** + * Get the clientAuthConfiguration property: Client authentication configuration of the application gateway + * resource. + * + * @return the clientAuthConfiguration value. + */ + public ApplicationGatewayClientAuthConfiguration clientAuthConfiguration() { + return this.clientAuthConfiguration; + } + + /** + * Set the clientAuthConfiguration property: Client authentication configuration of the application gateway + * resource. + * + * @param clientAuthConfiguration the clientAuthConfiguration value to set. + * @return the ApplicationGatewaySslProfile object itself. + */ + public ApplicationGatewaySslProfile withClientAuthConfiguration( + ApplicationGatewayClientAuthConfiguration clientAuthConfiguration) { + this.clientAuthConfiguration = clientAuthConfiguration; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the HTTP listener resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewaySslProfile withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sslPolicy() != null) { + sslPolicy().validate(); + } + if (clientAuthConfiguration() != null) { + clientAuthConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProtocol.java new file mode 100644 index 0000000000000..c6786fc441202 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySslProtocol. */ +public final class ApplicationGatewaySslProtocol extends ExpandableStringEnum { + /** Static value TLSv1_0 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_0 = fromString("TLSv1_0"); + + /** Static value TLSv1_1 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_1 = fromString("TLSv1_1"); + + /** Static value TLSv1_2 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_2 = fromString("TLSv1_2"); + + /** + * Creates or finds a ApplicationGatewaySslProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslProtocol. + */ + @JsonCreator + public static ApplicationGatewaySslProtocol fromString(String name) { + return fromString(name, ApplicationGatewaySslProtocol.class); + } + + /** @return known ApplicationGatewaySslProtocol values. */ + public static Collection values() { + return values(ApplicationGatewaySslProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTier.java new file mode 100644 index 0000000000000..1f49bcaef48e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTier.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayTier. */ +public final class ApplicationGatewayTier extends ExpandableStringEnum { + /** Static value Standard for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD = fromString("Standard"); + + /** Static value WAF for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF = fromString("WAF"); + + /** Static value Standard_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewayTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayTier. + */ + @JsonCreator + public static ApplicationGatewayTier fromString(String name) { + return fromString(name, ApplicationGatewayTier.class); + } + + /** @return known ApplicationGatewayTier values. */ + public static Collection values() { + return values(ApplicationGatewayTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedClientCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedClientCertificate.java new file mode 100644 index 0000000000000..57308690cb0c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedClientCertificate.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted client certificates of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayTrustedClientCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayTrustedClientCertificate.class); + + /* + * Name of the trusted client certificate that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Certificate public data. + */ + @JsonProperty(value = "properties.data") + private String data; + + /* + * Validated certificate data. + */ + @JsonProperty(value = "properties.validatedCertData", access = JsonProperty.Access.WRITE_ONLY) + private String validatedCertData; + + /* + * Distinguished name of client certificate issuer. + */ + @JsonProperty(value = "properties.clientCertIssuerDN", access = JsonProperty.Access.WRITE_ONLY) + private String clientCertIssuerDN; + + /* + * The provisioning state of the trusted client certificate resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the trusted client certificate that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the trusted client certificate that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayTrustedClientCertificate object itself. + */ + public ApplicationGatewayTrustedClientCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the data property: Certificate public data. + * + * @return the data value. + */ + public String data() { + return this.data; + } + + /** + * Set the data property: Certificate public data. + * + * @param data the data value to set. + * @return the ApplicationGatewayTrustedClientCertificate object itself. + */ + public ApplicationGatewayTrustedClientCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get the validatedCertData property: Validated certificate data. + * + * @return the validatedCertData value. + */ + public String validatedCertData() { + return this.validatedCertData; + } + + /** + * Get the clientCertIssuerDN property: Distinguished name of client certificate issuer. + * + * @return the clientCertIssuerDN value. + */ + public String clientCertIssuerDN() { + return this.clientCertIssuerDN; + } + + /** + * Get the provisioningState property: The provisioning state of the trusted client certificate resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayTrustedClientCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedRootCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedRootCertificate.java new file mode 100644 index 0000000000000..e232192b5a13c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedRootCertificate.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted Root certificates of an application gateway. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayTrustedRootCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayTrustedRootCertificate.class); + + /* + * Name of the trusted root certificate that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Certificate public data. + */ + @JsonProperty(value = "properties.data") + private String data; + + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + */ + @JsonProperty(value = "properties.keyVaultSecretId") + private String keyVaultSecretId; + + /* + * The provisioning state of the trusted root certificate resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the trusted root certificate that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the trusted root certificate that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the data property: Certificate public data. + * + * @return the data value. + */ + public String data() { + return this.data; + } + + /** + * Set the data property: Certificate public data. + * + * @param data the data value to set. + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + * + * @return the keyVaultSecretId value. + */ + public String keyVaultSecretId() { + return this.keyVaultSecretId; + } + + /** + * Set the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + * + * @param keyVaultSecretId the keyVaultSecretId value to set. + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withKeyVaultSecretId(String keyVaultSecretId) { + this.keyVaultSecretId = keyVaultSecretId; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the trusted root certificate resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayTrustedRootCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlConfiguration.java new file mode 100644 index 0000000000000..8f233ed7bc070 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlConfiguration.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.network.generated.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; + +/** Url configuration of the Actions set in Application Gateway. */ +@Fluent +public final class ApplicationGatewayUrlConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayUrlConfiguration.class); + + /* + * Url path which user has provided for url rewrite. Null means no path + * will be updated. Default value is null. + */ + @JsonProperty(value = "modifiedPath") + private String modifiedPath; + + /* + * Query string which user has provided for url rewrite. Null means no + * query string will be updated. Default value is null. + */ + @JsonProperty(value = "modifiedQueryString") + private String modifiedQueryString; + + /* + * If set as true, it will re-evaluate the url path map provided in path + * based request routing rules using modified path. Default value is false. + */ + @JsonProperty(value = "reroute") + private Boolean reroute; + + /** + * Get the modifiedPath property: Url path which user has provided for url rewrite. Null means no path will be + * updated. Default value is null. + * + * @return the modifiedPath value. + */ + public String modifiedPath() { + return this.modifiedPath; + } + + /** + * Set the modifiedPath property: Url path which user has provided for url rewrite. Null means no path will be + * updated. Default value is null. + * + * @param modifiedPath the modifiedPath value to set. + * @return the ApplicationGatewayUrlConfiguration object itself. + */ + public ApplicationGatewayUrlConfiguration withModifiedPath(String modifiedPath) { + this.modifiedPath = modifiedPath; + return this; + } + + /** + * Get the modifiedQueryString property: Query string which user has provided for url rewrite. Null means no query + * string will be updated. Default value is null. + * + * @return the modifiedQueryString value. + */ + public String modifiedQueryString() { + return this.modifiedQueryString; + } + + /** + * Set the modifiedQueryString property: Query string which user has provided for url rewrite. Null means no query + * string will be updated. Default value is null. + * + * @param modifiedQueryString the modifiedQueryString value to set. + * @return the ApplicationGatewayUrlConfiguration object itself. + */ + public ApplicationGatewayUrlConfiguration withModifiedQueryString(String modifiedQueryString) { + this.modifiedQueryString = modifiedQueryString; + return this; + } + + /** + * Get the reroute property: If set as true, it will re-evaluate the url path map provided in path based request + * routing rules using modified path. Default value is false. + * + * @return the reroute value. + */ + public Boolean reroute() { + return this.reroute; + } + + /** + * Set the reroute property: If set as true, it will re-evaluate the url path map provided in path based request + * routing rules using modified path. Default value is false. + * + * @param reroute the reroute value to set. + * @return the ApplicationGatewayUrlConfiguration object itself. + */ + public ApplicationGatewayUrlConfiguration withReroute(Boolean reroute) { + this.reroute = reroute; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlPathMap.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlPathMap.java new file mode 100644 index 0000000000000..f561bee0c66ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlPathMap.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. */ +@JsonFlatten +@Fluent +public class ApplicationGatewayUrlPathMap extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayUrlPathMap.class); + + /* + * Name of the URL path map that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Default backend address pool resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendAddressPool") + private SubResource defaultBackendAddressPool; + + /* + * Default backend http settings resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendHttpSettings") + private SubResource defaultBackendHttpSettings; + + /* + * Default Rewrite rule set resource of URL path map. + */ + @JsonProperty(value = "properties.defaultRewriteRuleSet") + private SubResource defaultRewriteRuleSet; + + /* + * Default redirect configuration resource of URL path map. + */ + @JsonProperty(value = "properties.defaultRedirectConfiguration") + private SubResource defaultRedirectConfiguration; + + /* + * Path rule of URL path map resource. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /* + * The provisioning state of the URL path map resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the URL path map that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the URL path map that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the defaultBackendAddressPool property: Default backend address pool resource of URL path map. + * + * @return the defaultBackendAddressPool value. + */ + public SubResource defaultBackendAddressPool() { + return this.defaultBackendAddressPool; + } + + /** + * Set the defaultBackendAddressPool property: Default backend address pool resource of URL path map. + * + * @param defaultBackendAddressPool the defaultBackendAddressPool value to set. + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendAddressPool(SubResource defaultBackendAddressPool) { + this.defaultBackendAddressPool = defaultBackendAddressPool; + return this; + } + + /** + * Get the defaultBackendHttpSettings property: Default backend http settings resource of URL path map. + * + * @return the defaultBackendHttpSettings value. + */ + public SubResource defaultBackendHttpSettings() { + return this.defaultBackendHttpSettings; + } + + /** + * Set the defaultBackendHttpSettings property: Default backend http settings resource of URL path map. + * + * @param defaultBackendHttpSettings the defaultBackendHttpSettings value to set. + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendHttpSettings(SubResource defaultBackendHttpSettings) { + this.defaultBackendHttpSettings = defaultBackendHttpSettings; + return this; + } + + /** + * Get the defaultRewriteRuleSet property: Default Rewrite rule set resource of URL path map. + * + * @return the defaultRewriteRuleSet value. + */ + public SubResource defaultRewriteRuleSet() { + return this.defaultRewriteRuleSet; + } + + /** + * Set the defaultRewriteRuleSet property: Default Rewrite rule set resource of URL path map. + * + * @param defaultRewriteRuleSet the defaultRewriteRuleSet value to set. + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultRewriteRuleSet(SubResource defaultRewriteRuleSet) { + this.defaultRewriteRuleSet = defaultRewriteRuleSet; + return this; + } + + /** + * Get the defaultRedirectConfiguration property: Default redirect configuration resource of URL path map. + * + * @return the defaultRedirectConfiguration value. + */ + public SubResource defaultRedirectConfiguration() { + return this.defaultRedirectConfiguration; + } + + /** + * Set the defaultRedirectConfiguration property: Default redirect configuration resource of URL path map. + * + * @param defaultRedirectConfiguration the defaultRedirectConfiguration value to set. + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultRedirectConfiguration(SubResource defaultRedirectConfiguration) { + this.defaultRedirectConfiguration = defaultRedirectConfiguration; + return this; + } + + /** + * Get the pathRules property: Path rule of URL path map resource. + * + * @return the pathRules value. + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set the pathRules property: Path rule of URL path map resource. + * + * @param pathRules the pathRules value to set. + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the URL path map resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ApplicationGatewayUrlPathMap withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pathRules() != null) { + pathRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWebApplicationFirewallConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWebApplicationFirewallConfiguration.java new file mode 100644 index 0000000000000..ac4aafac33fb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWebApplicationFirewallConfiguration.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Application gateway web application firewall configuration. */ +@Fluent +public final class ApplicationGatewayWebApplicationFirewallConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayWebApplicationFirewallConfiguration.class); + + /* + * Whether the web application firewall is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Web application firewall mode. + */ + @JsonProperty(value = "firewallMode", required = true) + private ApplicationGatewayFirewallMode firewallMode; + + /* + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * The version of the rule set type. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * The disabled rule groups. + */ + @JsonProperty(value = "disabledRuleGroups") + private List disabledRuleGroups; + + /* + * Whether allow WAF to check request Body. + */ + @JsonProperty(value = "requestBodyCheck") + private Boolean requestBodyCheck; + + /* + * Maximum request body size for WAF. + */ + @JsonProperty(value = "maxRequestBodySize") + private Integer maxRequestBodySize; + + /* + * Maximum request body size in Kb for WAF. + */ + @JsonProperty(value = "maxRequestBodySizeInKb") + private Integer maxRequestBodySizeInKb; + + /* + * Maximum file upload size in Mb for WAF. + */ + @JsonProperty(value = "fileUploadLimitInMb") + private Integer fileUploadLimitInMb; + + /* + * The exclusion list. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /** + * Get the enabled property: Whether the web application firewall is enabled or not. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the web application firewall is enabled or not. + * + * @param enabled the enabled value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the firewallMode property: Web application firewall mode. + * + * @return the firewallMode value. + */ + public ApplicationGatewayFirewallMode firewallMode() { + return this.firewallMode; + } + + /** + * Set the firewallMode property: Web application firewall mode. + * + * @param firewallMode the firewallMode value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withFirewallMode( + ApplicationGatewayFirewallMode firewallMode) { + this.firewallMode = firewallMode; + return this; + } + + /** + * Get the ruleSetType property: The type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the ruleSetType property: The type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the ruleSetVersion property: The version of the rule set type. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the ruleSetVersion property: The version of the rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the disabledRuleGroups property: The disabled rule groups. + * + * @return the disabledRuleGroups value. + */ + public List disabledRuleGroups() { + return this.disabledRuleGroups; + } + + /** + * Set the disabledRuleGroups property: The disabled rule groups. + * + * @param disabledRuleGroups the disabledRuleGroups value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withDisabledRuleGroups( + List disabledRuleGroups) { + this.disabledRuleGroups = disabledRuleGroups; + return this; + } + + /** + * Get the requestBodyCheck property: Whether allow WAF to check request Body. + * + * @return the requestBodyCheck value. + */ + public Boolean requestBodyCheck() { + return this.requestBodyCheck; + } + + /** + * Set the requestBodyCheck property: Whether allow WAF to check request Body. + * + * @param requestBodyCheck the requestBodyCheck value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRequestBodyCheck(Boolean requestBodyCheck) { + this.requestBodyCheck = requestBodyCheck; + return this; + } + + /** + * Get the maxRequestBodySize property: Maximum request body size for WAF. + * + * @return the maxRequestBodySize value. + */ + public Integer maxRequestBodySize() { + return this.maxRequestBodySize; + } + + /** + * Set the maxRequestBodySize property: Maximum request body size for WAF. + * + * @param maxRequestBodySize the maxRequestBodySize value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySize(Integer maxRequestBodySize) { + this.maxRequestBodySize = maxRequestBodySize; + return this; + } + + /** + * Get the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @return the maxRequestBodySizeInKb value. + */ + public Integer maxRequestBodySizeInKb() { + return this.maxRequestBodySizeInKb; + } + + /** + * Set the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @param maxRequestBodySizeInKb the maxRequestBodySizeInKb value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySizeInKb( + Integer maxRequestBodySizeInKb) { + this.maxRequestBodySizeInKb = maxRequestBodySizeInKb; + return this; + } + + /** + * Get the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @return the fileUploadLimitInMb value. + */ + public Integer fileUploadLimitInMb() { + return this.fileUploadLimitInMb; + } + + /** + * Set the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @param fileUploadLimitInMb the fileUploadLimitInMb value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withFileUploadLimitInMb(Integer fileUploadLimitInMb) { + this.fileUploadLimitInMb = fileUploadLimitInMb; + return this; + } + + /** + * Get the exclusions property: The exclusion list. + * + * @return the exclusions value. + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set the exclusions property: The exclusion list. + * + * @param exclusions the exclusions value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withExclusions( + List exclusions) { + this.exclusions = exclusions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (firewallMode() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property firewallMode in model" + + " ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (ruleSetType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetType in model" + + " ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (ruleSetVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetVersion in model" + + " ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (disabledRuleGroups() != null) { + disabledRuleGroups().forEach(e -> e.validate()); + } + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateways.java new file mode 100644 index 0000000000000..2f17075d46326 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateways.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of ApplicationGateways. */ +public interface ApplicationGateways { + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 applicationGatewayName); + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 applicationGatewayName, Context context); + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + ApplicationGateway getByResourceGroup(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListApplicationGateways API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the application gateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the application gateways 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 all the application gateways in a subscription. + */ + PagedIterable list(Context context); + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String applicationGatewayName); + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String applicationGatewayName); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth( + String resourceGroupName, String applicationGatewayName, String expand); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth( + String resourceGroupName, String applicationGatewayName, String expand, Context context); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context); + + /** + * Lists all available server variables. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + List listAvailableServerVariables(); + + /** + * Lists all available server variables. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + Response> listAvailableServerVariablesWithResponse(Context context); + + /** + * Lists all available request headers. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + List listAvailableRequestHeaders(); + + /** + * Lists all available request headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + Response> listAvailableRequestHeadersWithResponse(Context context); + + /** + * Lists all available response headers. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + List listAvailableResponseHeaders(); + + /** + * Lists all available response headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + Response> listAvailableResponseHeadersWithResponse(Context context); + + /** + * Lists all available web application firewall rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + ApplicationGatewayAvailableWafRuleSetsResult listAvailableWafRuleSets(); + + /** + * Lists all available web application firewall rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + Response listAvailableWafRuleSetsWithResponse(Context context); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + ApplicationGatewayAvailableSslOptions listAvailableSslOptions(); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + Response listAvailableSslOptionsWithResponse(Context context); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + PagedIterable listAvailableSslPredefinedPolicies(); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + PagedIterable listAvailableSslPredefinedPolicies(Context context); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + ApplicationGatewaySslPredefinedPolicy getSslPredefinedPolicy(String predefinedPolicyName); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + Response getSslPredefinedPolicyWithResponse( + String predefinedPolicyName, Context context); + + /** + * Gets the specified application gateway. + * + * @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 the specified application gateway. + */ + ApplicationGateway getById(String id); + + /** + * Gets the specified application gateway. + * + * @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 specified application gateway. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified application gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified application gateway. + * + * @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 ApplicationGateway resource. + * + * @param name resource name. + * @return the first stage of the new ApplicationGateway definition. + */ + ApplicationGateway.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationRule.java new file mode 100644 index 0000000000000..2c564f2a8659d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationRule.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Rule of type application. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("ApplicationRule") +@Fluent +public final class ApplicationRule extends FirewallPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationRule.class); + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * Array of Application Protocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * List of FQDNs for this rule. + */ + @JsonProperty(value = "targetFqdns") + private List targetFqdns; + + /* + * List of Urls for this rule condition. + */ + @JsonProperty(value = "targetUrls") + private List targetUrls; + + /* + * List of FQDN Tags for this rule. + */ + @JsonProperty(value = "fqdnTags") + private List fqdnTags; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * Terminate TLS connections for this rule. + */ + @JsonProperty(value = "terminateTLS") + private Boolean terminateTls; + + /* + * List of destination azure web categories. + */ + @JsonProperty(value = "webCategories") + private List webCategories; + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the protocols property: Array of Application Protocols. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Array of Application Protocols. + * + * @param protocols the protocols value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the targetFqdns property: List of FQDNs for this rule. + * + * @return the targetFqdns value. + */ + public List targetFqdns() { + return this.targetFqdns; + } + + /** + * Set the targetFqdns property: List of FQDNs for this rule. + * + * @param targetFqdns the targetFqdns value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withTargetFqdns(List targetFqdns) { + this.targetFqdns = targetFqdns; + return this; + } + + /** + * Get the targetUrls property: List of Urls for this rule condition. + * + * @return the targetUrls value. + */ + public List targetUrls() { + return this.targetUrls; + } + + /** + * Set the targetUrls property: List of Urls for this rule condition. + * + * @param targetUrls the targetUrls value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withTargetUrls(List targetUrls) { + this.targetUrls = targetUrls; + return this; + } + + /** + * Get the fqdnTags property: List of FQDN Tags for this rule. + * + * @return the fqdnTags value. + */ + public List fqdnTags() { + return this.fqdnTags; + } + + /** + * Set the fqdnTags property: List of FQDN Tags for this rule. + * + * @param fqdnTags the fqdnTags value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withFqdnTags(List fqdnTags) { + this.fqdnTags = fqdnTags; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the terminateTls property: Terminate TLS connections for this rule. + * + * @return the terminateTls value. + */ + public Boolean terminateTls() { + return this.terminateTls; + } + + /** + * Set the terminateTls property: Terminate TLS connections for this rule. + * + * @param terminateTls the terminateTls value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withTerminateTls(Boolean terminateTls) { + this.terminateTls = terminateTls; + return this; + } + + /** + * Get the webCategories property: List of destination azure web categories. + * + * @return the webCategories value. + */ + public List webCategories() { + return this.webCategories; + } + + /** + * Set the webCategories property: List of destination azure web categories. + * + * @param webCategories the webCategories value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withWebCategories(List webCategories) { + this.webCategories = webCategories; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationRule withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protocols() != null) { + protocols().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java new file mode 100644 index 0000000000000..a743c9de489e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import java.util.Map; + +/** An immutable client-side representation of ApplicationSecurityGroup. */ +public interface ApplicationSecurityGroup { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the resourceGuid property: The resource GUID property of the application security group resource. It + * uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or + * resource groups. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the application security group resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.ApplicationSecurityGroupInner object. + * + * @return the inner object. + */ + ApplicationSecurityGroupInner innerModel(); + + /** The entirety of the ApplicationSecurityGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ApplicationSecurityGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationSecurityGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ApplicationSecurityGroup 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 ApplicationSecurityGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ApplicationSecurityGroup 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationSecurityGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationSecurityGroup create(Context context); + } + /** The stage of the ApplicationSecurityGroup 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); + } + } + /** + * Begins update for the ApplicationSecurityGroup resource. + * + * @return the stage of resource update. + */ + ApplicationSecurityGroup.Update update(); + + /** The template for ApplicationSecurityGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApplicationSecurityGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApplicationSecurityGroup apply(Context context); + } + /** The ApplicationSecurityGroup update stages. */ + interface UpdateStages { + /** The stage of the ApplicationSecurityGroup 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationSecurityGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationSecurityGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroupListResult.java new file mode 100644 index 0000000000000..278e8d2b85606 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroupListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of application security groups. */ +@Fluent +public final class ApplicationSecurityGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupListResult.class); + + /* + * A list of application security groups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of application security groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of application security groups. + * + * @param value the value value to set. + * @return the ApplicationSecurityGroupListResult object itself. + */ + public ApplicationSecurityGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroups.java new file mode 100644 index 0000000000000..8af2d1d417ad1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroups.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 ApplicationSecurityGroups. */ +public interface ApplicationSecurityGroups { + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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. + */ + void deleteByResourceGroup(String resourceGroupName, String applicationSecurityGroupName); + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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. + */ + void delete(String resourceGroupName, String applicationSecurityGroupName, Context context); + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 information about the specified application security group. + */ + ApplicationSecurityGroup getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName); + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security 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 information about the specified application security group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationSecurityGroupName, Context context); + + /** + * Gets all application security groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + PagedIterable list(); + + /** + * Gets all application security groups 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 all application security groups in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the application security groups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified application security group. + * + * @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 information about the specified application security group. + */ + ApplicationSecurityGroup getById(String id); + + /** + * Gets information about the specified application security group. + * + * @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 information about the specified application security group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified application security group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified application security group. + * + * @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 ApplicationSecurityGroup resource. + * + * @param name resource name. + * @return the first stage of the new ApplicationSecurityGroup definition. + */ + ApplicationSecurityGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AssociationType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AssociationType.java new file mode 100644 index 0000000000000..09cdc5dc831df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AssociationType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AssociationType. */ +public final class AssociationType extends ExpandableStringEnum { + /** Static value Associated for AssociationType. */ + public static final AssociationType ASSOCIATED = fromString("Associated"); + + /** Static value Contains for AssociationType. */ + public static final AssociationType CONTAINS = fromString("Contains"); + + /** + * Creates or finds a AssociationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssociationType. + */ + @JsonCreator + public static AssociationType fromString(String name) { + return fromString(name, AssociationType.class); + } + + /** @return known AssociationType values. */ + public static Collection values() { + return values(AssociationType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthenticationMethod.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthenticationMethod.java new file mode 100644 index 0000000000000..f44e4242238d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthenticationMethod.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuthenticationMethod. */ +public final class AuthenticationMethod extends ExpandableStringEnum { + /** Static value EAPTLS for AuthenticationMethod. */ + public static final AuthenticationMethod EAPTLS = fromString("EAPTLS"); + + /** Static value EAPMSCHAPv2 for AuthenticationMethod. */ + public static final AuthenticationMethod EAPMSCHAPV2 = fromString("EAPMSCHAPv2"); + + /** + * Creates or finds a AuthenticationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationMethod. + */ + @JsonCreator + public static AuthenticationMethod fromString(String name) { + return fromString(name, AuthenticationMethod.class); + } + + /** @return known AuthenticationMethod values. */ + public static Collection values() { + return values(AuthenticationMethod.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationListResult.java new file mode 100644 index 0000000000000..dc557a34329cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. + */ +@Fluent +public final class AuthorizationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationListResult.class); + + /* + * The authorizations in an ExpressRoute Circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The authorizations in an ExpressRoute Circuit. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The authorizations in an ExpressRoute Circuit. + * + * @param value the value value to set. + * @return the AuthorizationListResult object itself. + */ + public AuthorizationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AuthorizationListResult object itself. + */ + public AuthorizationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationUseStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationUseStatus.java new file mode 100644 index 0000000000000..af221b520cef1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationUseStatus.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuthorizationUseStatus. */ +public final class AuthorizationUseStatus extends ExpandableStringEnum { + /** Static value Available for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus AVAILABLE = fromString("Available"); + + /** Static value InUse for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus IN_USE = fromString("InUse"); + + /** + * Creates or finds a AuthorizationUseStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthorizationUseStatus. + */ + @JsonCreator + public static AuthorizationUseStatus fromString(String name) { + return fromString(name, AuthorizationUseStatus.class); + } + + /** @return known AuthorizationUseStatus values. */ + public static Collection values() { + return values(AuthorizationUseStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkService.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkService.java new file mode 100644 index 0000000000000..45e1bb84ff428 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkService.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; + +/** An immutable client-side representation of AutoApprovedPrivateLinkService. */ +public interface AutoApprovedPrivateLinkService { + /** + * Gets the privateLinkService property: The id of the private link service resource. + * + * @return the privateLinkService value. + */ + String privateLinkService(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner + * object. + * + * @return the inner object. + */ + AutoApprovedPrivateLinkServiceInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java new file mode 100644 index 0000000000000..2375df0ad726a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of private link service id that can be linked to a private end point with auto approved. */ +@Fluent +public final class AutoApprovedPrivateLinkServicesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoApprovedPrivateLinkServicesResult.class); + + /* + * An array of auto approved private link service. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of auto approved private link service. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of auto approved private link service. + * + * @param value the value value to set. + * @return the AutoApprovedPrivateLinkServicesResult object itself. + */ + public AutoApprovedPrivateLinkServicesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Availability.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Availability.java new file mode 100644 index 0000000000000..25ea0cbd756ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Availability.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.network.generated.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; + +/** Availability of the metric. */ +@Fluent +public final class Availability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Availability.class); + + /* + * The time grain of the availability. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /* + * The retention of the availability. + */ + @JsonProperty(value = "retention") + private String retention; + + /* + * Duration of the availability blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the timeGrain property: The time grain of the availability. + * + * @return the timeGrain value. + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set the timeGrain property: The time grain of the availability. + * + * @param timeGrain the timeGrain value to set. + * @return the Availability object itself. + */ + public Availability withTimeGrain(String timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the retention property: The retention of the availability. + * + * @return the retention value. + */ + public String retention() { + return this.retention; + } + + /** + * Set the retention property: The retention of the availability. + * + * @param retention the retention value to set. + * @return the Availability object itself. + */ + public Availability withRetention(String retention) { + this.retention = retention; + return this; + } + + /** + * Get the blobDuration property: Duration of the availability blob. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Duration of the availability blob. + * + * @param blobDuration the blobDuration value to set. + * @return the Availability object itself. + */ + public Availability 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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.java new file mode 100644 index 0000000000000..5780fce3545dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import java.util.List; + +/** An immutable client-side representation of AvailableDelegation. */ +public interface AvailableDelegation { + /** + * Gets the name property: The name of the AvailableDelegation resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: A unique identifier of the AvailableDelegation resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the serviceName property: The name of the service and resource. + * + * @return the serviceName value. + */ + String serviceName(); + + /** + * Gets the actions property: The actions permitted to the service upon delegation. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner object. + * + * @return the inner object. + */ + AvailableDelegationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.java new file mode 100644 index 0000000000000..0bc993ad41945 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableDelegations. */ +public interface AvailableDelegations { + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + PagedIterable list(String location); + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegationsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegationsResult.java new file mode 100644 index 0000000000000..1a788c4132483 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegationsResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of available delegations. */ +@Fluent +public final class AvailableDelegationsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableDelegationsResult.class); + + /* + * An array of available delegations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of available delegations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of available delegations. + * + * @param value the value value to set. + * @return the AvailableDelegationsResult object itself. + */ + public AvailableDelegationsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableEndpointServices.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableEndpointServices.java new file mode 100644 index 0000000000000..571d10842bfe2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableEndpointServices.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableEndpointServices. */ +public interface AvailableEndpointServices { + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + PagedIterable list(String location); + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointType.java new file mode 100644 index 0000000000000..e3bc1fd8de6e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointType.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; + +/** An immutable client-side representation of AvailablePrivateEndpointType. */ +public interface AvailablePrivateEndpointType { + /** + * Gets the name property: The name of the service and resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: A unique identifier of the AvailablePrivateEndpoint Type resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the resourceName property: The name of the service and resource. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the displayName property: Display name of the resource. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner + * object. + * + * @return the inner object. + */ + AvailablePrivateEndpointTypeInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java new file mode 100644 index 0000000000000..440d4bb6764bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailablePrivateEndpointTypes. */ +public interface AvailablePrivateEndpointTypes { + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain 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 an array of available PrivateEndpoint types. + */ + PagedIterable list(String location); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + PagedIterable list(String location, Context context); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + PagedIterable listByResourceGroup(String location, String resourceGroupName); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of available PrivateEndpoint types. + */ + PagedIterable listByResourceGroup( + String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypesResult.java new file mode 100644 index 0000000000000..a318749031ea3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypesResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of available PrivateEndpoint types. */ +@Fluent +public final class AvailablePrivateEndpointTypesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailablePrivateEndpointTypesResult.class); + + /* + * An array of available privateEndpoint type. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of available privateEndpoint type. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of available privateEndpoint type. + * + * @param value the value value to set. + * @return the AvailablePrivateEndpointTypesResult object itself. + */ + public AvailablePrivateEndpointTypesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java new file mode 100644 index 0000000000000..1ec2bd562383b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import java.util.List; + +/** An immutable client-side representation of AvailableProvidersList. */ +public interface AvailableProvidersList { + /** + * Gets the countries property: List of available countries. + * + * @return the countries value. + */ + List countries(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner object. + * + * @return the inner object. + */ + AvailableProvidersListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java new file mode 100644 index 0000000000000..92de636aa6a00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.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.network.generated.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; + +/** City or town details. */ +@Fluent +public final class AvailableProvidersListCity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListCity.class); + + /* + * The city or town name. + */ + @JsonProperty(value = "cityName") + private String cityName; + + /* + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Get the cityName property: The city or town name. + * + * @return the cityName value. + */ + public String cityName() { + return this.cityName; + } + + /** + * Set the cityName property: The city or town name. + * + * @param cityName the cityName value to set. + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withCityName(String cityName) { + this.cityName = cityName; + return this; + } + + /** + * Get the providers property: A list of Internet service providers. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: A list of Internet service providers. + * + * @param providers the providers value to set. + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCountry.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCountry.java new file mode 100644 index 0000000000000..05e1ce6b585ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCountry.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Country details. */ +@Fluent +public final class AvailableProvidersListCountry { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListCountry.class); + + /* + * The country name. + */ + @JsonProperty(value = "countryName") + private String countryName; + + /* + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * List of available states in the country. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get the countryName property: The country name. + * + * @return the countryName value. + */ + public String countryName() { + return this.countryName; + } + + /** + * Set the countryName property: The country name. + * + * @param countryName the countryName value to set. + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withCountryName(String countryName) { + this.countryName = countryName; + return this; + } + + /** + * Get the providers property: A list of Internet service providers. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: A list of Internet service providers. + * + * @param providers the providers value to set. + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the states property: List of available states in the country. + * + * @return the states value. + */ + public List states() { + return this.states; + } + + /** + * Set the states property: List of available states in the country. + * + * @param states the states value to set. + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withStates(List states) { + this.states = states; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (states() != null) { + states().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListParameters.java new file mode 100644 index 0000000000000..1bc5f023ad3e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListParameters.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Constraints that determine the list of available Internet service providers. */ +@Fluent +public final class AvailableProvidersListParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListParameters.class); + + /* + * A list of Azure regions. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /* + * The country for available providers list. + */ + @JsonProperty(value = "country") + private String country; + + /* + * The state for available providers list. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The city or town for available providers list. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get the azureLocations property: A list of Azure regions. + * + * @return the azureLocations value. + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set the azureLocations property: A list of Azure regions. + * + * @param azureLocations the azureLocations value to set. + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the country property: The country for available providers list. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: The country for available providers list. + * + * @param country the country value to set. + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the state property: The state for available providers list. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The state for available providers list. + * + * @param state the state value to set. + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withState(String state) { + this.state = state; + return this; + } + + /** + * Get the city property: The city or town for available providers list. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: The city or town for available providers list. + * + * @param city the city value to set. + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCity(String city) { + this.city = city; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListState.java new file mode 100644 index 0000000000000..21ba30a471275 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListState.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** State details. */ +@Fluent +public final class AvailableProvidersListState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListState.class); + + /* + * The state name. + */ + @JsonProperty(value = "stateName") + private String stateName; + + /* + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * List of available cities or towns in the state. + */ + @JsonProperty(value = "cities") + private List cities; + + /** + * Get the stateName property: The state name. + * + * @return the stateName value. + */ + public String stateName() { + return this.stateName; + } + + /** + * Set the stateName property: The state name. + * + * @param stateName the stateName value to set. + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withStateName(String stateName) { + this.stateName = stateName; + return this; + } + + /** + * Get the providers property: A list of Internet service providers. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: A list of Internet service providers. + * + * @param providers the providers value to set. + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the cities property: List of available cities or towns in the state. + * + * @return the cities value. + */ + public List cities() { + return this.cities; + } + + /** + * Set the cities property: List of available cities or towns in the state. + * + * @param cities the cities value to set. + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withCities(List cities) { + this.cities = cities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cities() != null) { + cities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableResourceGroupDelegations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableResourceGroupDelegations.java new file mode 100644 index 0000000000000..4e998726a5210 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableResourceGroupDelegations.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableResourceGroupDelegations. */ +public interface AvailableResourceGroupDelegations { + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + PagedIterable list(String location, String resourceGroupName); + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 all of the available subnet delegations for this resource group in this region. + */ + PagedIterable list(String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAlias.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAlias.java new file mode 100644 index 0000000000000..53f0e41492495 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAlias.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; + +/** An immutable client-side representation of AvailableServiceAlias. */ +public interface AvailableServiceAlias { + /** + * Gets the name property: The name of the service alias. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ID of the service alias. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the resourceName property: The resource name of the service alias. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner object. + * + * @return the inner object. + */ + AvailableServiceAliasInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.java new file mode 100644 index 0000000000000..4436e6e35cc54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableServiceAliases. */ +public interface AvailableServiceAliases { + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + PagedIterable list(String location); + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + PagedIterable list(String location, Context context); + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String location); + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliasesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliasesResult.java new file mode 100644 index 0000000000000..39b9025ff6c03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliasesResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of available service aliases. */ +@Fluent +public final class AvailableServiceAliasesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceAliasesResult.class); + + /* + * An array of available service aliases. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of available service aliases. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of available service aliases. + * + * @param value the value value to set. + * @return the AvailableServiceAliasesResult object itself. + */ + public AvailableServiceAliasesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewall.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewall.java new file mode 100644 index 0000000000000..1ca8927214d7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewall.java @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of AzureFirewall. */ +public interface AzureFirewall { + /** + * 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 zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the applicationRuleCollections property: Collection of application rule collections used by Azure Firewall. + * + * @return the applicationRuleCollections value. + */ + List applicationRuleCollections(); + + /** + * Gets the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall. + * + * @return the natRuleCollections value. + */ + List natRuleCollections(); + + /** + * Gets the networkRuleCollections property: Collection of network rule collections used by Azure Firewall. + * + * @return the networkRuleCollections value. + */ + List networkRuleCollections(); + + /** + * Gets the ipConfigurations property: IP configuration of the Azure Firewall resource. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the managementIpConfiguration property: IP configuration of the Azure Firewall used for management traffic. + * + * @return the managementIpConfiguration value. + */ + AzureFirewallIpConfiguration managementIpConfiguration(); + + /** + * Gets the provisioningState property: The provisioning state of the Azure firewall resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @return the threatIntelMode value. + */ + AzureFirewallThreatIntelMode threatIntelMode(); + + /** + * Gets the virtualHub property: The virtualHub to which the firewall belongs. + * + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * Gets the firewallPolicy property: The firewallPolicy associated with this azure firewall. + * + * @return the firewallPolicy value. + */ + SubResource firewallPolicy(); + + /** + * Gets the hubIpAddresses property: IP addresses associated with AzureFirewall. + * + * @return the hubIpAddresses value. + */ + HubIpAddresses hubIpAddresses(); + + /** + * Gets the ipGroups property: IpGroups associated with AzureFirewall. + * + * @return the ipGroups value. + */ + List ipGroups(); + + /** + * Gets the sku property: The Azure Firewall Resource SKU. + * + * @return the sku value. + */ + AzureFirewallSku sku(); + + /** + * Gets the additionalProperties property: The additional properties used to further config this azure firewall. + * + * @return the additionalProperties value. + */ + Map additionalProperties(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.AzureFirewallInner object. + * + * @return the inner object. + */ + AzureFirewallInner innerModel(); + + /** The entirety of the AzureFirewall definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The AzureFirewall definition stages. */ + interface DefinitionStages { + /** The first stage of the AzureFirewall definition. */ + interface Blank extends WithLocation { + } + /** The stage of the AzureFirewall 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 AzureFirewall definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the AzureFirewall 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.WithZones, + DefinitionStages.WithApplicationRuleCollections, + DefinitionStages.WithNatRuleCollections, + DefinitionStages.WithNetworkRuleCollections, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithManagementIpConfiguration, + DefinitionStages.WithThreatIntelMode, + DefinitionStages.WithVirtualHub, + DefinitionStages.WithFirewallPolicy, + DefinitionStages.WithHubIpAddresses, + DefinitionStages.WithSku, + DefinitionStages.WithAdditionalProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + AzureFirewall create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AzureFirewall create(Context context); + } + /** The stage of the AzureFirewall 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 AzureFirewall definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting where the resource needs to come + * from.. + * + * @param zones A list of availability zones denoting where the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the AzureFirewall definition allowing to specify applicationRuleCollections. */ + interface WithApplicationRuleCollections { + /** + * Specifies the applicationRuleCollections property: Collection of application rule collections used by + * Azure Firewall.. + * + * @param applicationRuleCollections Collection of application rule collections used by Azure Firewall. + * @return the next definition stage. + */ + WithCreate withApplicationRuleCollections( + List applicationRuleCollections); + } + /** The stage of the AzureFirewall definition allowing to specify natRuleCollections. */ + interface WithNatRuleCollections { + /** + * Specifies the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall.. + * + * @param natRuleCollections Collection of NAT rule collections used by Azure Firewall. + * @return the next definition stage. + */ + WithCreate withNatRuleCollections(List natRuleCollections); + } + /** The stage of the AzureFirewall definition allowing to specify networkRuleCollections. */ + interface WithNetworkRuleCollections { + /** + * Specifies the networkRuleCollections property: Collection of network rule collections used by Azure + * Firewall.. + * + * @param networkRuleCollections Collection of network rule collections used by Azure Firewall. + * @return the next definition stage. + */ + WithCreate withNetworkRuleCollections(List networkRuleCollections); + } + /** The stage of the AzureFirewall definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IP configuration of the Azure Firewall resource.. + * + * @param ipConfigurations IP configuration of the Azure Firewall resource. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the AzureFirewall definition allowing to specify managementIpConfiguration. */ + interface WithManagementIpConfiguration { + /** + * Specifies the managementIpConfiguration property: IP configuration of the Azure Firewall used for + * management traffic.. + * + * @param managementIpConfiguration IP configuration of the Azure Firewall used for management traffic. + * @return the next definition stage. + */ + WithCreate withManagementIpConfiguration(AzureFirewallIpConfiguration managementIpConfiguration); + } + /** The stage of the AzureFirewall definition allowing to specify threatIntelMode. */ + interface WithThreatIntelMode { + /** + * Specifies the threatIntelMode property: The operation mode for Threat Intelligence.. + * + * @param threatIntelMode The operation mode for Threat Intelligence. + * @return the next definition stage. + */ + WithCreate withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode); + } + /** The stage of the AzureFirewall definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The virtualHub to which the firewall belongs.. + * + * @param virtualHub The virtualHub to which the firewall belongs. + * @return the next definition stage. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + /** The stage of the AzureFirewall definition allowing to specify firewallPolicy. */ + interface WithFirewallPolicy { + /** + * Specifies the firewallPolicy property: The firewallPolicy associated with this azure firewall.. + * + * @param firewallPolicy The firewallPolicy associated with this azure firewall. + * @return the next definition stage. + */ + WithCreate withFirewallPolicy(SubResource firewallPolicy); + } + /** The stage of the AzureFirewall definition allowing to specify hubIpAddresses. */ + interface WithHubIpAddresses { + /** + * Specifies the hubIpAddresses property: IP addresses associated with AzureFirewall.. + * + * @param hubIpAddresses IP addresses associated with AzureFirewall. + * @return the next definition stage. + */ + WithCreate withHubIpAddresses(HubIpAddresses hubIpAddresses); + } + /** The stage of the AzureFirewall definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Azure Firewall Resource SKU.. + * + * @param sku The Azure Firewall Resource SKU. + * @return the next definition stage. + */ + WithCreate withSku(AzureFirewallSku sku); + } + /** The stage of the AzureFirewall definition allowing to specify additionalProperties. */ + interface WithAdditionalProperties { + /** + * Specifies the additionalProperties property: The additional properties used to further config this azure + * firewall.. + * + * @param additionalProperties The additional properties used to further config this azure firewall. + * @return the next definition stage. + */ + WithCreate withAdditionalProperties(Map additionalProperties); + } + } + /** + * Begins update for the AzureFirewall resource. + * + * @return the stage of resource update. + */ + AzureFirewall.Update update(); + + /** The template for AzureFirewall update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AzureFirewall apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AzureFirewall apply(Context context); + } + /** The AzureFirewall update stages. */ + interface UpdateStages { + /** The stage of the AzureFirewall 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AzureFirewall refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AzureFirewall refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRule.java new file mode 100644 index 0000000000000..b32f9af96b9f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRule.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.network.generated.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; + +/** Properties of an application rule. */ +@Fluent +public final class AzureFirewallApplicationRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRule.class); + + /* + * Name of the application rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * Array of ApplicationRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * List of FQDNs for this rule. + */ + @JsonProperty(value = "targetFqdns") + private List targetFqdns; + + /* + * List of FQDN Tags for this rule. + */ + @JsonProperty(value = "fqdnTags") + private List fqdnTags; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /** + * Get the name property: Name of the application rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the application rule. + * + * @param name the name value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the rule. + * + * @param description the description value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the protocols property: Array of ApplicationRuleProtocols. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Array of ApplicationRuleProtocols. + * + * @param protocols the protocols value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the targetFqdns property: List of FQDNs for this rule. + * + * @return the targetFqdns value. + */ + public List targetFqdns() { + return this.targetFqdns; + } + + /** + * Set the targetFqdns property: List of FQDNs for this rule. + * + * @param targetFqdns the targetFqdns value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withTargetFqdns(List targetFqdns) { + this.targetFqdns = targetFqdns; + return this; + } + + /** + * Get the fqdnTags property: List of FQDN Tags for this rule. + * + * @return the fqdnTags value. + */ + public List fqdnTags() { + return this.fqdnTags; + } + + /** + * Set the fqdnTags property: List of FQDN Tags for this rule. + * + * @param fqdnTags the fqdnTags value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withFqdnTags(List fqdnTags) { + this.fqdnTags = fqdnTags; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocols() != null) { + protocols().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleCollection.java new file mode 100644 index 0000000000000..33f8b3663b29a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleCollection.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application rule collection resource. */ +@JsonFlatten +@Fluent +public class AzureFirewallApplicationRuleCollection extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRuleCollection.class); + + /* + * The name of the resource that is unique within the Azure firewall. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Priority of the application rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /* + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /* + * Collection of rules used by a application rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /* + * The provisioning state of the application rule collection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within the Azure firewall. This name can be used + * to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the Azure firewall. This name can be used + * to access the resource. + * + * @param name the name value to set. + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the priority property: Priority of the application rule collection resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the application rule collection resource. + * + * @param priority the priority value to set. + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action property: The action type of a rule collection. + * + * @return the action value. + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action property: The action type of a rule collection. + * + * @param action the action value to set. + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get the rules property: Collection of rules used by a application rule collection. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Collection of rules used by a application rule collection. + * + * @param rules the rules value to set. + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the application rule collection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public AzureFirewallApplicationRuleCollection withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocol.java new file mode 100644 index 0000000000000..3cb45f5df11db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocol.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Properties of the application rule protocol. */ +@Fluent +public final class AzureFirewallApplicationRuleProtocol { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRuleProtocol.class); + + /* + * Protocol type. + */ + @JsonProperty(value = "protocolType") + private AzureFirewallApplicationRuleProtocolType protocolType; + + /* + * Port number for the protocol, cannot be greater than 64000. This field + * is optional. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the protocolType property: Protocol type. + * + * @return the protocolType value. + */ + public AzureFirewallApplicationRuleProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set the protocolType property: Protocol type. + * + * @param protocolType the protocolType value to set. + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withProtocolType( + AzureFirewallApplicationRuleProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get the port property: Port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @param port the port value to set. + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocolType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocolType.java new file mode 100644 index 0000000000000..250a81db1fc50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocolType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallApplicationRuleProtocolType. */ +public final class AzureFirewallApplicationRuleProtocolType + extends ExpandableStringEnum { + /** Static value Http for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTP = fromString("Http"); + + /** Static value Https for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTPS = fromString("Https"); + + /** Static value Mssql for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType MSSQL = fromString("Mssql"); + + /** + * Creates or finds a AzureFirewallApplicationRuleProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallApplicationRuleProtocolType. + */ + @JsonCreator + public static AzureFirewallApplicationRuleProtocolType fromString(String name) { + return fromString(name, AzureFirewallApplicationRuleProtocolType.class); + } + + /** @return known AzureFirewallApplicationRuleProtocolType values. */ + public static Collection values() { + return values(AzureFirewallApplicationRuleProtocolType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTag.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTag.java new file mode 100644 index 0000000000000..bc7a862139f90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTag.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import java.util.Map; + +/** An immutable client-side representation of AzureFirewallFqdnTag. */ +public interface AzureFirewallFqdnTag { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the provisioningState property: The provisioning state of the Azure firewall FQDN tag resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the fqdnTagName property: The name of this FQDN Tag. + * + * @return the fqdnTagName value. + */ + String fqdnTagName(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner object. + * + * @return the inner object. + */ + AzureFirewallFqdnTagInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTagListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTagListResult.java new file mode 100644 index 0000000000000..b076ebf923e03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTagListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListAzureFirewallFqdnTags API service call. */ +@Fluent +public final class AzureFirewallFqdnTagListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagListResult.class); + + /* + * List of Azure Firewall FQDN Tags in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Azure Firewall FQDN Tags in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Azure Firewall FQDN Tags in a resource group. + * + * @param value the value value to set. + * @return the AzureFirewallFqdnTagListResult object itself. + */ + public AzureFirewallFqdnTagListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AzureFirewallFqdnTagListResult object itself. + */ + public AzureFirewallFqdnTagListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.java new file mode 100644 index 0000000000000..14a238fae3474 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AzureFirewallFqdnTags. */ +public interface AzureFirewallFqdnTags { + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Azure Firewall FQDN Tags 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 all the Azure Firewall FQDN Tags in a subscription. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.java new file mode 100644 index 0000000000000..6016870316067 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration of an Azure Firewall. */ +@JsonFlatten +@Fluent +public class AzureFirewallIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallIpConfiguration.class); + + /* + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The Firewall Internal Load Balancer IP to be used as the next hop in + * User Defined Routes. + */ + @JsonProperty(value = "properties.privateIPAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /* + * Reference to the subnet resource. This resource must be named + * 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /* + * Reference to the PublicIP resource. This field is a mandatory input if + * subnet is not null. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIpAddress; + + /* + * The provisioning state of the Azure firewall IP configuration resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the AzureFirewallIpConfiguration object itself. + */ + public AzureFirewallIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the privateIpAddress property: The Firewall Internal Load Balancer IP to be used as the next hop in User + * Defined Routes. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Get the subnet property: Reference to the subnet resource. This resource must be named 'AzureFirewallSubnet' or + * 'AzureFirewallManagementSubnet'. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Reference to the subnet resource. This resource must be named 'AzureFirewallSubnet' or + * 'AzureFirewallManagementSubnet'. + * + * @param subnet the subnet value to set. + * @return the AzureFirewallIpConfiguration object itself. + */ + public AzureFirewallIpConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the publicIpAddress property: Reference to the PublicIP resource. This field is a mandatory input if subnet + * is not null. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: Reference to the PublicIP resource. This field is a mandatory input if subnet + * is not null. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the AzureFirewallIpConfiguration object itself. + */ + public AzureFirewallIpConfiguration withPublicIpAddress(SubResource publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Azure firewall IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public AzureFirewallIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpGroups.java new file mode 100644 index 0000000000000..d43c17b2f5e40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpGroups.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.network.generated.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; + +/** IpGroups associated with azure firewall. */ +@Immutable +public final class AzureFirewallIpGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallIpGroups.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The iteration number. + */ + @JsonProperty(value = "changeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String changeNumber; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the changeNumber property: The iteration number. + * + * @return the changeNumber value. + */ + public String changeNumber() { + return this.changeNumber; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.java new file mode 100644 index 0000000000000..0eee2cb4e838a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListAzureFirewalls API service call. */ +@Fluent +public final class AzureFirewallListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallListResult.class); + + /* + * List of Azure Firewalls in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Azure Firewalls in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Azure Firewalls in a resource group. + * + * @param value the value value to set. + * @return the AzureFirewallListResult object itself. + */ + public AzureFirewallListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AzureFirewallListResult object itself. + */ + public AzureFirewallListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.java new file mode 100644 index 0000000000000..44fd34839e3e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.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.network.generated.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; + +/** AzureFirewall NAT Rule Collection Action. */ +@Fluent +public final class AzureFirewallNatRCAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRCAction.class); + + /* + * The type of action. + */ + @JsonProperty(value = "type") + private AzureFirewallNatRCActionType type; + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public AzureFirewallNatRCActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the AzureFirewallNatRCAction object itself. + */ + public AzureFirewallNatRCAction withType(AzureFirewallNatRCActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.java new file mode 100644 index 0000000000000..4fae3708f2966 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallNatRCActionType. */ +public final class AzureFirewallNatRCActionType extends ExpandableStringEnum { + /** Static value Snat for AzureFirewallNatRCActionType. */ + public static final AzureFirewallNatRCActionType SNAT = fromString("Snat"); + + /** Static value Dnat for AzureFirewallNatRCActionType. */ + public static final AzureFirewallNatRCActionType DNAT = fromString("Dnat"); + + /** + * Creates or finds a AzureFirewallNatRCActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallNatRCActionType. + */ + @JsonCreator + public static AzureFirewallNatRCActionType fromString(String name) { + return fromString(name, AzureFirewallNatRCActionType.class); + } + + /** @return known AzureFirewallNatRCActionType values. */ + public static Collection values() { + return values(AzureFirewallNatRCActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.java new file mode 100644 index 0000000000000..a0ca47650d327 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Properties of a NAT rule. */ +@Fluent +public final class AzureFirewallNatRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRule.class); + + /* + * Name of the NAT rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses for this rule. Supports IP ranges, + * prefixes, and service tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * The translated address for this NAT rule. + */ + @JsonProperty(value = "translatedAddress") + private String translatedAddress; + + /* + * The translated port for this NAT rule. + */ + @JsonProperty(value = "translatedPort") + private String translatedPort; + + /* + * The translated FQDN for this NAT rule. + */ + @JsonProperty(value = "translatedFqdn") + private String translatedFqdn; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /** + * Get the name property: Name of the NAT rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the NAT rule. + * + * @param name the name value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the rule. + * + * @param description the description value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses for this rule. Supports IP ranges, + * prefixes, and service tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses for this rule. Supports IP ranges, + * prefixes, and service tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the protocols property: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + * + * @param protocols the protocols value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the translatedAddress property: The translated address for this NAT rule. + * + * @return the translatedAddress value. + */ + public String translatedAddress() { + return this.translatedAddress; + } + + /** + * Set the translatedAddress property: The translated address for this NAT rule. + * + * @param translatedAddress the translatedAddress value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withTranslatedAddress(String translatedAddress) { + this.translatedAddress = translatedAddress; + return this; + } + + /** + * Get the translatedPort property: The translated port for this NAT rule. + * + * @return the translatedPort value. + */ + public String translatedPort() { + return this.translatedPort; + } + + /** + * Set the translatedPort property: The translated port for this NAT rule. + * + * @param translatedPort the translatedPort value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withTranslatedPort(String translatedPort) { + this.translatedPort = translatedPort; + return this; + } + + /** + * Get the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @return the translatedFqdn value. + */ + public String translatedFqdn() { + return this.translatedFqdn; + } + + /** + * Set the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @param translatedFqdn the translatedFqdn value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withTranslatedFqdn(String translatedFqdn) { + this.translatedFqdn = translatedFqdn; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.java new file mode 100644 index 0000000000000..46ca7bf1d4ef1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NAT rule collection resource. */ +@JsonFlatten +@Fluent +public class AzureFirewallNatRuleCollection extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRuleCollection.class); + + /* + * The name of the resource that is unique within the Azure firewall. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Priority of the NAT rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /* + * The action type of a NAT rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallNatRCAction action; + + /* + * Collection of rules used by a NAT rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /* + * The provisioning state of the NAT rule collection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within the Azure firewall. This name can be used + * to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the Azure firewall. This name can be used + * to access the resource. + * + * @param name the name value to set. + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the priority property: Priority of the NAT rule collection resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the NAT rule collection resource. + * + * @param priority the priority value to set. + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action property: The action type of a NAT rule collection. + * + * @return the action value. + */ + public AzureFirewallNatRCAction action() { + return this.action; + } + + /** + * Set the action property: The action type of a NAT rule collection. + * + * @param action the action value to set. + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withAction(AzureFirewallNatRCAction action) { + this.action = action; + return this; + } + + /** + * Get the rules property: Collection of rules used by a NAT rule collection. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Collection of rules used by a NAT rule collection. + * + * @param rules the rules value to set. + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the NAT rule collection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public AzureFirewallNatRuleCollection withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRule.java new file mode 100644 index 0000000000000..934145b7a433f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRule.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Properties of the network rule. */ +@Fluent +public final class AzureFirewallNetworkRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNetworkRule.class); + + /* + * Name of the network rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Array of AzureFirewallNetworkRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * List of destination FQDNs. + */ + @JsonProperty(value = "destinationFqdns") + private List destinationFqdns; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + @JsonProperty(value = "destinationIpGroups") + private List destinationIpGroups; + + /** + * Get the name property: Name of the network rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the network rule. + * + * @param name the name value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the rule. + * + * @param description the description value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the protocols property: Array of AzureFirewallNetworkRuleProtocols. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Array of AzureFirewallNetworkRuleProtocols. + * + * @param protocols the protocols value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the destinationFqdns property: List of destination FQDNs. + * + * @return the destinationFqdns value. + */ + public List destinationFqdns() { + return this.destinationFqdns; + } + + /** + * Set the destinationFqdns property: List of destination FQDNs. + * + * @param destinationFqdns the destinationFqdns value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationFqdns(List destinationFqdns) { + this.destinationFqdns = destinationFqdns; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @return the destinationIpGroups value. + */ + public List destinationIpGroups() { + return this.destinationIpGroups; + } + + /** + * Set the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @param destinationIpGroups the destinationIpGroups value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationIpGroups(List destinationIpGroups) { + this.destinationIpGroups = destinationIpGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.java new file mode 100644 index 0000000000000..575e4180c254e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network rule collection resource. */ +@JsonFlatten +@Fluent +public class AzureFirewallNetworkRuleCollection extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNetworkRuleCollection.class); + + /* + * The name of the resource that is unique within the Azure firewall. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Priority of the network rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /* + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /* + * Collection of rules used by a network rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /* + * The provisioning state of the network rule collection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within the Azure firewall. This name can be used + * to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the Azure firewall. This name can be used + * to access the resource. + * + * @param name the name value to set. + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the priority property: Priority of the network rule collection resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the network rule collection resource. + * + * @param priority the priority value to set. + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action property: The action type of a rule collection. + * + * @return the action value. + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action property: The action type of a rule collection. + * + * @param action the action value to set. + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get the rules property: Collection of rules used by a network rule collection. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Collection of rules used by a network rule collection. + * + * @param rules the rules value to set. + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the network rule collection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public AzureFirewallNetworkRuleCollection withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleProtocol.java new file mode 100644 index 0000000000000..85872f256576e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallNetworkRuleProtocol. */ +public final class AzureFirewallNetworkRuleProtocol extends ExpandableStringEnum { + /** Static value TCP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol TCP = fromString("TCP"); + + /** Static value UDP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol UDP = fromString("UDP"); + + /** Static value Any for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ANY = fromString("Any"); + + /** Static value ICMP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ICMP = fromString("ICMP"); + + /** + * Creates or finds a AzureFirewallNetworkRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallNetworkRuleProtocol. + */ + @JsonCreator + public static AzureFirewallNetworkRuleProtocol fromString(String name) { + return fromString(name, AzureFirewallNetworkRuleProtocol.class); + } + + /** @return known AzureFirewallNetworkRuleProtocol values. */ + public static Collection values() { + return values(AzureFirewallNetworkRuleProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.java new file mode 100644 index 0000000000000..74b1d65318b01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.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.network.generated.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; + +/** Public IP Address associated with azure firewall. */ +@Fluent +public final class AzureFirewallPublicIpAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallPublicIpAddress.class); + + /* + * Public IP Address value. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Get the address property: Public IP Address value. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Public IP Address value. + * + * @param address the address value to set. + * @return the AzureFirewallPublicIpAddress object itself. + */ + public AzureFirewallPublicIpAddress withAddress(String address) { + this.address = address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.java new file mode 100644 index 0000000000000..f15a2247a4b22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.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.network.generated.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; + +/** Properties of the AzureFirewallRCAction. */ +@Fluent +public final class AzureFirewallRCAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallRCAction.class); + + /* + * The type of action. + */ + @JsonProperty(value = "type") + private AzureFirewallRCActionType type; + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public AzureFirewallRCActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the AzureFirewallRCAction object itself. + */ + public AzureFirewallRCAction withType(AzureFirewallRCActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.java new file mode 100644 index 0000000000000..61fcedb3a8093 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallRCActionType. */ +public final class AzureFirewallRCActionType extends ExpandableStringEnum { + /** Static value Allow for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType ALLOW = fromString("Allow"); + + /** Static value Deny for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType DENY = fromString("Deny"); + + /** + * Creates or finds a AzureFirewallRCActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallRCActionType. + */ + @JsonCreator + public static AzureFirewallRCActionType fromString(String name) { + return fromString(name, AzureFirewallRCActionType.class); + } + + /** @return known AzureFirewallRCActionType values. */ + public static Collection values() { + return values(AzureFirewallRCActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.java new file mode 100644 index 0000000000000..a0a702a2d52b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.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.network.generated.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; + +/** SKU of an Azure Firewall. */ +@Fluent +public final class AzureFirewallSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallSku.class); + + /* + * Name of an Azure Firewall SKU. + */ + @JsonProperty(value = "name") + private AzureFirewallSkuName name; + + /* + * Tier of an Azure Firewall. + */ + @JsonProperty(value = "tier") + private AzureFirewallSkuTier tier; + + /** + * Get the name property: Name of an Azure Firewall SKU. + * + * @return the name value. + */ + public AzureFirewallSkuName name() { + return this.name; + } + + /** + * Set the name property: Name of an Azure Firewall SKU. + * + * @param name the name value to set. + * @return the AzureFirewallSku object itself. + */ + public AzureFirewallSku withName(AzureFirewallSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of an Azure Firewall. + * + * @return the tier value. + */ + public AzureFirewallSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of an Azure Firewall. + * + * @param tier the tier value to set. + * @return the AzureFirewallSku object itself. + */ + public AzureFirewallSku withTier(AzureFirewallSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.java new file mode 100644 index 0000000000000..91e86e8afc4c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallSkuName. */ +public final class AzureFirewallSkuName extends ExpandableStringEnum { + /** Static value AZFW_VNet for AzureFirewallSkuName. */ + public static final AzureFirewallSkuName AZFW_VNET = fromString("AZFW_VNet"); + + /** Static value AZFW_Hub for AzureFirewallSkuName. */ + public static final AzureFirewallSkuName AZFW_HUB = fromString("AZFW_Hub"); + + /** + * Creates or finds a AzureFirewallSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallSkuName. + */ + @JsonCreator + public static AzureFirewallSkuName fromString(String name) { + return fromString(name, AzureFirewallSkuName.class); + } + + /** @return known AzureFirewallSkuName values. */ + public static Collection values() { + return values(AzureFirewallSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.java new file mode 100644 index 0000000000000..c3f287a4f4ea1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallSkuTier. */ +public final class AzureFirewallSkuTier extends ExpandableStringEnum { + /** Static value Standard for AzureFirewallSkuTier. */ + public static final AzureFirewallSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for AzureFirewallSkuTier. */ + public static final AzureFirewallSkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a AzureFirewallSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallSkuTier. + */ + @JsonCreator + public static AzureFirewallSkuTier fromString(String name) { + return fromString(name, AzureFirewallSkuTier.class); + } + + /** @return known AzureFirewallSkuTier values. */ + public static Collection values() { + return values(AzureFirewallSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.java new file mode 100644 index 0000000000000..45b9b813379b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallThreatIntelMode. */ +public final class AzureFirewallThreatIntelMode extends ExpandableStringEnum { + /** Static value Alert for AzureFirewallThreatIntelMode. */ + public static final AzureFirewallThreatIntelMode ALERT = fromString("Alert"); + + /** Static value Deny for AzureFirewallThreatIntelMode. */ + public static final AzureFirewallThreatIntelMode DENY = fromString("Deny"); + + /** Static value Off for AzureFirewallThreatIntelMode. */ + public static final AzureFirewallThreatIntelMode OFF = fromString("Off"); + + /** + * Creates or finds a AzureFirewallThreatIntelMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallThreatIntelMode. + */ + @JsonCreator + public static AzureFirewallThreatIntelMode fromString(String name) { + return fromString(name, AzureFirewallThreatIntelMode.class); + } + + /** @return known AzureFirewallThreatIntelMode values. */ + public static Collection values() { + return values(AzureFirewallThreatIntelMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.java new file mode 100644 index 0000000000000..5fdc917fb458b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 AzureFirewalls. */ +public interface AzureFirewalls { + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 azureFirewallName); + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 azureFirewallName, Context context); + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + AzureFirewall getByResourceGroup(String resourceGroupName, String azureFirewallName); + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String azureFirewallName, Context context); + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListAzureFirewalls API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Azure Firewalls 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 all the Azure Firewalls in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Azure Firewall. + * + * @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 the specified Azure Firewall. + */ + AzureFirewall getById(String id); + + /** + * Gets the specified Azure Firewall. + * + * @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 specified Azure Firewall. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified Azure Firewall. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Azure Firewall. + * + * @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 AzureFirewall resource. + * + * @param name resource name. + * @return the first stage of the new AzureFirewall definition. + */ + AzureFirewall.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReport.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReport.java new file mode 100644 index 0000000000000..ff1f4194f903b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReport.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import java.util.List; + +/** An immutable client-side representation of AzureReachabilityReport. */ +public interface AzureReachabilityReport { + /** + * Gets the aggregationLevel property: The aggregation level of Azure reachability report. Can be Country, State or + * City. + * + * @return the aggregationLevel value. + */ + String aggregationLevel(); + + /** + * Gets the providerLocation property: Parameters that define a geographic location. + * + * @return the providerLocation value. + */ + AzureReachabilityReportLocation providerLocation(); + + /** + * Gets the reachabilityReport property: List of Azure reachability report items. + * + * @return the reachabilityReport value. + */ + List reachabilityReport(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner object. + * + * @return the inner object. + */ + AzureReachabilityReportInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.java new file mode 100644 index 0000000000000..2632ca3afd383 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Azure reachability report details for a given provider location. */ +@Fluent +public final class AzureReachabilityReportItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportItem.class); + + /* + * The Internet service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The Azure region. + */ + @JsonProperty(value = "azureLocation") + private String azureLocation; + + /* + * List of latency details for each of the time series. + */ + @JsonProperty(value = "latencies") + private List latencies; + + /** + * Get the provider property: The Internet service provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The Internet service provider. + * + * @param provider the provider value to set. + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the azureLocation property: The Azure region. + * + * @return the azureLocation value. + */ + public String azureLocation() { + return this.azureLocation; + } + + /** + * Set the azureLocation property: The Azure region. + * + * @param azureLocation the azureLocation value to set. + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withAzureLocation(String azureLocation) { + this.azureLocation = azureLocation; + return this; + } + + /** + * Get the latencies property: List of latency details for each of the time series. + * + * @return the latencies value. + */ + public List latencies() { + return this.latencies; + } + + /** + * Set the latencies property: List of latency details for each of the time series. + * + * @param latencies the latencies value to set. + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withLatencies(List latencies) { + this.latencies = latencies; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (latencies() != null) { + latencies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.java new file mode 100644 index 0000000000000..9a2632fe56147 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.time.OffsetDateTime; + +/** Details on latency for a time series. */ +@Fluent +public final class AzureReachabilityReportLatencyInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportLatencyInfo.class); + + /* + * The time stamp. + */ + @JsonProperty(value = "timeStamp") + private OffsetDateTime timestamp; + + /* + * The relative latency score between 1 and 100, higher values indicating a + * faster connection. + */ + @JsonProperty(value = "score") + private Integer score; + + /** + * Get the timestamp property: The time stamp. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The time stamp. + * + * @param timestamp the timestamp value to set. + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the score property: The relative latency score between 1 and 100, higher values indicating a faster + * connection. + * + * @return the score value. + */ + public Integer score() { + return this.score; + } + + /** + * Set the score property: The relative latency score between 1 and 100, higher values indicating a faster + * connection. + * + * @param score the score value to set. + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withScore(Integer score) { + this.score = score; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.java new file mode 100644 index 0000000000000..a5b556950a1dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters that define a geographic location. */ +@Fluent +public final class AzureReachabilityReportLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportLocation.class); + + /* + * The name of the country. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /* + * The name of the state. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The name of the city or town. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get the country property: The name of the country. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: The name of the country. + * + * @param country the country value to set. + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the state property: The name of the state. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The name of the state. + * + * @param state the state value to set. + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withState(String state) { + this.state = state; + return this; + } + + /** + * Get the city property: The name of the city or town. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: The name of the city or town. + * + * @param city the city value to set. + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCity(String city) { + this.city = city; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (country() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property country in model AzureReachabilityReportLocation")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.java new file mode 100644 index 0000000000000..8768a964bc70d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.time.OffsetDateTime; +import java.util.List; + +/** Geographic and time constraints for Azure reachability report. */ +@Fluent +public final class AzureReachabilityReportParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportParameters.class); + + /* + * Parameters that define a geographic location. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /* + * List of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * Optional Azure regions to scope the query to. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /* + * The start time for the Azure reachability report. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * The end time for the Azure reachability report. + */ + @JsonProperty(value = "endTime", required = true) + private OffsetDateTime endTime; + + /** + * Get the providerLocation property: Parameters that define a geographic location. + * + * @return the providerLocation value. + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation property: Parameters that define a geographic location. + * + * @param providerLocation the providerLocation value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get the providers property: List of Internet service providers. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: List of Internet service providers. + * + * @param providers the providers value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the azureLocations property: Optional Azure regions to scope the query to. + * + * @return the azureLocations value. + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set the azureLocations property: Optional Azure regions to scope the query to. + * + * @param azureLocations the azureLocations value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the startTime property: The start time for the Azure reachability report. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time for the Azure reachability report. + * + * @param startTime the startTime value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time for the Azure reachability report. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time for the Azure reachability report. + * + * @param endTime the endTime value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerLocation in model AzureReachabilityReportParameters")); + } else { + providerLocation().validate(); + } + if (startTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startTime in model AzureReachabilityReportParameters")); + } + if (endTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endTime in model AzureReachabilityReportParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java new file mode 100644 index 0000000000000..bb997605d6f3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; + +/** An immutable client-side representation of AzureWebCategory. */ +public interface AzureWebCategory { + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the group property: The name of the group that the category belongs to. + * + * @return the group value. + */ + String group(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner object. + * + * @return the inner object. + */ + AzureWebCategoryInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java new file mode 100644 index 0000000000000..9f1381eb28411 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListAzureWebCategories API service call. */ +@Fluent +public final class AzureWebCategoryListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWebCategoryListResult.class); + + /* + * List of Azure Web Categories for a given Subscription. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Azure Web Categories for a given Subscription. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Azure Web Categories for a given Subscription. + * + * @param value the value value to set. + * @return the AzureWebCategoryListResult object itself. + */ + public AzureWebCategoryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AzureWebCategoryListResult object itself. + */ + public AzureWebCategoryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressPool.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressPool.java new file mode 100644 index 0000000000000..53db844868223 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressPool.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import java.util.List; + +/** An immutable client-side representation of BackendAddressPool. */ +public interface BackendAddressPool { + /** + * 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 that is unique within the set of backend address pools used by + * the load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the backend address pool. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tunnelInterfaces property: An array of gateway load balancer tunnel interfaces. + * + * @return the tunnelInterfaces value. + */ + List tunnelInterfaces(); + + /** + * Gets the loadBalancerBackendAddresses property: An array of backend addresses. + * + * @return the loadBalancerBackendAddresses value. + */ + List loadBalancerBackendAddresses(); + + /** + * Gets the backendIpConfigurations property: An array of references to IP addresses defined in network interfaces. + * + * @return the backendIpConfigurations value. + */ + List backendIpConfigurations(); + + /** + * Gets the loadBalancingRules property: An array of references to load balancing rules that use this backend + * address pool. + * + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * Gets the outboundRule property: A reference to an outbound rule that uses this backend address pool. + * + * @return the outboundRule value. + */ + SubResource outboundRule(); + + /** + * Gets the outboundRules property: An array of references to outbound rules that use this backend address pool. + * + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * Gets the provisioningState property: The provisioning state of the backend address pool resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * 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.network.generated.fluent.models.BackendAddressPoolInner object. + * + * @return the inner object. + */ + BackendAddressPoolInner innerModel(); + + /** The entirety of the BackendAddressPool definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The BackendAddressPool definition stages. */ + interface DefinitionStages { + /** The first stage of the BackendAddressPool definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the BackendAddressPool definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, loadBalancerName. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @return the next definition stage. + */ + WithCreate withExistingLoadBalancer(String resourceGroupName, String loadBalancerName); + } + /** + * The stage of the BackendAddressPool definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithName, + DefinitionStages.WithTunnelInterfaces, + DefinitionStages.WithLoadBalancerBackendAddresses { + /** + * Executes the create request. + * + * @return the created resource. + */ + BackendAddressPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BackendAddressPool create(Context context); + } + /** The stage of the BackendAddressPool definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the backend address pool. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the backend address pool. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the BackendAddressPool definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within the set of backend address + * pools used by the load balancer. This name can be used to access the resource.. + * + * @param name The name of the resource that is unique within the set of backend address pools used by the + * load balancer. This name can be used to access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the BackendAddressPool definition allowing to specify tunnelInterfaces. */ + interface WithTunnelInterfaces { + /** + * Specifies the tunnelInterfaces property: An array of gateway load balancer tunnel interfaces.. + * + * @param tunnelInterfaces An array of gateway load balancer tunnel interfaces. + * @return the next definition stage. + */ + WithCreate withTunnelInterfaces(List tunnelInterfaces); + } + /** The stage of the BackendAddressPool definition allowing to specify loadBalancerBackendAddresses. */ + interface WithLoadBalancerBackendAddresses { + /** + * Specifies the loadBalancerBackendAddresses property: An array of backend addresses.. + * + * @param loadBalancerBackendAddresses An array of backend addresses. + * @return the next definition stage. + */ + WithCreate withLoadBalancerBackendAddresses(List loadBalancerBackendAddresses); + } + } + /** + * Begins update for the BackendAddressPool resource. + * + * @return the stage of resource update. + */ + BackendAddressPool.Update update(); + + /** The template for BackendAddressPool update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithTunnelInterfaces, + UpdateStages.WithLoadBalancerBackendAddresses { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BackendAddressPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BackendAddressPool apply(Context context); + } + /** The BackendAddressPool update stages. */ + interface UpdateStages { + /** The stage of the BackendAddressPool update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within the set of backend address + * pools used by the load balancer. This name can be used to access the resource.. + * + * @param name The name of the resource that is unique within the set of backend address pools used by the + * load balancer. This name can be used to access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the BackendAddressPool update allowing to specify tunnelInterfaces. */ + interface WithTunnelInterfaces { + /** + * Specifies the tunnelInterfaces property: An array of gateway load balancer tunnel interfaces.. + * + * @param tunnelInterfaces An array of gateway load balancer tunnel interfaces. + * @return the next definition stage. + */ + Update withTunnelInterfaces(List tunnelInterfaces); + } + /** The stage of the BackendAddressPool update allowing to specify loadBalancerBackendAddresses. */ + interface WithLoadBalancerBackendAddresses { + /** + * Specifies the loadBalancerBackendAddresses property: An array of backend addresses.. + * + * @param loadBalancerBackendAddresses An array of backend addresses. + * @return the next definition stage. + */ + Update withLoadBalancerBackendAddresses(List loadBalancerBackendAddresses); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BackendAddressPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BackendAddressPool refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSession.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSession.java new file mode 100644 index 0000000000000..9de110aad1318 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSession.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; + +/** An immutable client-side representation of BastionActiveSession. */ +public interface BastionActiveSession { + /** + * Gets the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + String sessionId(); + + /** + * Gets the startTime property: The time when the session started. + * + * @return the startTime value. + */ + Object startTime(); + + /** + * Gets the targetSubscriptionId property: The subscription id for the target virtual machine. + * + * @return the targetSubscriptionId value. + */ + String targetSubscriptionId(); + + /** + * Gets the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the targetHostname property: The host name of the target. + * + * @return the targetHostname value. + */ + String targetHostname(); + + /** + * Gets the targetResourceGroup property: The resource group of the target. + * + * @return the targetResourceGroup value. + */ + String targetResourceGroup(); + + /** + * Gets the username property: The user name who is active on this session. + * + * @return the username value. + */ + String username(); + + /** + * Gets the targetIpAddress property: The IP Address of the target. + * + * @return the targetIpAddress value. + */ + String targetIpAddress(); + + /** + * Gets the protocol property: The protocol used to connect to the target. + * + * @return the protocol value. + */ + BastionConnectProtocol protocol(); + + /** + * Gets the targetResourceId property: The resource id of the target. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the sessionDurationInMins property: Duration in mins the session has been active. + * + * @return the sessionDurationInMins value. + */ + Float sessionDurationInMins(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner object. + * + * @return the inner object. + */ + BastionActiveSessionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java new file mode 100644 index 0000000000000..28385eaf414bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for GetActiveSessions. */ +@Fluent +public final class BastionActiveSessionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionActiveSessionListResult.class); + + /* + * List of active sessions on the bastion. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of active sessions on the bastion. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of active sessions on the bastion. + * + * @param value the value value to set. + * @return the BastionActiveSessionListResult object itself. + */ + public BastionActiveSessionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BastionActiveSessionListResult object itself. + */ + public BastionActiveSessionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionConnectProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionConnectProtocol.java new file mode 100644 index 0000000000000..0ccab2a4a70e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionConnectProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BastionConnectProtocol. */ +public final class BastionConnectProtocol extends ExpandableStringEnum { + /** Static value SSH for BastionConnectProtocol. */ + public static final BastionConnectProtocol SSH = fromString("SSH"); + + /** Static value RDP for BastionConnectProtocol. */ + public static final BastionConnectProtocol RDP = fromString("RDP"); + + /** + * Creates or finds a BastionConnectProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding BastionConnectProtocol. + */ + @JsonCreator + public static BastionConnectProtocol fromString(String name) { + return fromString(name, BastionConnectProtocol.class); + } + + /** @return known BastionConnectProtocol values. */ + public static Collection values() { + return values(BastionConnectProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHost.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHost.java new file mode 100644 index 0000000000000..1cb3659f315c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHost.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BastionHost. */ +public interface BastionHost { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the sku property: The sku of this Bastion Host. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the ipConfigurations property: IP configuration of the Bastion Host resource. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the dnsName property: FQDN for the endpoint on which bastion host is accessible. + * + * @return the dnsName value. + */ + String dnsName(); + + /** + * Gets the provisioningState property: The provisioning state of the bastion host resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.BastionHostInner object. + * + * @return the inner object. + */ + BastionHostInner innerModel(); + + /** The entirety of the BastionHost definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The BastionHost definition stages. */ + interface DefinitionStages { + /** The first stage of the BastionHost definition. */ + interface Blank extends WithLocation { + } + /** The stage of the BastionHost 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 BastionHost definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the BastionHost 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.WithSku, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithDnsName { + /** + * Executes the create request. + * + * @return the created resource. + */ + BastionHost create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BastionHost create(Context context); + } + /** The stage of the BastionHost 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 BastionHost definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku of this Bastion Host.. + * + * @param sku The sku of this Bastion Host. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the BastionHost definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IP configuration of the Bastion Host resource.. + * + * @param ipConfigurations IP configuration of the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the BastionHost definition allowing to specify dnsName. */ + interface WithDnsName { + /** + * Specifies the dnsName property: FQDN for the endpoint on which bastion host is accessible.. + * + * @param dnsName FQDN for the endpoint on which bastion host is accessible. + * @return the next definition stage. + */ + WithCreate withDnsName(String dnsName); + } + } + /** + * Begins update for the BastionHost resource. + * + * @return the stage of resource update. + */ + BastionHost.Update update(); + + /** The template for BastionHost update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithIpConfigurations, + UpdateStages.WithDnsName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BastionHost apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BastionHost apply(Context context); + } + /** The BastionHost update stages. */ + interface UpdateStages { + /** The stage of the BastionHost 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 BastionHost update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku of this Bastion Host.. + * + * @param sku The sku of this Bastion Host. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the BastionHost update allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IP configuration of the Bastion Host resource.. + * + * @param ipConfigurations IP configuration of the Bastion Host resource. + * @return the next definition stage. + */ + Update withIpConfigurations(List ipConfigurations); + } + /** The stage of the BastionHost update allowing to specify dnsName. */ + interface WithDnsName { + /** + * Specifies the dnsName property: FQDN for the endpoint on which bastion host is accessible.. + * + * @param dnsName FQDN for the endpoint on which bastion host is accessible. + * @return the next definition stage. + */ + Update withDnsName(String dnsName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BastionHost refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BastionHost refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostIpConfiguration.java new file mode 100644 index 0000000000000..bb4d10495d36e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostIpConfiguration.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration of an Bastion Host. */ +@JsonFlatten +@Fluent +public class BastionHostIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostIpConfiguration.class); + + /* + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Ip configuration type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /* + * Reference of the PublicIP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIpAddress; + + /* + * The provisioning state of the bastion host IP configuration resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Private IP allocation method. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /** + * Get the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the BastionHostIpConfiguration object itself. + */ + public BastionHostIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Ip configuration type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the subnet property: Reference of the subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Reference of the subnet resource. + * + * @param subnet the subnet value to set. + * @return the BastionHostIpConfiguration object itself. + */ + public BastionHostIpConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the publicIpAddress property: Reference of the PublicIP resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: Reference of the PublicIP resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the BastionHostIpConfiguration object itself. + */ + public BastionHostIpConfiguration withPublicIpAddress(SubResource publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the bastion host IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateIpAllocationMethod property: Private IP allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: Private IP allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the BastionHostIpConfiguration object itself. + */ + public BastionHostIpConfiguration withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** {@inheritDoc} */ + @Override + public BastionHostIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostListResult.java new file mode 100644 index 0000000000000..fb27b2bf116a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListBastionHosts API service call. */ +@Fluent +public final class BastionHostListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostListResult.class); + + /* + * List of Bastion Hosts in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Bastion Hosts in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Bastion Hosts in a resource group. + * + * @param value the value value to set. + * @return the BastionHostListResult object itself. + */ + public BastionHostListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BastionHostListResult object itself. + */ + public BastionHostListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostSkuName.java new file mode 100644 index 0000000000000..72f35702ed161 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostSkuName.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BastionHostSkuName. */ +public final class BastionHostSkuName extends ExpandableStringEnum { + /** Static value Basic for BastionHostSkuName. */ + public static final BastionHostSkuName BASIC = fromString("Basic"); + + /** Static value Standard for BastionHostSkuName. */ + public static final BastionHostSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a BastionHostSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding BastionHostSkuName. + */ + @JsonCreator + public static BastionHostSkuName fromString(String name) { + return fromString(name, BastionHostSkuName.class); + } + + /** @return known BastionHostSkuName values. */ + public static Collection values() { + return values(BastionHostSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.java new file mode 100644 index 0000000000000..9809fe771f50d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 BastionHosts. */ +public interface BastionHosts { + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 bastionHostname); + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 bastionHostname, Context context); + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + BastionHost getByResourceGroup(String resourceGroupName, String bastionHostname); + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String bastionHostname, Context context); + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + PagedIterable list(); + + /** + * Lists all Bastion Hosts 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 response for ListBastionHosts API service call. + */ + PagedIterable list(Context context); + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListBastionHosts API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified Bastion Host. + * + * @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 the specified Bastion Host. + */ + BastionHost getById(String id); + + /** + * Gets the specified Bastion Host. + * + * @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 specified Bastion Host. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified Bastion Host. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Bastion Host. + * + * @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 BastionHost resource. + * + * @param name resource name. + * @return the first stage of the new BastionHost definition. + */ + BastionHost.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionDeleteResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionDeleteResult.java new file mode 100644 index 0000000000000..23ef544881069 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionDeleteResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for DisconnectActiveSessions. */ +@Fluent +public final class BastionSessionDeleteResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionSessionDeleteResult.class); + + /* + * List of sessions with their corresponding state. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of sessions with their corresponding state. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of sessions with their corresponding state. + * + * @param value the value value to set. + * @return the BastionSessionDeleteResult object itself. + */ + public BastionSessionDeleteResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BastionSessionDeleteResult object itself. + */ + public BastionSessionDeleteResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java new file mode 100644 index 0000000000000..c8caf45ea8b1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; + +/** An immutable client-side representation of BastionSessionState. */ +public interface BastionSessionState { + /** + * Gets the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + String sessionId(); + + /** + * Gets the message property: Used for extra information. + * + * @return the message value. + */ + String message(); + + /** + * Gets the state property: The state of the session. Disconnected/Failed/NotFound. + * + * @return the state value. + */ + String state(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner object. + * + * @return the inner object. + */ + BastionSessionStateInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java new file mode 100644 index 0000000000000..d48f19c935d7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; + +/** An immutable client-side representation of BastionShareableLink. */ +public interface BastionShareableLink { + /** + * Gets the vm property: Reference of the virtual machine resource. + * + * @return the vm value. + */ + VM vm(); + + /** + * Gets the bsl property: The unique Bastion Shareable Link to the virtual machine. + * + * @return the bsl value. + */ + String bsl(); + + /** + * Gets the createdAt property: The time when the link was created. + * + * @return the createdAt value. + */ + String createdAt(); + + /** + * Gets the message property: Optional field indicating the warning or error message related to the vm in case of + * partial failure. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner object. + * + * @return the inner object. + */ + BastionShareableLinkInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java new file mode 100644 index 0000000000000..3c0934424bd30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Post request for all the Bastion Shareable Link endpoints. */ +@Fluent +public final class BastionShareableLinkListRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionShareableLinkListRequest.class); + + /* + * List of VM references. + */ + @JsonProperty(value = "vms") + private List vms; + + /** + * Get the vms property: List of VM references. + * + * @return the vms value. + */ + public List vms() { + return this.vms; + } + + /** + * Set the vms property: List of VM references. + * + * @param vms the vms value to set. + * @return the BastionShareableLinkListRequest object itself. + */ + public BastionShareableLinkListRequest withVms(List vms) { + this.vms = vms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vms() != null) { + vms().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.java new file mode 100644 index 0000000000000..6e06ff53ddcb4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for all the Bastion Shareable Link endpoints. */ +@Fluent +public final class BastionShareableLinkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionShareableLinkListResult.class); + + /* + * List of Bastion Shareable Links for the request. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Bastion Shareable Links for the request. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Bastion Shareable Links for the request. + * + * @param value the value value to set. + * @return the BastionShareableLinkListResult object itself. + */ + public BastionShareableLinkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BastionShareableLinkListResult object itself. + */ + public BastionShareableLinkListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.java new file mode 100644 index 0000000000000..8d9480c4c4fa7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.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.network.generated.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; + +/** Contains bgp community information offered in Service Community resources. */ +@Fluent +public final class BgpCommunity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpCommunity.class); + + /* + * The region which the service support. e.g. For O365, region is Global. + */ + @JsonProperty(value = "serviceSupportedRegion") + private String serviceSupportedRegion; + + /* + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "communityName") + private String communityName; + + /* + * The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + */ + @JsonProperty(value = "communityValue") + private String communityValue; + + /* + * The prefixes that the bgp community contains. + */ + @JsonProperty(value = "communityPrefixes") + private List communityPrefixes; + + /* + * Customer is authorized to use bgp community or not. + */ + @JsonProperty(value = "isAuthorizedToUse") + private Boolean isAuthorizedToUse; + + /* + * The service group of the bgp community contains. + */ + @JsonProperty(value = "serviceGroup") + private String serviceGroup; + + /** + * Get the serviceSupportedRegion property: The region which the service support. e.g. For O365, region is Global. + * + * @return the serviceSupportedRegion value. + */ + public String serviceSupportedRegion() { + return this.serviceSupportedRegion; + } + + /** + * Set the serviceSupportedRegion property: The region which the service support. e.g. For O365, region is Global. + * + * @param serviceSupportedRegion the serviceSupportedRegion value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withServiceSupportedRegion(String serviceSupportedRegion) { + this.serviceSupportedRegion = serviceSupportedRegion; + return this; + } + + /** + * Get the communityName property: The name of the bgp community. e.g. Skype. + * + * @return the communityName value. + */ + public String communityName() { + return this.communityName; + } + + /** + * Set the communityName property: The name of the bgp community. e.g. Skype. + * + * @param communityName the communityName value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withCommunityName(String communityName) { + this.communityName = communityName; + return this; + } + + /** + * Get the communityValue property: The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @return the communityValue value. + */ + public String communityValue() { + return this.communityValue; + } + + /** + * Set the communityValue property: The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @param communityValue the communityValue value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withCommunityValue(String communityValue) { + this.communityValue = communityValue; + return this; + } + + /** + * Get the communityPrefixes property: The prefixes that the bgp community contains. + * + * @return the communityPrefixes value. + */ + public List communityPrefixes() { + return this.communityPrefixes; + } + + /** + * Set the communityPrefixes property: The prefixes that the bgp community contains. + * + * @param communityPrefixes the communityPrefixes value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withCommunityPrefixes(List communityPrefixes) { + this.communityPrefixes = communityPrefixes; + return this; + } + + /** + * Get the isAuthorizedToUse property: Customer is authorized to use bgp community or not. + * + * @return the isAuthorizedToUse value. + */ + public Boolean isAuthorizedToUse() { + return this.isAuthorizedToUse; + } + + /** + * Set the isAuthorizedToUse property: Customer is authorized to use bgp community or not. + * + * @param isAuthorizedToUse the isAuthorizedToUse value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withIsAuthorizedToUse(Boolean isAuthorizedToUse) { + this.isAuthorizedToUse = isAuthorizedToUse; + return this; + } + + /** + * Get the serviceGroup property: The service group of the bgp community contains. + * + * @return the serviceGroup value. + */ + public String serviceGroup() { + return this.serviceGroup; + } + + /** + * Set the serviceGroup property: The service group of the bgp community contains. + * + * @param serviceGroup the serviceGroup value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withServiceGroup(String serviceGroup) { + this.serviceGroup = serviceGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.java new file mode 100644 index 0000000000000..c499a4100d2b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; + +/** An immutable client-side representation of BgpConnection. */ +public interface BgpConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the connection. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Connection type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the peerAsn property: Peer ASN. + * + * @return the peerAsn value. + */ + Long peerAsn(); + + /** + * Gets the peerIp property: Peer IP. + * + * @return the peerIp value. + */ + String peerIp(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the connectionState property: The current state of the VirtualHub to Peer. + * + * @return the connectionState value. + */ + HubBgpConnectionStatus connectionState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner object. + * + * @return the inner object. + */ + BgpConnectionInner innerModel(); + + /** The entirety of the BgpConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The BgpConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the BgpConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the BgpConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualHubName. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @return the next definition stage. + */ + WithCreate withExistingVirtualHub(String resourceGroupName, String virtualHubName); + } + /** + * The stage of the BgpConnection 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.WithName, DefinitionStages.WithPeerAsn, DefinitionStages.WithPeerIp { + /** + * Executes the create request. + * + * @return the created resource. + */ + BgpConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BgpConnection create(Context context); + } + /** The stage of the BgpConnection definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the connection.. + * + * @param name Name of the connection. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the BgpConnection definition allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: Peer ASN.. + * + * @param peerAsn Peer ASN. + * @return the next definition stage. + */ + WithCreate withPeerAsn(Long peerAsn); + } + /** The stage of the BgpConnection definition allowing to specify peerIp. */ + interface WithPeerIp { + /** + * Specifies the peerIp property: Peer IP.. + * + * @param peerIp Peer IP. + * @return the next definition stage. + */ + WithCreate withPeerIp(String peerIp); + } + } + /** + * Begins update for the BgpConnection resource. + * + * @return the stage of resource update. + */ + BgpConnection.Update update(); + + /** The template for BgpConnection update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithPeerAsn, UpdateStages.WithPeerIp { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BgpConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BgpConnection apply(Context context); + } + /** The BgpConnection update stages. */ + interface UpdateStages { + /** The stage of the BgpConnection update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the connection.. + * + * @param name Name of the connection. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the BgpConnection update allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: Peer ASN.. + * + * @param peerAsn Peer ASN. + * @return the next definition stage. + */ + Update withPeerAsn(Long peerAsn); + } + /** The stage of the BgpConnection update allowing to specify peerIp. */ + interface WithPeerIp { + /** + * Specifies the peerIp property: Peer IP.. + * + * @param peerIp Peer IP. + * @return the next definition stage. + */ + Update withPeerIp(String peerIp); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BgpConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BgpConnection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerState.java new file mode 100644 index 0000000000000..3b19922cc44b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BgpPeerState. */ +public final class BgpPeerState extends ExpandableStringEnum { + /** Static value Unknown for BgpPeerState. */ + public static final BgpPeerState UNKNOWN = fromString("Unknown"); + + /** Static value Stopped for BgpPeerState. */ + public static final BgpPeerState STOPPED = fromString("Stopped"); + + /** Static value Idle for BgpPeerState. */ + public static final BgpPeerState IDLE = fromString("Idle"); + + /** Static value Connecting for BgpPeerState. */ + public static final BgpPeerState CONNECTING = fromString("Connecting"); + + /** Static value Connected for BgpPeerState. */ + public static final BgpPeerState CONNECTED = fromString("Connected"); + + /** + * Creates or finds a BgpPeerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BgpPeerState. + */ + @JsonCreator + public static BgpPeerState fromString(String name) { + return fromString(name, BgpPeerState.class); + } + + /** @return known BgpPeerState values. */ + public static Collection values() { + return values(BgpPeerState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java new file mode 100644 index 0000000000000..7bf62132eb235 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** BGP peer status details. */ +@Immutable +public final class BgpPeerStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpPeerStatus.class); + + /* + * The virtual network gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /* + * The remote BGP peer. + */ + @JsonProperty(value = "neighbor", access = JsonProperty.Access.WRITE_ONLY) + private String neighbor; + + /* + * The autonomous system number of the remote BGP peer. + */ + @JsonProperty(value = "asn", access = JsonProperty.Access.WRITE_ONLY) + private Long asn; + + /* + * The BGP peer state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private BgpPeerState state; + + /* + * For how long the peering has been up. + */ + @JsonProperty(value = "connectedDuration", access = JsonProperty.Access.WRITE_ONLY) + private String connectedDuration; + + /* + * The number of routes learned from this peer. + */ + @JsonProperty(value = "routesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long routesReceived; + + /* + * The number of BGP messages sent. + */ + @JsonProperty(value = "messagesSent", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesSent; + + /* + * The number of BGP messages received. + */ + @JsonProperty(value = "messagesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesReceived; + + /** + * Get the localAddress property: The virtual network gateway's local address. + * + * @return the localAddress value. + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the neighbor property: The remote BGP peer. + * + * @return the neighbor value. + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Get the asn property: The autonomous system number of the remote BGP peer. + * + * @return the asn value. + */ + public Long asn() { + return this.asn; + } + + /** + * Get the state property: The BGP peer state. + * + * @return the state value. + */ + public BgpPeerState state() { + return this.state; + } + + /** + * Get the connectedDuration property: For how long the peering has been up. + * + * @return the connectedDuration value. + */ + public String connectedDuration() { + return this.connectedDuration; + } + + /** + * Get the routesReceived property: The number of routes learned from this peer. + * + * @return the routesReceived value. + */ + public Long routesReceived() { + return this.routesReceived; + } + + /** + * Get the messagesSent property: The number of BGP messages sent. + * + * @return the messagesSent value. + */ + public Long messagesSent() { + return this.messagesSent; + } + + /** + * Get the messagesReceived property: The number of BGP messages received. + * + * @return the messagesReceived value. + */ + public Long messagesReceived() { + return this.messagesReceived; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java new file mode 100644 index 0000000000000..dcff9d96ec080 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner; +import java.util.List; + +/** An immutable client-side representation of BgpPeerStatusListResult. */ +public interface BgpPeerStatusListResult { + /** + * Gets the value property: List of BGP peers. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner object. + * + * @return the inner object. + */ + BgpPeerStatusListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java new file mode 100644 index 0000000000000..ac882616b43e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BgpServiceCommunities. */ +public interface BgpServiceCommunities { + /** + * Gets all the available bgp service communities. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + PagedIterable list(); + + /** + * Gets all the available bgp service communities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunity.java new file mode 100644 index 0000000000000..a9888bcca77a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunity.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BgpServiceCommunity. */ +public interface BgpServiceCommunity { + /** + * 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 serviceName property: The name of the bgp community. e.g. Skype. + * + * @return the serviceName value. + */ + String serviceName(); + + /** + * Gets the bgpCommunities property: A list of bgp communities. + * + * @return the bgpCommunities value. + */ + List bgpCommunities(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner object. + * + * @return the inner object. + */ + BgpServiceCommunityInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunityListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunityListResult.java new file mode 100644 index 0000000000000..b2bbc1f87dd48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunityListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListServiceCommunity API service call. */ +@Fluent +public final class BgpServiceCommunityListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunityListResult.class); + + /* + * A list of service community resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of service community resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of service community resources. + * + * @param value the value value to set. + * @return the BgpServiceCommunityListResult object itself. + */ + public BgpServiceCommunityListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BgpServiceCommunityListResult object itself. + */ + public BgpServiceCommunityListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.java new file mode 100644 index 0000000000000..8990565e8bcc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** BGP settings details. */ +@Fluent +public final class BgpSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpSettings.class); + + /* + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /* + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /* + * The weight added to routes learned from this BGP speaker. + */ + @JsonProperty(value = "peerWeight") + private Integer peerWeight; + + /* + * BGP peering address with IP configuration ID for virtual network + * gateway. + */ + @JsonProperty(value = "bgpPeeringAddresses") + private List bgpPeeringAddresses; + + /** + * Get the asn property: The BGP speaker's ASN. + * + * @return the asn value. + */ + public Long asn() { + return this.asn; + } + + /** + * Set the asn property: The BGP speaker's ASN. + * + * @param asn the asn value to set. + * @return the BgpSettings object itself. + */ + public BgpSettings withAsn(Long asn) { + this.asn = asn; + return this; + } + + /** + * Get the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. + * + * @return the bgpPeeringAddress value. + */ + public String bgpPeeringAddress() { + return this.bgpPeeringAddress; + } + + /** + * Set the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. + * + * @param bgpPeeringAddress the bgpPeeringAddress value to set. + * @return the BgpSettings object itself. + */ + public BgpSettings withBgpPeeringAddress(String bgpPeeringAddress) { + this.bgpPeeringAddress = bgpPeeringAddress; + return this; + } + + /** + * Get the peerWeight property: The weight added to routes learned from this BGP speaker. + * + * @return the peerWeight value. + */ + public Integer peerWeight() { + return this.peerWeight; + } + + /** + * Set the peerWeight property: The weight added to routes learned from this BGP speaker. + * + * @param peerWeight the peerWeight value to set. + * @return the BgpSettings object itself. + */ + public BgpSettings withPeerWeight(Integer peerWeight) { + this.peerWeight = peerWeight; + return this; + } + + /** + * Get the bgpPeeringAddresses property: BGP peering address with IP configuration ID for virtual network gateway. + * + * @return the bgpPeeringAddresses value. + */ + public List bgpPeeringAddresses() { + return this.bgpPeeringAddresses; + } + + /** + * Set the bgpPeeringAddresses property: BGP peering address with IP configuration ID for virtual network gateway. + * + * @param bgpPeeringAddresses the bgpPeeringAddresses value to set. + * @return the BgpSettings object itself. + */ + public BgpSettings withBgpPeeringAddresses(List bgpPeeringAddresses) { + this.bgpPeeringAddresses = bgpPeeringAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bgpPeeringAddresses() != null) { + bgpPeeringAddresses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.java new file mode 100644 index 0000000000000..f11c1ac3a20ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.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.network.generated.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; + +/** Network Virtual Appliance Sku Properties. */ +@Fluent +public final class BreakOutCategoryPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BreakOutCategoryPolicies.class); + + /* + * Flag to control breakout of o365 allow category. + */ + @JsonProperty(value = "allow") + private Boolean allow; + + /* + * Flag to control breakout of o365 optimize category. + */ + @JsonProperty(value = "optimize") + private Boolean optimize; + + /* + * Flag to control breakout of o365 default category. + */ + @JsonProperty(value = "default") + private Boolean defaultProperty; + + /** + * Get the allow property: Flag to control breakout of o365 allow category. + * + * @return the allow value. + */ + public Boolean allow() { + return this.allow; + } + + /** + * Set the allow property: Flag to control breakout of o365 allow category. + * + * @param allow the allow value to set. + * @return the BreakOutCategoryPolicies object itself. + */ + public BreakOutCategoryPolicies withAllow(Boolean allow) { + this.allow = allow; + return this; + } + + /** + * Get the optimize property: Flag to control breakout of o365 optimize category. + * + * @return the optimize value. + */ + public Boolean optimize() { + return this.optimize; + } + + /** + * Set the optimize property: Flag to control breakout of o365 optimize category. + * + * @param optimize the optimize value to set. + * @return the BreakOutCategoryPolicies object itself. + */ + public BreakOutCategoryPolicies withOptimize(Boolean optimize) { + this.optimize = optimize; + return this; + } + + /** + * Get the defaultProperty property: Flag to control breakout of o365 default category. + * + * @return the defaultProperty value. + */ + public Boolean defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Flag to control breakout of o365 default category. + * + * @param defaultProperty the defaultProperty value to set. + * @return the BreakOutCategoryPolicies object itself. + */ + public BreakOutCategoryPolicies withDefaultProperty(Boolean defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.java new file mode 100644 index 0000000000000..ace34837f8058 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.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.network.generated.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; + +/** Request body of the CheckPrivateLinkServiceVisibility API service call. */ +@Fluent +public final class CheckPrivateLinkServiceVisibilityRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckPrivateLinkServiceVisibilityRequest.class); + + /* + * The alias of the private link service. + */ + @JsonProperty(value = "privateLinkServiceAlias") + private String privateLinkServiceAlias; + + /** + * Get the privateLinkServiceAlias property: The alias of the private link service. + * + * @return the privateLinkServiceAlias value. + */ + public String privateLinkServiceAlias() { + return this.privateLinkServiceAlias; + } + + /** + * Set the privateLinkServiceAlias property: The alias of the private link service. + * + * @param privateLinkServiceAlias the privateLinkServiceAlias value to set. + * @return the CheckPrivateLinkServiceVisibilityRequest object itself. + */ + public CheckPrivateLinkServiceVisibilityRequest withPrivateLinkServiceAlias(String privateLinkServiceAlias) { + this.privateLinkServiceAlias = privateLinkServiceAlias; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.java new file mode 100644 index 0000000000000..f00513510693b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CircuitConnectionStatus. */ +public final class CircuitConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Connecting for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Disconnected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a CircuitConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CircuitConnectionStatus. + */ + @JsonCreator + public static CircuitConnectionStatus fromString(String name) { + return fromString(name, CircuitConnectionStatus.class); + } + + /** @return known CircuitConnectionStatus values. */ + public static Collection values() { + return values(CircuitConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CommissionedState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CommissionedState.java new file mode 100644 index 0000000000000..f3bfaf15e5792 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CommissionedState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CommissionedState. */ +public final class CommissionedState extends ExpandableStringEnum { + /** Static value Provisioning for CommissionedState. */ + public static final CommissionedState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for CommissionedState. */ + public static final CommissionedState PROVISIONED = fromString("Provisioned"); + + /** Static value Commissioning for CommissionedState. */ + public static final CommissionedState COMMISSIONING = fromString("Commissioning"); + + /** Static value Commissioned for CommissionedState. */ + public static final CommissionedState COMMISSIONED = fromString("Commissioned"); + + /** Static value Decommissioning for CommissionedState. */ + public static final CommissionedState DECOMMISSIONING = fromString("Decommissioning"); + + /** Static value Deprovisioning for CommissionedState. */ + public static final CommissionedState DEPROVISIONING = fromString("Deprovisioning"); + + /** + * Creates or finds a CommissionedState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommissionedState. + */ + @JsonCreator + public static CommissionedState fromString(String name) { + return fromString(name, CommissionedState.class); + } + + /** @return known CommissionedState values. */ + public static Collection values() { + return values(CommissionedState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitor.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitor.java new file mode 100644 index 0000000000000..3f4eb2e463a4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitor.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters that define the operation to create a connection monitor. */ +@JsonFlatten +@Fluent +public class ConnectionMonitor { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitor.class); + + /* + * Connection monitor location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Connection monitor tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Describes the source of connection monitor. + */ + @JsonProperty(value = "properties.source") + private ConnectionMonitorSource source; + + /* + * Describes the destination of connection monitor. + */ + @JsonProperty(value = "properties.destination") + private ConnectionMonitorDestination destination; + + /* + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /* + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /* + * List of connection monitor endpoints. + */ + @JsonProperty(value = "properties.endpoints") + private List endpoints; + + /* + * List of connection monitor test configurations. + */ + @JsonProperty(value = "properties.testConfigurations") + private List testConfigurations; + + /* + * List of connection monitor test groups. + */ + @JsonProperty(value = "properties.testGroups") + private List testGroups; + + /* + * List of connection monitor outputs. + */ + @JsonProperty(value = "properties.outputs") + private List outputs; + + /* + * Optional notes to be associated with the connection monitor. + */ + @JsonProperty(value = "properties.notes") + private String notes; + + /** + * Get the location property: Connection monitor location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Connection monitor location. + * + * @param location the location value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Connection monitor tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Connection monitor tags. + * + * @param tags the tags value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the source property: Describes the source of connection monitor. + * + * @return the source value. + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source property: Describes the source of connection monitor. + * + * @param source the source value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Describes the destination of connection monitor. + * + * @return the destination value. + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Describes the destination of connection monitor. + * + * @param destination the destination value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the autoStart property: Determines if the connection monitor will start automatically once created. + * + * @return the autoStart value. + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set the autoStart property: Determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value. + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + + /** + * Get the endpoints property: List of connection monitor endpoints. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: List of connection monitor endpoints. + * + * @param endpoints the endpoints value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the testConfigurations property: List of connection monitor test configurations. + * + * @return the testConfigurations value. + */ + public List testConfigurations() { + return this.testConfigurations; + } + + /** + * Set the testConfigurations property: List of connection monitor test configurations. + * + * @param testConfigurations the testConfigurations value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withTestConfigurations(List testConfigurations) { + this.testConfigurations = testConfigurations; + return this; + } + + /** + * Get the testGroups property: List of connection monitor test groups. + * + * @return the testGroups value. + */ + public List testGroups() { + return this.testGroups; + } + + /** + * Set the testGroups property: List of connection monitor test groups. + * + * @param testGroups the testGroups value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withTestGroups(List testGroups) { + this.testGroups = testGroups; + return this; + } + + /** + * Get the outputs property: List of connection monitor outputs. + * + * @return the outputs value. + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs property: List of connection monitor outputs. + * + * @param outputs the outputs value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get the notes property: Optional notes to be associated with the connection monitor. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: Optional notes to be associated with the connection monitor. + * + * @param notes the notes value to set. + * @return the ConnectionMonitor object itself. + */ + public ConnectionMonitor withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (destination() != null) { + destination().validate(); + } + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (testConfigurations() != null) { + testConfigurations().forEach(e -> e.validate()); + } + if (testGroups() != null) { + testGroups().forEach(e -> e.validate()); + } + if (outputs() != null) { + outputs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorDestination.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorDestination.java new file mode 100644 index 0000000000000..437699c6b8094 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorDestination.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.network.generated.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; + +/** Describes the destination of connection monitor. */ +@Fluent +public final class ConnectionMonitorDestination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorDestination.class); + + /* + * The ID of the resource used as the destination by connection monitor. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Address of the connection monitor destination (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /* + * The destination port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the resourceId property: The ID of the resource used as the destination by connection monitor. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource used as the destination by connection monitor. + * + * @param resourceId the resourceId value to set. + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the address property: Address of the connection monitor destination (IP or domain name). + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Address of the connection monitor destination (IP or domain name). + * + * @param address the address value to set. + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the port property: The destination port used by connection monitor. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The destination port used by connection monitor. + * + * @param port the port value to set. + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpoint.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpoint.java new file mode 100644 index 0000000000000..08e0c40a62aa1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpoint.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.network.generated.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; + +/** Describes the connection monitor endpoint. */ +@Fluent +public final class ConnectionMonitorEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpoint.class); + + /* + * The name of the connection monitor endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The endpoint type. + */ + @JsonProperty(value = "type") + private EndpointType type; + + /* + * Resource ID of the connection monitor endpoint. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Address of the connection monitor endpoint (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /* + * Filter for sub-items within the endpoint. + */ + @JsonProperty(value = "filter") + private ConnectionMonitorEndpointFilter filter; + + /* + * Endpoint scope. + */ + @JsonProperty(value = "scope") + private ConnectionMonitorEndpointScope scope; + + /* + * Test coverage for the endpoint. + */ + @JsonProperty(value = "coverageLevel") + private CoverageLevel coverageLevel; + + /** + * Get the name property: The name of the connection monitor endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the connection monitor endpoint. + * + * @param name the name value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The endpoint type. + * + * @return the type value. + */ + public EndpointType type() { + return this.type; + } + + /** + * Set the type property: The endpoint type. + * + * @param type the type value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withType(EndpointType type) { + this.type = type; + return this; + } + + /** + * Get the resourceId property: Resource ID of the connection monitor endpoint. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID of the connection monitor endpoint. + * + * @param resourceId the resourceId value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the address property: Address of the connection monitor endpoint (IP or domain name). + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Address of the connection monitor endpoint (IP or domain name). + * + * @param address the address value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the filter property: Filter for sub-items within the endpoint. + * + * @return the filter value. + */ + public ConnectionMonitorEndpointFilter filter() { + return this.filter; + } + + /** + * Set the filter property: Filter for sub-items within the endpoint. + * + * @param filter the filter value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withFilter(ConnectionMonitorEndpointFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the scope property: Endpoint scope. + * + * @return the scope value. + */ + public ConnectionMonitorEndpointScope scope() { + return this.scope; + } + + /** + * Set the scope property: Endpoint scope. + * + * @param scope the scope value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withScope(ConnectionMonitorEndpointScope scope) { + this.scope = scope; + return this; + } + + /** + * Get the coverageLevel property: Test coverage for the endpoint. + * + * @return the coverageLevel value. + */ + public CoverageLevel coverageLevel() { + return this.coverageLevel; + } + + /** + * Set the coverageLevel property: Test coverage for the endpoint. + * + * @param coverageLevel the coverageLevel value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withCoverageLevel(CoverageLevel coverageLevel) { + this.coverageLevel = coverageLevel; + 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 ConnectionMonitorEndpoint")); + } + if (filter() != null) { + filter().validate(); + } + if (scope() != null) { + scope().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilter.java new file mode 100644 index 0000000000000..245cbcc791270 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilter.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Describes the connection monitor endpoint filter. */ +@Fluent +public final class ConnectionMonitorEndpointFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpointFilter.class); + + /* + * The behavior of the endpoint filter. Currently only 'Include' is + * supported. + */ + @JsonProperty(value = "type") + private ConnectionMonitorEndpointFilterType type; + + /* + * List of items in the filter. + */ + @JsonProperty(value = "items") + private List items; + + /** + * Get the type property: The behavior of the endpoint filter. Currently only 'Include' is supported. + * + * @return the type value. + */ + public ConnectionMonitorEndpointFilterType type() { + return this.type; + } + + /** + * Set the type property: The behavior of the endpoint filter. Currently only 'Include' is supported. + * + * @param type the type value to set. + * @return the ConnectionMonitorEndpointFilter object itself. + */ + public ConnectionMonitorEndpointFilter withType(ConnectionMonitorEndpointFilterType type) { + this.type = type; + return this; + } + + /** + * Get the items property: List of items in the filter. + * + * @return the items value. + */ + public List items() { + return this.items; + } + + /** + * Set the items property: List of items in the filter. + * + * @param items the items value to set. + * @return the ConnectionMonitorEndpointFilter object itself. + */ + public ConnectionMonitorEndpointFilter withItems(List items) { + this.items = items; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (items() != null) { + items().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItem.java new file mode 100644 index 0000000000000..1d49cfd5532ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItem.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.network.generated.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; + +/** Describes the connection monitor endpoint filter item. */ +@Fluent +public final class ConnectionMonitorEndpointFilterItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpointFilterItem.class); + + /* + * The type of item included in the filter. Currently only 'AgentAddress' + * is supported. + */ + @JsonProperty(value = "type") + private ConnectionMonitorEndpointFilterItemType type; + + /* + * The address of the filter item. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Get the type property: The type of item included in the filter. Currently only 'AgentAddress' is supported. + * + * @return the type value. + */ + public ConnectionMonitorEndpointFilterItemType type() { + return this.type; + } + + /** + * Set the type property: The type of item included in the filter. Currently only 'AgentAddress' is supported. + * + * @param type the type value to set. + * @return the ConnectionMonitorEndpointFilterItem object itself. + */ + public ConnectionMonitorEndpointFilterItem withType(ConnectionMonitorEndpointFilterItemType type) { + this.type = type; + return this; + } + + /** + * Get the address property: The address of the filter item. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: The address of the filter item. + * + * @param address the address value to set. + * @return the ConnectionMonitorEndpointFilterItem object itself. + */ + public ConnectionMonitorEndpointFilterItem withAddress(String address) { + this.address = address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItemType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItemType.java new file mode 100644 index 0000000000000..f06310755785f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItemType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorEndpointFilterItemType. */ +public final class ConnectionMonitorEndpointFilterItemType + extends ExpandableStringEnum { + /** Static value AgentAddress for ConnectionMonitorEndpointFilterItemType. */ + public static final ConnectionMonitorEndpointFilterItemType AGENT_ADDRESS = fromString("AgentAddress"); + + /** + * Creates or finds a ConnectionMonitorEndpointFilterItemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorEndpointFilterItemType. + */ + @JsonCreator + public static ConnectionMonitorEndpointFilterItemType fromString(String name) { + return fromString(name, ConnectionMonitorEndpointFilterItemType.class); + } + + /** @return known ConnectionMonitorEndpointFilterItemType values. */ + public static Collection values() { + return values(ConnectionMonitorEndpointFilterItemType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterType.java new file mode 100644 index 0000000000000..be3915ec316dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorEndpointFilterType. */ +public final class ConnectionMonitorEndpointFilterType + extends ExpandableStringEnum { + /** Static value Include for ConnectionMonitorEndpointFilterType. */ + public static final ConnectionMonitorEndpointFilterType INCLUDE = fromString("Include"); + + /** + * Creates or finds a ConnectionMonitorEndpointFilterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorEndpointFilterType. + */ + @JsonCreator + public static ConnectionMonitorEndpointFilterType fromString(String name) { + return fromString(name, ConnectionMonitorEndpointFilterType.class); + } + + /** @return known ConnectionMonitorEndpointFilterType values. */ + public static Collection values() { + return values(ConnectionMonitorEndpointFilterType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScope.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScope.java new file mode 100644 index 0000000000000..a7c9a3fefd99b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScope.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.network.generated.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; + +/** Describes the connection monitor endpoint scope. */ +@Fluent +public final class ConnectionMonitorEndpointScope { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpointScope.class); + + /* + * List of items which needs to be included to the endpoint scope. + */ + @JsonProperty(value = "include") + private List include; + + /* + * List of items which needs to be excluded from the endpoint scope. + */ + @JsonProperty(value = "exclude") + private List exclude; + + /** + * Get the include property: List of items which needs to be included to the endpoint scope. + * + * @return the include value. + */ + public List include() { + return this.include; + } + + /** + * Set the include property: List of items which needs to be included to the endpoint scope. + * + * @param include the include value to set. + * @return the ConnectionMonitorEndpointScope object itself. + */ + public ConnectionMonitorEndpointScope withInclude(List include) { + this.include = include; + return this; + } + + /** + * Get the exclude property: List of items which needs to be excluded from the endpoint scope. + * + * @return the exclude value. + */ + public List exclude() { + return this.exclude; + } + + /** + * Set the exclude property: List of items which needs to be excluded from the endpoint scope. + * + * @param exclude the exclude value to set. + * @return the ConnectionMonitorEndpointScope object itself. + */ + public ConnectionMonitorEndpointScope withExclude(List exclude) { + this.exclude = exclude; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (include() != null) { + include().forEach(e -> e.validate()); + } + if (exclude() != null) { + exclude().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScopeItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScopeItem.java new file mode 100644 index 0000000000000..b7f28b55fae3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScopeItem.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.network.generated.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; + +/** Describes the connection monitor endpoint scope item. */ +@Fluent +public final class ConnectionMonitorEndpointScopeItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpointScopeItem.class); + + /* + * The address of the endpoint item. Supported types are IPv4/IPv6 subnet + * mask or IPv4/IPv6 IP address. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Get the address property: The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or + * IPv4/IPv6 IP address. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or + * IPv4/IPv6 IP address. + * + * @param address the address value to set. + * @return the ConnectionMonitorEndpointScopeItem object itself. + */ + public ConnectionMonitorEndpointScopeItem withAddress(String address) { + this.address = address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorHttpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorHttpConfiguration.java new file mode 100644 index 0000000000000..f25f5f4a2cc7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorHttpConfiguration.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.network.generated.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; + +/** Describes the HTTP configuration. */ +@Fluent +public final class ConnectionMonitorHttpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorHttpConfiguration.class); + + /* + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The HTTP method to use. + */ + @JsonProperty(value = "method") + private HttpConfigurationMethod method; + + /* + * The path component of the URI. For instance, "/dir1/dir2". + */ + @JsonProperty(value = "path") + private String path; + + /* + * The HTTP headers to transmit with the request. + */ + @JsonProperty(value = "requestHeaders") + private List requestHeaders; + + /* + * HTTP status codes to consider successful. For instance, + * "2xx,301-304,418". + */ + @JsonProperty(value = "validStatusCodeRanges") + private List validStatusCodeRanges; + + /* + * Value indicating whether HTTPS is preferred over HTTP in cases where the + * choice is not explicit. + */ + @JsonProperty(value = "preferHTTPS") + private Boolean preferHttps; + + /** + * Get the port property: The port to connect to. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port to connect to. + * + * @param port the port value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the method property: The HTTP method to use. + * + * @return the method value. + */ + public HttpConfigurationMethod method() { + return this.method; + } + + /** + * Set the method property: The HTTP method to use. + * + * @param method the method value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withMethod(HttpConfigurationMethod method) { + this.method = method; + return this; + } + + /** + * Get the path property: The path component of the URI. For instance, "/dir1/dir2". + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path component of the URI. For instance, "/dir1/dir2". + * + * @param path the path value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the requestHeaders property: The HTTP headers to transmit with the request. + * + * @return the requestHeaders value. + */ + public List requestHeaders() { + return this.requestHeaders; + } + + /** + * Set the requestHeaders property: The HTTP headers to transmit with the request. + * + * @param requestHeaders the requestHeaders value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withRequestHeaders(List requestHeaders) { + this.requestHeaders = requestHeaders; + return this; + } + + /** + * Get the validStatusCodeRanges property: HTTP status codes to consider successful. For instance, + * "2xx,301-304,418". + * + * @return the validStatusCodeRanges value. + */ + public List validStatusCodeRanges() { + return this.validStatusCodeRanges; + } + + /** + * Set the validStatusCodeRanges property: HTTP status codes to consider successful. For instance, + * "2xx,301-304,418". + * + * @param validStatusCodeRanges the validStatusCodeRanges value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withValidStatusCodeRanges(List validStatusCodeRanges) { + this.validStatusCodeRanges = validStatusCodeRanges; + return this; + } + + /** + * Get the preferHttps property: Value indicating whether HTTPS is preferred over HTTP in cases where the choice is + * not explicit. + * + * @return the preferHttps value. + */ + public Boolean preferHttps() { + return this.preferHttps; + } + + /** + * Set the preferHttps property: Value indicating whether HTTPS is preferred over HTTP in cases where the choice is + * not explicit. + * + * @param preferHttps the preferHttps value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withPreferHttps(Boolean preferHttps) { + this.preferHttps = preferHttps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requestHeaders() != null) { + requestHeaders().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorIcmpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorIcmpConfiguration.java new file mode 100644 index 0000000000000..4e3914b1e65c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorIcmpConfiguration.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Describes the ICMP configuration. */ +@Fluent +public final class ConnectionMonitorIcmpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorIcmpConfiguration.class); + + /* + * Value indicating whether path evaluation with trace route should be + * disabled. + */ + @JsonProperty(value = "disableTraceRoute") + private Boolean disableTraceRoute; + + /** + * Get the disableTraceRoute property: Value indicating whether path evaluation with trace route should be disabled. + * + * @return the disableTraceRoute value. + */ + public Boolean disableTraceRoute() { + return this.disableTraceRoute; + } + + /** + * Set the disableTraceRoute property: Value indicating whether path evaluation with trace route should be disabled. + * + * @param disableTraceRoute the disableTraceRoute value to set. + * @return the ConnectionMonitorIcmpConfiguration object itself. + */ + public ConnectionMonitorIcmpConfiguration withDisableTraceRoute(Boolean disableTraceRoute) { + this.disableTraceRoute = disableTraceRoute; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorListResult.java new file mode 100644 index 0000000000000..e3373b0050a64 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of connection monitors. */ +@Fluent +public final class ConnectionMonitorListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorListResult.class); + + /* + * Information about connection monitors. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Information about connection monitors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about connection monitors. + * + * @param value the value value to set. + * @return the ConnectionMonitorListResult object itself. + */ + public ConnectionMonitorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorOutput.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorOutput.java new file mode 100644 index 0000000000000..7510390b8fd48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorOutput.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Describes a connection monitor output destination. */ +@Fluent +public final class ConnectionMonitorOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorOutput.class); + + /* + * Connection monitor output destination type. Currently, only "Workspace" + * is supported. + */ + @JsonProperty(value = "type") + private OutputType type; + + /* + * Describes the settings for producing output into a log analytics + * workspace. + */ + @JsonProperty(value = "workspaceSettings") + private ConnectionMonitorWorkspaceSettings workspaceSettings; + + /** + * Get the type property: Connection monitor output destination type. Currently, only "Workspace" is supported. + * + * @return the type value. + */ + public OutputType type() { + return this.type; + } + + /** + * Set the type property: Connection monitor output destination type. Currently, only "Workspace" is supported. + * + * @param type the type value to set. + * @return the ConnectionMonitorOutput object itself. + */ + public ConnectionMonitorOutput withType(OutputType type) { + this.type = type; + return this; + } + + /** + * Get the workspaceSettings property: Describes the settings for producing output into a log analytics workspace. + * + * @return the workspaceSettings value. + */ + public ConnectionMonitorWorkspaceSettings workspaceSettings() { + return this.workspaceSettings; + } + + /** + * Set the workspaceSettings property: Describes the settings for producing output into a log analytics workspace. + * + * @param workspaceSettings the workspaceSettings value to set. + * @return the ConnectionMonitorOutput object itself. + */ + public ConnectionMonitorOutput withWorkspaceSettings(ConnectionMonitorWorkspaceSettings workspaceSettings) { + this.workspaceSettings = workspaceSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (workspaceSettings() != null) { + workspaceSettings().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorParameters.java new file mode 100644 index 0000000000000..e788e5c10ebb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorParameters.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters that define the operation to create a connection monitor. */ +@Fluent +public class ConnectionMonitorParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorParameters.class); + + /* + * Describes the source of connection monitor. + */ + @JsonProperty(value = "source") + private ConnectionMonitorSource source; + + /* + * Describes the destination of connection monitor. + */ + @JsonProperty(value = "destination") + private ConnectionMonitorDestination destination; + + /* + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "autoStart") + private Boolean autoStart; + + /* + * Monitoring interval in seconds. + */ + @JsonProperty(value = "monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /* + * List of connection monitor endpoints. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * List of connection monitor test configurations. + */ + @JsonProperty(value = "testConfigurations") + private List testConfigurations; + + /* + * List of connection monitor test groups. + */ + @JsonProperty(value = "testGroups") + private List testGroups; + + /* + * List of connection monitor outputs. + */ + @JsonProperty(value = "outputs") + private List outputs; + + /* + * Optional notes to be associated with the connection monitor. + */ + @JsonProperty(value = "notes") + private String notes; + + /** + * Get the source property: Describes the source of connection monitor. + * + * @return the source value. + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source property: Describes the source of connection monitor. + * + * @param source the source value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Describes the destination of connection monitor. + * + * @return the destination value. + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Describes the destination of connection monitor. + * + * @param destination the destination value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the autoStart property: Determines if the connection monitor will start automatically once created. + * + * @return the autoStart value. + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set the autoStart property: Determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value. + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + + /** + * Get the endpoints property: List of connection monitor endpoints. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: List of connection monitor endpoints. + * + * @param endpoints the endpoints value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the testConfigurations property: List of connection monitor test configurations. + * + * @return the testConfigurations value. + */ + public List testConfigurations() { + return this.testConfigurations; + } + + /** + * Set the testConfigurations property: List of connection monitor test configurations. + * + * @param testConfigurations the testConfigurations value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withTestConfigurations( + List testConfigurations) { + this.testConfigurations = testConfigurations; + return this; + } + + /** + * Get the testGroups property: List of connection monitor test groups. + * + * @return the testGroups value. + */ + public List testGroups() { + return this.testGroups; + } + + /** + * Set the testGroups property: List of connection monitor test groups. + * + * @param testGroups the testGroups value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withTestGroups(List testGroups) { + this.testGroups = testGroups; + return this; + } + + /** + * Get the outputs property: List of connection monitor outputs. + * + * @return the outputs value. + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs property: List of connection monitor outputs. + * + * @param outputs the outputs value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get the notes property: Optional notes to be associated with the connection monitor. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: Optional notes to be associated with the connection monitor. + * + * @param notes the notes value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (destination() != null) { + destination().validate(); + } + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (testConfigurations() != null) { + testConfigurations().forEach(e -> e.validate()); + } + if (testGroups() != null) { + testGroups().forEach(e -> e.validate()); + } + if (outputs() != null) { + outputs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorQueryResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorQueryResult.java new file mode 100644 index 0000000000000..5cf38d4040166 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorQueryResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner; +import java.util.List; + +/** An immutable client-side representation of ConnectionMonitorQueryResult. */ +public interface ConnectionMonitorQueryResult { + /** + * Gets the sourceStatus property: Status of connection monitor source. + * + * @return the sourceStatus value. + */ + ConnectionMonitorSourceStatus sourceStatus(); + + /** + * Gets the states property: Information about connection states. + * + * @return the states value. + */ + List states(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner + * object. + * + * @return the inner object. + */ + ConnectionMonitorQueryResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResult.java new file mode 100644 index 0000000000000..1f6aebeafba6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResult.java @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ConnectionMonitorResult. */ +public interface ConnectionMonitorResult { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the source property: Describes the source of connection monitor. + * + * @return the source value. + */ + ConnectionMonitorSource source(); + + /** + * Gets the destination property: Describes the destination of connection monitor. + * + * @return the destination value. + */ + ConnectionMonitorDestination destination(); + + /** + * Gets the autoStart property: Determines if the connection monitor will start automatically once created. + * + * @return the autoStart value. + */ + Boolean autoStart(); + + /** + * Gets the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value. + */ + Integer monitoringIntervalInSeconds(); + + /** + * Gets the endpoints property: List of connection monitor endpoints. + * + * @return the endpoints value. + */ + List endpoints(); + + /** + * Gets the testConfigurations property: List of connection monitor test configurations. + * + * @return the testConfigurations value. + */ + List testConfigurations(); + + /** + * Gets the testGroups property: List of connection monitor test groups. + * + * @return the testGroups value. + */ + List testGroups(); + + /** + * Gets the outputs property: List of connection monitor outputs. + * + * @return the outputs value. + */ + List outputs(); + + /** + * Gets the notes property: Optional notes to be associated with the connection monitor. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the provisioningState property: The provisioning state of the connection monitor. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the startTime property: The date and time when the connection monitor was started. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the monitoringStatus property: The monitoring status of the connection monitor. + * + * @return the monitoringStatus value. + */ + String monitoringStatus(); + + /** + * Gets the connectionMonitorType property: Type of connection monitor. + * + * @return the connectionMonitorType value. + */ + ConnectionMonitorType connectionMonitorType(); + + /** + * 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.network.generated.fluent.models.ConnectionMonitorResultInner object. + * + * @return the inner object. + */ + ConnectionMonitorResultInner innerModel(); + + /** The entirety of the ConnectionMonitorResult definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ConnectionMonitorResult definition stages. */ + interface DefinitionStages { + /** The first stage of the ConnectionMonitorResult definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ConnectionMonitorResult definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkWatcherName. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @return the next definition stage. + */ + WithCreate withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + /** + * The stage of the ConnectionMonitorResult definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithTags, + DefinitionStages.WithSource, + DefinitionStages.WithDestination, + DefinitionStages.WithAutoStart, + DefinitionStages.WithMonitoringIntervalInSeconds, + DefinitionStages.WithEndpoints, + DefinitionStages.WithTestConfigurations, + DefinitionStages.WithTestGroups, + DefinitionStages.WithOutputs, + DefinitionStages.WithNotes, + DefinitionStages.WithMigrate { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConnectionMonitorResult create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConnectionMonitorResult create(Context context); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Connection monitor location. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Connection monitor location. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Connection monitor tags.. + * + * @param tags Connection monitor tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Describes the source of connection monitor.. + * + * @param source Describes the source of connection monitor. + * @return the next definition stage. + */ + WithCreate withSource(ConnectionMonitorSource source); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify destination. */ + interface WithDestination { + /** + * Specifies the destination property: Describes the destination of connection monitor.. + * + * @param destination Describes the destination of connection monitor. + * @return the next definition stage. + */ + WithCreate withDestination(ConnectionMonitorDestination destination); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify autoStart. */ + interface WithAutoStart { + /** + * Specifies the autoStart property: Determines if the connection monitor will start automatically once + * created.. + * + * @param autoStart Determines if the connection monitor will start automatically once created. + * @return the next definition stage. + */ + WithCreate withAutoStart(Boolean autoStart); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify monitoringIntervalInSeconds. */ + interface WithMonitoringIntervalInSeconds { + /** + * Specifies the monitoringIntervalInSeconds property: Monitoring interval in seconds.. + * + * @param monitoringIntervalInSeconds Monitoring interval in seconds. + * @return the next definition stage. + */ + WithCreate withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify endpoints. */ + interface WithEndpoints { + /** + * Specifies the endpoints property: List of connection monitor endpoints.. + * + * @param endpoints List of connection monitor endpoints. + * @return the next definition stage. + */ + WithCreate withEndpoints(List endpoints); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify testConfigurations. */ + interface WithTestConfigurations { + /** + * Specifies the testConfigurations property: List of connection monitor test configurations.. + * + * @param testConfigurations List of connection monitor test configurations. + * @return the next definition stage. + */ + WithCreate withTestConfigurations(List testConfigurations); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify testGroups. */ + interface WithTestGroups { + /** + * Specifies the testGroups property: List of connection monitor test groups.. + * + * @param testGroups List of connection monitor test groups. + * @return the next definition stage. + */ + WithCreate withTestGroups(List testGroups); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify outputs. */ + interface WithOutputs { + /** + * Specifies the outputs property: List of connection monitor outputs.. + * + * @param outputs List of connection monitor outputs. + * @return the next definition stage. + */ + WithCreate withOutputs(List outputs); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify notes. */ + interface WithNotes { + /** + * Specifies the notes property: Optional notes to be associated with the connection monitor.. + * + * @param notes Optional notes to be associated with the connection monitor. + * @return the next definition stage. + */ + WithCreate withNotes(String notes); + } + /** The stage of the ConnectionMonitorResult definition allowing to specify migrate. */ + interface WithMigrate { + /** + * Specifies the migrate property: Value indicating whether connection monitor V1 should be migrated to V2 + * format.. + * + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @return the next definition stage. + */ + WithCreate withMigrate(String migrate); + } + } + /** + * Begins update for the ConnectionMonitorResult resource. + * + * @return the stage of resource update. + */ + ConnectionMonitorResult.Update update(); + + /** The template for ConnectionMonitorResult update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConnectionMonitorResult apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConnectionMonitorResult apply(Context context); + } + /** The ConnectionMonitorResult update stages. */ + interface UpdateStages { + /** The stage of the ConnectionMonitorResult 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConnectionMonitorResult refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConnectionMonitorResult refresh(Context context); + + /** + * Stops the specified connection monitor. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Stops the specified connection monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(Context context); + + /** + * Starts the specified connection monitor. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts the specified connection monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); + + /** + * Query a snapshot of the most recent connection states. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + ConnectionMonitorQueryResult query(); + + /** + * Query a snapshot of the most recent connection states. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + ConnectionMonitorQueryResult query(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResultProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResultProperties.java new file mode 100644 index 0000000000000..8fca280d2156d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResultProperties.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.time.OffsetDateTime; +import java.util.List; + +/** Describes the properties of a connection monitor. */ +@Fluent +public final class ConnectionMonitorResultProperties extends ConnectionMonitorParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorResultProperties.class); + + /* + * The provisioning state of the connection monitor. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The date and time when the connection monitor was started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The monitoring status of the connection monitor. + */ + @JsonProperty(value = "monitoringStatus", access = JsonProperty.Access.WRITE_ONLY) + private String monitoringStatus; + + /* + * Type of connection monitor. + */ + @JsonProperty(value = "connectionMonitorType", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionMonitorType connectionMonitorType; + + /** + * Get the provisioningState property: The provisioning state of the connection monitor. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the startTime property: The date and time when the connection monitor was started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the monitoringStatus property: The monitoring status of the connection monitor. + * + * @return the monitoringStatus value. + */ + public String monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Get the connectionMonitorType property: Type of connection monitor. + * + * @return the connectionMonitorType value. + */ + public ConnectionMonitorType connectionMonitorType() { + return this.connectionMonitorType; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withSource(ConnectionMonitorSource source) { + super.withSource(source); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withDestination(ConnectionMonitorDestination destination) { + super.withDestination(destination); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withAutoStart(Boolean autoStart) { + super.withAutoStart(autoStart); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + super.withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withEndpoints(List endpoints) { + super.withEndpoints(endpoints); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withTestConfigurations( + List testConfigurations) { + super.withTestConfigurations(testConfigurations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withTestGroups(List testGroups) { + super.withTestGroups(testGroups); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withOutputs(List outputs) { + super.withOutputs(outputs); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withNotes(String notes) { + super.withNotes(notes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSource.java new file mode 100644 index 0000000000000..18975f2297000 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSource.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.network.generated.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; + +/** Describes the source of connection monitor. */ +@Fluent +public final class ConnectionMonitorSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorSource.class); + + /* + * The ID of the resource used as the source by connection monitor. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * The source port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the resourceId property: The ID of the resource used as the source by connection monitor. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource used as the source by connection monitor. + * + * @param resourceId the resourceId value to set. + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the port property: The source port used by connection monitor. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The source port used by connection monitor. + * + * @param port the port value to set. + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceId in model ConnectionMonitorSource")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSourceStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSourceStatus.java new file mode 100644 index 0000000000000..9add73fa7ff58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSourceStatus.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorSourceStatus. */ +public final class ConnectionMonitorSourceStatus extends ExpandableStringEnum { + /** Static value Unknown for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Active for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus ACTIVE = fromString("Active"); + + /** Static value Inactive for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus INACTIVE = fromString("Inactive"); + + /** + * Creates or finds a ConnectionMonitorSourceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorSourceStatus. + */ + @JsonCreator + public static ConnectionMonitorSourceStatus fromString(String name) { + return fromString(name, ConnectionMonitorSourceStatus.class); + } + + /** @return known ConnectionMonitorSourceStatus values. */ + public static Collection values() { + return values(ConnectionMonitorSourceStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSuccessThreshold.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSuccessThreshold.java new file mode 100644 index 0000000000000..0228a0320d461 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSuccessThreshold.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.network.generated.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; + +/** Describes the threshold for declaring a test successful. */ +@Fluent +public final class ConnectionMonitorSuccessThreshold { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorSuccessThreshold.class); + + /* + * The maximum percentage of failed checks permitted for a test to evaluate + * as successful. + */ + @JsonProperty(value = "checksFailedPercent") + private Integer checksFailedPercent; + + /* + * The maximum round-trip time in milliseconds permitted for a test to + * evaluate as successful. + */ + @JsonProperty(value = "roundTripTimeMs") + private Float roundTripTimeMs; + + /** + * Get the checksFailedPercent property: The maximum percentage of failed checks permitted for a test to evaluate as + * successful. + * + * @return the checksFailedPercent value. + */ + public Integer checksFailedPercent() { + return this.checksFailedPercent; + } + + /** + * Set the checksFailedPercent property: The maximum percentage of failed checks permitted for a test to evaluate as + * successful. + * + * @param checksFailedPercent the checksFailedPercent value to set. + * @return the ConnectionMonitorSuccessThreshold object itself. + */ + public ConnectionMonitorSuccessThreshold withChecksFailedPercent(Integer checksFailedPercent) { + this.checksFailedPercent = checksFailedPercent; + return this; + } + + /** + * Get the roundTripTimeMs property: The maximum round-trip time in milliseconds permitted for a test to evaluate as + * successful. + * + * @return the roundTripTimeMs value. + */ + public Float roundTripTimeMs() { + return this.roundTripTimeMs; + } + + /** + * Set the roundTripTimeMs property: The maximum round-trip time in milliseconds permitted for a test to evaluate as + * successful. + * + * @param roundTripTimeMs the roundTripTimeMs value to set. + * @return the ConnectionMonitorSuccessThreshold object itself. + */ + public ConnectionMonitorSuccessThreshold withRoundTripTimeMs(Float roundTripTimeMs) { + this.roundTripTimeMs = roundTripTimeMs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTcpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTcpConfiguration.java new file mode 100644 index 0000000000000..f4b1db48e5f45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTcpConfiguration.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Describes the TCP configuration. */ +@Fluent +public final class ConnectionMonitorTcpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorTcpConfiguration.class); + + /* + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Value indicating whether path evaluation with trace route should be + * disabled. + */ + @JsonProperty(value = "disableTraceRoute") + private Boolean disableTraceRoute; + + /* + * Destination port behavior. + */ + @JsonProperty(value = "destinationPortBehavior") + private DestinationPortBehavior destinationPortBehavior; + + /** + * Get the port property: The port to connect to. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port to connect to. + * + * @param port the port value to set. + * @return the ConnectionMonitorTcpConfiguration object itself. + */ + public ConnectionMonitorTcpConfiguration withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the disableTraceRoute property: Value indicating whether path evaluation with trace route should be disabled. + * + * @return the disableTraceRoute value. + */ + public Boolean disableTraceRoute() { + return this.disableTraceRoute; + } + + /** + * Set the disableTraceRoute property: Value indicating whether path evaluation with trace route should be disabled. + * + * @param disableTraceRoute the disableTraceRoute value to set. + * @return the ConnectionMonitorTcpConfiguration object itself. + */ + public ConnectionMonitorTcpConfiguration withDisableTraceRoute(Boolean disableTraceRoute) { + this.disableTraceRoute = disableTraceRoute; + return this; + } + + /** + * Get the destinationPortBehavior property: Destination port behavior. + * + * @return the destinationPortBehavior value. + */ + public DestinationPortBehavior destinationPortBehavior() { + return this.destinationPortBehavior; + } + + /** + * Set the destinationPortBehavior property: Destination port behavior. + * + * @param destinationPortBehavior the destinationPortBehavior value to set. + * @return the ConnectionMonitorTcpConfiguration object itself. + */ + public ConnectionMonitorTcpConfiguration withDestinationPortBehavior( + DestinationPortBehavior destinationPortBehavior) { + this.destinationPortBehavior = destinationPortBehavior; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfiguration.java new file mode 100644 index 0000000000000..7828d6f1da15d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfiguration.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Describes a connection monitor test configuration. */ +@Fluent +public final class ConnectionMonitorTestConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorTestConfiguration.class); + + /* + * The name of the connection monitor test configuration. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The frequency of test evaluation, in seconds. + */ + @JsonProperty(value = "testFrequencySec") + private Integer testFrequencySec; + + /* + * The protocol to use in test evaluation. + */ + @JsonProperty(value = "protocol", required = true) + private ConnectionMonitorTestConfigurationProtocol protocol; + + /* + * The preferred IP version to use in test evaluation. The connection + * monitor may choose to use a different version depending on other + * parameters. + */ + @JsonProperty(value = "preferredIPVersion") + private PreferredIpVersion preferredIpVersion; + + /* + * The parameters used to perform test evaluation over HTTP. + */ + @JsonProperty(value = "httpConfiguration") + private ConnectionMonitorHttpConfiguration httpConfiguration; + + /* + * The parameters used to perform test evaluation over TCP. + */ + @JsonProperty(value = "tcpConfiguration") + private ConnectionMonitorTcpConfiguration tcpConfiguration; + + /* + * The parameters used to perform test evaluation over ICMP. + */ + @JsonProperty(value = "icmpConfiguration") + private ConnectionMonitorIcmpConfiguration icmpConfiguration; + + /* + * The threshold for declaring a test successful. + */ + @JsonProperty(value = "successThreshold") + private ConnectionMonitorSuccessThreshold successThreshold; + + /** + * Get the name property: The name of the connection monitor test configuration. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the connection monitor test configuration. + * + * @param name the name value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the testFrequencySec property: The frequency of test evaluation, in seconds. + * + * @return the testFrequencySec value. + */ + public Integer testFrequencySec() { + return this.testFrequencySec; + } + + /** + * Set the testFrequencySec property: The frequency of test evaluation, in seconds. + * + * @param testFrequencySec the testFrequencySec value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withTestFrequencySec(Integer testFrequencySec) { + this.testFrequencySec = testFrequencySec; + return this; + } + + /** + * Get the protocol property: The protocol to use in test evaluation. + * + * @return the protocol value. + */ + public ConnectionMonitorTestConfigurationProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol to use in test evaluation. + * + * @param protocol the protocol value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withProtocol(ConnectionMonitorTestConfigurationProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the preferredIpVersion property: The preferred IP version to use in test evaluation. The connection monitor + * may choose to use a different version depending on other parameters. + * + * @return the preferredIpVersion value. + */ + public PreferredIpVersion preferredIpVersion() { + return this.preferredIpVersion; + } + + /** + * Set the preferredIpVersion property: The preferred IP version to use in test evaluation. The connection monitor + * may choose to use a different version depending on other parameters. + * + * @param preferredIpVersion the preferredIpVersion value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withPreferredIpVersion(PreferredIpVersion preferredIpVersion) { + this.preferredIpVersion = preferredIpVersion; + return this; + } + + /** + * Get the httpConfiguration property: The parameters used to perform test evaluation over HTTP. + * + * @return the httpConfiguration value. + */ + public ConnectionMonitorHttpConfiguration httpConfiguration() { + return this.httpConfiguration; + } + + /** + * Set the httpConfiguration property: The parameters used to perform test evaluation over HTTP. + * + * @param httpConfiguration the httpConfiguration value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withHttpConfiguration( + ConnectionMonitorHttpConfiguration httpConfiguration) { + this.httpConfiguration = httpConfiguration; + return this; + } + + /** + * Get the tcpConfiguration property: The parameters used to perform test evaluation over TCP. + * + * @return the tcpConfiguration value. + */ + public ConnectionMonitorTcpConfiguration tcpConfiguration() { + return this.tcpConfiguration; + } + + /** + * Set the tcpConfiguration property: The parameters used to perform test evaluation over TCP. + * + * @param tcpConfiguration the tcpConfiguration value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withTcpConfiguration(ConnectionMonitorTcpConfiguration tcpConfiguration) { + this.tcpConfiguration = tcpConfiguration; + return this; + } + + /** + * Get the icmpConfiguration property: The parameters used to perform test evaluation over ICMP. + * + * @return the icmpConfiguration value. + */ + public ConnectionMonitorIcmpConfiguration icmpConfiguration() { + return this.icmpConfiguration; + } + + /** + * Set the icmpConfiguration property: The parameters used to perform test evaluation over ICMP. + * + * @param icmpConfiguration the icmpConfiguration value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withIcmpConfiguration( + ConnectionMonitorIcmpConfiguration icmpConfiguration) { + this.icmpConfiguration = icmpConfiguration; + return this; + } + + /** + * Get the successThreshold property: The threshold for declaring a test successful. + * + * @return the successThreshold value. + */ + public ConnectionMonitorSuccessThreshold successThreshold() { + return this.successThreshold; + } + + /** + * Set the successThreshold property: The threshold for declaring a test successful. + * + * @param successThreshold the successThreshold value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withSuccessThreshold(ConnectionMonitorSuccessThreshold successThreshold) { + this.successThreshold = successThreshold; + 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 ConnectionMonitorTestConfiguration")); + } + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model ConnectionMonitorTestConfiguration")); + } + if (httpConfiguration() != null) { + httpConfiguration().validate(); + } + if (tcpConfiguration() != null) { + tcpConfiguration().validate(); + } + if (icmpConfiguration() != null) { + icmpConfiguration().validate(); + } + if (successThreshold() != null) { + successThreshold().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfigurationProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfigurationProtocol.java new file mode 100644 index 0000000000000..fb42748df1278 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfigurationProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorTestConfigurationProtocol. */ +public final class ConnectionMonitorTestConfigurationProtocol + extends ExpandableStringEnum { + /** Static value Tcp for ConnectionMonitorTestConfigurationProtocol. */ + public static final ConnectionMonitorTestConfigurationProtocol TCP = fromString("Tcp"); + + /** Static value Http for ConnectionMonitorTestConfigurationProtocol. */ + public static final ConnectionMonitorTestConfigurationProtocol HTTP = fromString("Http"); + + /** Static value Icmp for ConnectionMonitorTestConfigurationProtocol. */ + public static final ConnectionMonitorTestConfigurationProtocol ICMP = fromString("Icmp"); + + /** + * Creates or finds a ConnectionMonitorTestConfigurationProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorTestConfigurationProtocol. + */ + @JsonCreator + public static ConnectionMonitorTestConfigurationProtocol fromString(String name) { + return fromString(name, ConnectionMonitorTestConfigurationProtocol.class); + } + + /** @return known ConnectionMonitorTestConfigurationProtocol values. */ + public static Collection values() { + return values(ConnectionMonitorTestConfigurationProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestGroup.java new file mode 100644 index 0000000000000..cbfc533d7b9ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestGroup.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Describes the connection monitor test group. */ +@Fluent +public final class ConnectionMonitorTestGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorTestGroup.class); + + /* + * The name of the connection monitor test group. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Value indicating whether test group is disabled. + */ + @JsonProperty(value = "disable") + private Boolean disable; + + /* + * List of test configuration names. + */ + @JsonProperty(value = "testConfigurations", required = true) + private List testConfigurations; + + /* + * List of source endpoint names. + */ + @JsonProperty(value = "sources", required = true) + private List sources; + + /* + * List of destination endpoint names. + */ + @JsonProperty(value = "destinations", required = true) + private List destinations; + + /** + * Get the name property: The name of the connection monitor test group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the connection monitor test group. + * + * @param name the name value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withName(String name) { + this.name = name; + return this; + } + + /** + * Get the disable property: Value indicating whether test group is disabled. + * + * @return the disable value. + */ + public Boolean disable() { + return this.disable; + } + + /** + * Set the disable property: Value indicating whether test group is disabled. + * + * @param disable the disable value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withDisable(Boolean disable) { + this.disable = disable; + return this; + } + + /** + * Get the testConfigurations property: List of test configuration names. + * + * @return the testConfigurations value. + */ + public List testConfigurations() { + return this.testConfigurations; + } + + /** + * Set the testConfigurations property: List of test configuration names. + * + * @param testConfigurations the testConfigurations value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withTestConfigurations(List testConfigurations) { + this.testConfigurations = testConfigurations; + return this; + } + + /** + * Get the sources property: List of source endpoint names. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Set the sources property: List of source endpoint names. + * + * @param sources the sources value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withSources(List sources) { + this.sources = sources; + return this; + } + + /** + * Get the destinations property: List of destination endpoint names. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: List of destination endpoint names. + * + * @param destinations the destinations value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withDestinations(List destinations) { + this.destinations = destinations; + 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 ConnectionMonitorTestGroup")); + } + if (testConfigurations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property testConfigurations in model ConnectionMonitorTestGroup")); + } + if (sources() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sources in model ConnectionMonitorTestGroup")); + } + if (destinations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinations in model ConnectionMonitorTestGroup")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorType.java new file mode 100644 index 0000000000000..20055a5a25a35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorType. */ +public final class ConnectionMonitorType extends ExpandableStringEnum { + /** Static value MultiEndpoint for ConnectionMonitorType. */ + public static final ConnectionMonitorType MULTI_ENDPOINT = fromString("MultiEndpoint"); + + /** Static value SingleSourceDestination for ConnectionMonitorType. */ + public static final ConnectionMonitorType SINGLE_SOURCE_DESTINATION = fromString("SingleSourceDestination"); + + /** + * Creates or finds a ConnectionMonitorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorType. + */ + @JsonCreator + public static ConnectionMonitorType fromString(String name) { + return fromString(name, ConnectionMonitorType.class); + } + + /** @return known ConnectionMonitorType values. */ + public static Collection values() { + return values(ConnectionMonitorType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorWorkspaceSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorWorkspaceSettings.java new file mode 100644 index 0000000000000..1387f63488f8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorWorkspaceSettings.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.network.generated.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; + +/** Describes the settings for producing output into a log analytics workspace. */ +@Fluent +public final class ConnectionMonitorWorkspaceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorWorkspaceSettings.class); + + /* + * Log analytics workspace resource ID. + */ + @JsonProperty(value = "workspaceResourceId") + private String workspaceResourceId; + + /** + * Get the workspaceResourceId property: Log analytics workspace resource ID. + * + * @return the workspaceResourceId value. + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set the workspaceResourceId property: Log analytics workspace resource ID. + * + * @param workspaceResourceId the workspaceResourceId value to set. + * @return the ConnectionMonitorWorkspaceSettings object itself. + */ + public ConnectionMonitorWorkspaceSettings withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitors.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitors.java new file mode 100644 index 0000000000000..a2301f10eeccc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitors.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 ConnectionMonitors. */ +public interface ConnectionMonitors { + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + ConnectionMonitorResult get(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + ConnectionMonitorQueryResult query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + ConnectionMonitorQueryResult query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); + + /** + * Gets a connection monitor by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + ConnectionMonitorResult getById(String id); + + /** + * Gets a connection monitor by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified connection monitor. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified connection monitor. + * + * @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 ConnectionMonitorResult resource. + * + * @param name resource name. + * @return the first stage of the new ConnectionMonitorResult definition. + */ + ConnectionMonitorResult.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionResetSharedKey.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionResetSharedKey.java new file mode 100644 index 0000000000000..ec3a252088bd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionResetSharedKey.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; + +/** An immutable client-side representation of ConnectionResetSharedKey. */ +public interface ConnectionResetSharedKey { + /** + * Gets the keyLength property: The virtual network connection reset shared key length, should between 1 and 128. + * + * @return the keyLength value. + */ + int keyLength(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner object. + * + * @return the inner object. + */ + ConnectionResetSharedKeyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKey.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKey.java new file mode 100644 index 0000000000000..40bc291b7d9d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKey.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; + +/** An immutable client-side representation of ConnectionSharedKey. */ +public interface ConnectionSharedKey { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the value property: The virtual network connection shared key value. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner object. + * + * @return the inner object. + */ + ConnectionSharedKeyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionState.java new file mode 100644 index 0000000000000..4d347a36260b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionState. */ +public final class ConnectionState extends ExpandableStringEnum { + /** Static value Reachable for ConnectionState. */ + public static final ConnectionState REACHABLE = fromString("Reachable"); + + /** Static value Unreachable for ConnectionState. */ + public static final ConnectionState UNREACHABLE = fromString("Unreachable"); + + /** Static value Unknown for ConnectionState. */ + public static final ConnectionState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ConnectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionState. + */ + @JsonCreator + public static ConnectionState fromString(String name) { + return fromString(name, ConnectionState.class); + } + + /** @return known ConnectionState values. */ + public static Collection values() { + return values(ConnectionState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStateSnapshot.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStateSnapshot.java new file mode 100644 index 0000000000000..d8a3f3599849b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStateSnapshot.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.network.generated.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.time.OffsetDateTime; +import java.util.List; + +/** Connection state snapshot. */ +@Fluent +public final class ConnectionStateSnapshot { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionStateSnapshot.class); + + /* + * The connection state. + */ + @JsonProperty(value = "connectionState") + private ConnectionState connectionState; + + /* + * The start time of the connection snapshot. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the connection snapshot. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Connectivity analysis evaluation state. + */ + @JsonProperty(value = "evaluationState") + private EvaluationState evaluationState; + + /* + * Average latency in ms. + */ + @JsonProperty(value = "avgLatencyInMs") + private Long avgLatencyInMs; + + /* + * Minimum latency in ms. + */ + @JsonProperty(value = "minLatencyInMs") + private Long minLatencyInMs; + + /* + * Maximum latency in ms. + */ + @JsonProperty(value = "maxLatencyInMs") + private Long maxLatencyInMs; + + /* + * The number of sent probes. + */ + @JsonProperty(value = "probesSent") + private Long probesSent; + + /* + * The number of failed probes. + */ + @JsonProperty(value = "probesFailed") + private Long probesFailed; + + /* + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * Get the connectionState property: The connection state. + * + * @return the connectionState value. + */ + public ConnectionState connectionState() { + return this.connectionState; + } + + /** + * Set the connectionState property: The connection state. + * + * @param connectionState the connectionState value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withConnectionState(ConnectionState connectionState) { + this.connectionState = connectionState; + return this; + } + + /** + * Get the startTime property: The start time of the connection snapshot. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the connection snapshot. + * + * @param startTime the startTime value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the connection snapshot. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the connection snapshot. + * + * @param endTime the endTime value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the evaluationState property: Connectivity analysis evaluation state. + * + * @return the evaluationState value. + */ + public EvaluationState evaluationState() { + return this.evaluationState; + } + + /** + * Set the evaluationState property: Connectivity analysis evaluation state. + * + * @param evaluationState the evaluationState value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEvaluationState(EvaluationState evaluationState) { + this.evaluationState = evaluationState; + return this; + } + + /** + * Get the avgLatencyInMs property: Average latency in ms. + * + * @return the avgLatencyInMs value. + */ + public Long avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Set the avgLatencyInMs property: Average latency in ms. + * + * @param avgLatencyInMs the avgLatencyInMs value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withAvgLatencyInMs(Long avgLatencyInMs) { + this.avgLatencyInMs = avgLatencyInMs; + return this; + } + + /** + * Get the minLatencyInMs property: Minimum latency in ms. + * + * @return the minLatencyInMs value. + */ + public Long minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Set the minLatencyInMs property: Minimum latency in ms. + * + * @param minLatencyInMs the minLatencyInMs value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMinLatencyInMs(Long minLatencyInMs) { + this.minLatencyInMs = minLatencyInMs; + return this; + } + + /** + * Get the maxLatencyInMs property: Maximum latency in ms. + * + * @return the maxLatencyInMs value. + */ + public Long maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Set the maxLatencyInMs property: Maximum latency in ms. + * + * @param maxLatencyInMs the maxLatencyInMs value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMaxLatencyInMs(Long maxLatencyInMs) { + this.maxLatencyInMs = maxLatencyInMs; + return this; + } + + /** + * Get the probesSent property: The number of sent probes. + * + * @return the probesSent value. + */ + public Long probesSent() { + return this.probesSent; + } + + /** + * Set the probesSent property: The number of sent probes. + * + * @param probesSent the probesSent value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesSent(Long probesSent) { + this.probesSent = probesSent; + return this; + } + + /** + * Get the probesFailed property: The number of failed probes. + * + * @return the probesFailed value. + */ + public Long probesFailed() { + return this.probesFailed; + } + + /** + * Set the probesFailed property: The number of failed probes. + * + * @param probesFailed the probesFailed value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesFailed(Long probesFailed) { + this.probesFailed = probesFailed; + return this; + } + + /** + * Get the hops property: List of hops between the source and the destination. + * + * @return the hops value. + */ + public List hops() { + return this.hops; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hops() != null) { + hops().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStatus.java new file mode 100644 index 0000000000000..e3ceb912bcaa6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStatus.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionStatus. */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for ConnectionStatus. */ + public static final ConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connected for ConnectionStatus. */ + public static final ConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Degraded for ConnectionStatus. */ + public static final ConnectionStatus DEGRADED = fromString("Degraded"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionStatus. + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** @return known ConnectionStatus values. */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityDestination.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityDestination.java new file mode 100644 index 0000000000000..bf4be0c4203c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityDestination.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.network.generated.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; + +/** Parameters that define destination of connection. */ +@Fluent +public final class ConnectivityDestination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityDestination.class); + + /* + * The ID of the resource to which a connection attempt will be made. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The IP address or URI the resource to which a connection attempt will be + * made. + */ + @JsonProperty(value = "address") + private String address; + + /* + * Port on which check connectivity will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the resourceId property: The ID of the resource to which a connection attempt will be made. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource to which a connection attempt will be made. + * + * @param resourceId the resourceId value to set. + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the address property: The IP address or URI the resource to which a connection attempt will be made. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: The IP address or URI the resource to which a connection attempt will be made. + * + * @param address the address value to set. + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the port property: Port on which check connectivity will be performed. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port on which check connectivity will be performed. + * + * @param port the port value to set. + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityHop.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityHop.java new file mode 100644 index 0000000000000..abf75fc421e42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityHop.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; +import java.util.List; + +/** Information about a hop between the source and the destination. */ +@Immutable +public final class ConnectivityHop { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityHop.class); + + /* + * The type of the hop. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The ID of the hop. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The IP address of the hop. + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /* + * The ID of the resource corresponding to this hop. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * List of next hop identifiers. + */ + @JsonProperty(value = "nextHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List nextHopIds; + + /* + * List of previous hop identifiers. + */ + @JsonProperty(value = "previousHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List previousHopIds; + + /* + * List of hop links. + */ + @JsonProperty(value = "links", access = JsonProperty.Access.WRITE_ONLY) + private List links; + + /* + * List of previous hop links. + */ + @JsonProperty(value = "previousLinks", access = JsonProperty.Access.WRITE_ONLY) + private List previousLinks; + + /* + * List of issues. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /** + * Get the type property: The type of the hop. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the id property: The ID of the hop. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the address property: The IP address of the hop. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Get the resourceId property: The ID of the resource corresponding to this hop. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the nextHopIds property: List of next hop identifiers. + * + * @return the nextHopIds value. + */ + public List nextHopIds() { + return this.nextHopIds; + } + + /** + * Get the previousHopIds property: List of previous hop identifiers. + * + * @return the previousHopIds value. + */ + public List previousHopIds() { + return this.previousHopIds; + } + + /** + * Get the links property: List of hop links. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Get the previousLinks property: List of previous hop links. + * + * @return the previousLinks value. + */ + public List previousLinks() { + return this.previousLinks; + } + + /** + * Get the issues property: List of issues. + * + * @return the issues value. + */ + public List issues() { + return this.issues; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (links() != null) { + links().forEach(e -> e.validate()); + } + if (previousLinks() != null) { + previousLinks().forEach(e -> e.validate()); + } + if (issues() != null) { + issues().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java new file mode 100644 index 0000000000000..a171e7acede86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import java.util.List; + +/** An immutable client-side representation of ConnectivityInformation. */ +public interface ConnectivityInformation { + /** + * Gets the hops property: List of hops between the source and the destination. + * + * @return the hops value. + */ + List hops(); + + /** + * Gets the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + ConnectionStatus connectionStatus(); + + /** + * Gets the avgLatencyInMs property: Average latency in milliseconds. + * + * @return the avgLatencyInMs value. + */ + Integer avgLatencyInMs(); + + /** + * Gets the minLatencyInMs property: Minimum latency in milliseconds. + * + * @return the minLatencyInMs value. + */ + Integer minLatencyInMs(); + + /** + * Gets the maxLatencyInMs property: Maximum latency in milliseconds. + * + * @return the maxLatencyInMs value. + */ + Integer maxLatencyInMs(); + + /** + * Gets the probesSent property: Total number of probes sent. + * + * @return the probesSent value. + */ + Integer probesSent(); + + /** + * Gets the probesFailed property: Number of failed probes. + * + * @return the probesFailed value. + */ + Integer probesFailed(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner object. + * + * @return the inner object. + */ + ConnectivityInformationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java new file mode 100644 index 0000000000000..aa616df6a4449 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; +import java.util.List; +import java.util.Map; + +/** Information about an issue encountered in the process of checking for connectivity. */ +@Immutable +public final class ConnectivityIssue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityIssue.class); + + /* + * The origin of the issue. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * The severity of the issue. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private Severity severity; + + /* + * The type of issue. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private IssueType type; + + /* + * Provides additional context on the issue. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + private List> context; + + /** + * Get the origin property: The origin of the issue. + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the severity property: The severity of the issue. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the type property: The type of issue. + * + * @return the type value. + */ + public IssueType type() { + return this.type; + } + + /** + * Get the context property: Provides additional context on the issue. + * + * @return the context value. + */ + public List> context() { + return this.context; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityParameters.java new file mode 100644 index 0000000000000..f4271cbda6e36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityParameters.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters that determine how the connectivity check will be performed. */ +@Fluent +public final class ConnectivityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityParameters.class); + + /* + * The source of the connection. + */ + @JsonProperty(value = "source", required = true) + private ConnectivitySource source; + + /* + * The destination of connection. + */ + @JsonProperty(value = "destination", required = true) + private ConnectivityDestination destination; + + /* + * Network protocol. + */ + @JsonProperty(value = "protocol") + private Protocol protocol; + + /* + * Configuration of the protocol. + */ + @JsonProperty(value = "protocolConfiguration") + private ProtocolConfiguration protocolConfiguration; + + /* + * Preferred IP version of the connection. + */ + @JsonProperty(value = "preferredIPVersion") + private IpVersion preferredIpVersion; + + /** + * Get the source property: The source of the connection. + * + * @return the source value. + */ + public ConnectivitySource source() { + return this.source; + } + + /** + * Set the source property: The source of the connection. + * + * @param source the source value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withSource(ConnectivitySource source) { + this.source = source; + return this; + } + + /** + * Get the destination property: The destination of connection. + * + * @return the destination value. + */ + public ConnectivityDestination destination() { + return this.destination; + } + + /** + * Set the destination property: The destination of connection. + * + * @param destination the destination value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withDestination(ConnectivityDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the protocol property: Network protocol. + * + * @return the protocol value. + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Network protocol. + * + * @param protocol the protocol value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the protocolConfiguration property: Configuration of the protocol. + * + * @return the protocolConfiguration value. + */ + public ProtocolConfiguration protocolConfiguration() { + return this.protocolConfiguration; + } + + /** + * Set the protocolConfiguration property: Configuration of the protocol. + * + * @param protocolConfiguration the protocolConfiguration value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocolConfiguration(ProtocolConfiguration protocolConfiguration) { + this.protocolConfiguration = protocolConfiguration; + return this; + } + + /** + * Get the preferredIpVersion property: Preferred IP version of the connection. + * + * @return the preferredIpVersion value. + */ + public IpVersion preferredIpVersion() { + return this.preferredIpVersion; + } + + /** + * Set the preferredIpVersion property: Preferred IP version of the connection. + * + * @param preferredIpVersion the preferredIpVersion value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withPreferredIpVersion(IpVersion preferredIpVersion) { + this.preferredIpVersion = preferredIpVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property source in model ConnectivityParameters")); + } else { + source().validate(); + } + if (destination() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destination in model ConnectivityParameters")); + } else { + destination().validate(); + } + if (protocolConfiguration() != null) { + protocolConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivitySource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivitySource.java new file mode 100644 index 0000000000000..a558c44b345ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivitySource.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.network.generated.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; + +/** Parameters that define the source of the connection. */ +@Fluent +public final class ConnectivitySource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivitySource.class); + + /* + * The ID of the resource from which a connectivity check will be + * initiated. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * The source port from which a connectivity check will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the resourceId property: The ID of the resource from which a connectivity check will be initiated. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource from which a connectivity check will be initiated. + * + * @param resourceId the resourceId value to set. + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the port property: The source port from which a connectivity check will be performed. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The source port from which a connectivity check will be performed. + * + * @param port the port value to set. + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceId in model ConnectivitySource")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Container.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Container.java new file mode 100644 index 0000000000000..e3a0c5129e8a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Container.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Reference to container resource in remote resource provider. */ +@Fluent +public final class Container extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Container.class); + + /** {@inheritDoc} */ + @Override + public Container withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterface.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterface.java new file mode 100644 index 0000000000000..50c6f85370706 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterface.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container network interface child resource. */ +@JsonFlatten +@Fluent +public class ContainerNetworkInterface extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterface.class); + + /* + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Container network interface configuration from which this container + * network interface is created. + */ + @JsonProperty(value = "properties.containerNetworkInterfaceConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration; + + /* + * Reference to the container to which this container network interface is + * attached. + */ + @JsonProperty(value = "properties.container") + private Container container; + + /* + * Reference to the ip configuration on this container nic. + */ + @JsonProperty(value = "properties.ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /* + * The provisioning state of the container network interface resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Sub Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the containerNetworkInterfaceConfiguration property: Container network interface configuration from which + * this container network interface is created. + * + * @return the containerNetworkInterfaceConfiguration value. + */ + public ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration() { + return this.containerNetworkInterfaceConfiguration; + } + + /** + * Get the container property: Reference to the container to which this container network interface is attached. + * + * @return the container value. + */ + public Container container() { + return this.container; + } + + /** + * Set the container property: Reference to the container to which this container network interface is attached. + * + * @param container the container value to set. + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withContainer(Container container) { + this.container = container; + return this; + } + + /** + * Get the ipConfigurations property: Reference to the ip configuration on this container nic. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Get the provisioningState property: The provisioning state of the container network interface resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ContainerNetworkInterface withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containerNetworkInterfaceConfiguration() != null) { + containerNetworkInterfaceConfiguration().validate(); + } + if (container() != null) { + container().validate(); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceConfiguration.java new file mode 100644 index 0000000000000..cdd4676f13b57 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceConfiguration.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container network interface configuration child resource. */ +@JsonFlatten +@Fluent +public class ContainerNetworkInterfaceConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfaceConfiguration.class); + + /* + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of ip configurations of the container network interface + * configuration. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * A list of container network interfaces created from this container + * network interface configuration. + */ + @JsonProperty(value = "properties.containerNetworkInterfaces") + private List containerNetworkInterfaces; + + /* + * The provisioning state of the container network interface configuration + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Sub Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the ipConfigurations property: A list of ip configurations of the container network interface configuration. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: A list of ip configurations of the container network interface configuration. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withIpConfigurations( + List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the containerNetworkInterfaces property: A list of container network interfaces created from this container + * network interface configuration. + * + * @return the containerNetworkInterfaces value. + */ + public List containerNetworkInterfaces() { + return this.containerNetworkInterfaces; + } + + /** + * Set the containerNetworkInterfaces property: A list of container network interfaces created from this container + * network interface configuration. + * + * @param containerNetworkInterfaces the containerNetworkInterfaces value to set. + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withContainerNetworkInterfaces( + List containerNetworkInterfaces) { + this.containerNetworkInterfaces = containerNetworkInterfaces; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the container network interface configuration + * resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ContainerNetworkInterfaceConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceIpConfiguration.java new file mode 100644 index 0000000000000..251f9c232d953 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceIpConfiguration.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** The ip configuration for a container network interface. */ +@JsonFlatten +@Fluent +public class ContainerNetworkInterfaceIpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfaceIpConfiguration.class); + + /* + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The provisioning state of the container network interface IP + * configuration resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the ContainerNetworkInterfaceIpConfiguration object itself. + */ + public ContainerNetworkInterfaceIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Sub Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioningState property: The provisioning state of the container network interface IP configuration + * resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CoverageLevel.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CoverageLevel.java new file mode 100644 index 0000000000000..5de999e76223b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CoverageLevel.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CoverageLevel. */ +public final class CoverageLevel extends ExpandableStringEnum { + /** Static value Default for CoverageLevel. */ + public static final CoverageLevel DEFAULT = fromString("Default"); + + /** Static value Low for CoverageLevel. */ + public static final CoverageLevel LOW = fromString("Low"); + + /** Static value BelowAverage for CoverageLevel. */ + public static final CoverageLevel BELOW_AVERAGE = fromString("BelowAverage"); + + /** Static value Average for CoverageLevel. */ + public static final CoverageLevel AVERAGE = fromString("Average"); + + /** Static value AboveAverage for CoverageLevel. */ + public static final CoverageLevel ABOVE_AVERAGE = fromString("AboveAverage"); + + /** Static value Full for CoverageLevel. */ + public static final CoverageLevel FULL = fromString("Full"); + + /** + * Creates or finds a CoverageLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding CoverageLevel. + */ + @JsonCreator + public static CoverageLevel fromString(String name) { + return fromString(name, CoverageLevel.class); + } + + /** @return known CoverageLevel values. */ + public static Collection values() { + return values(CoverageLevel.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomDnsConfigPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomDnsConfigPropertiesFormat.java new file mode 100644 index 0000000000000..d916343af0c7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomDnsConfigPropertiesFormat.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.network.generated.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; + +/** Contains custom Dns resolution configuration from customer. */ +@Fluent +public final class CustomDnsConfigPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDnsConfigPropertiesFormat.class); + + /* + * Fqdn that resolves to private endpoint ip address. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * A list of private ip addresses of the private endpoint. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /** + * Get the fqdn property: Fqdn that resolves to private endpoint ip address. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Fqdn that resolves to private endpoint ip address. + * + * @param fqdn the fqdn value to set. + * @return the CustomDnsConfigPropertiesFormat object itself. + */ + public CustomDnsConfigPropertiesFormat withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the ipAddresses property: A list of private ip addresses of the private endpoint. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set the ipAddresses property: A list of private ip addresses of the private endpoint. + * + * @param ipAddresses the ipAddresses value to set. + * @return the CustomDnsConfigPropertiesFormat object itself. + */ + public CustomDnsConfigPropertiesFormat withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefix.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefix.java new file mode 100644 index 0000000000000..ecc1dbcad2ff0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefix.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CustomIpPrefix. */ +public interface CustomIpPrefix { + /** + * 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 extendedLocation property: The extended location of the custom IP prefix. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the cidr property: The prefix range in CIDR notation. Should include the start address and the prefix + * length. + * + * @return the cidr value. + */ + String cidr(); + + /** + * Gets the signedMessage property: Signed message for WAN validation. + * + * @return the signedMessage value. + */ + String signedMessage(); + + /** + * Gets the authorizationMessage property: Authorization message for WAN validation. + * + * @return the authorizationMessage value. + */ + String authorizationMessage(); + + /** + * Gets the customIpPrefixParent property: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + * + * @return the customIpPrefixParent value. + */ + CustomIpPrefix customIpPrefixParent(); + + /** + * Gets the childCustomIpPrefixes property: The list of all Children for IPv6 /48 CustomIpPrefix. + * + * @return the childCustomIpPrefixes value. + */ + List childCustomIpPrefixes(); + + /** + * Gets the commissionedState property: The commissioned state of the Custom IP Prefix. + * + * @return the commissionedState value. + */ + CommissionedState commissionedState(); + + /** + * Gets the publicIpPrefixes property: The list of all referenced PublicIpPrefixes. + * + * @return the publicIpPrefixes value. + */ + List publicIpPrefixes(); + + /** + * Gets the resourceGuid property: The resource GUID property of the custom IP prefix resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the failedReason property: The reason why resource is in failed state. + * + * @return the failedReason value. + */ + String failedReason(); + + /** + * Gets the provisioningState property: The provisioning state of the custom IP prefix resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.CustomIpPrefixInner object. + * + * @return the inner object. + */ + CustomIpPrefixInner innerModel(); + + /** The entirety of the CustomIpPrefix definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The CustomIpPrefix definition stages. */ + interface DefinitionStages { + /** The first stage of the CustomIpPrefix definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CustomIpPrefix 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 CustomIpPrefix definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the CustomIpPrefix 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.WithExtendedLocation, + DefinitionStages.WithZones, + DefinitionStages.WithCidr, + DefinitionStages.WithSignedMessage, + DefinitionStages.WithAuthorizationMessage, + DefinitionStages.WithCustomIpPrefixParent, + DefinitionStages.WithCommissionedState { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomIpPrefix create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomIpPrefix create(Context context); + } + /** The stage of the CustomIpPrefix 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 CustomIpPrefix definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the custom IP prefix.. + * + * @param extendedLocation The extended location of the custom IP prefix. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the CustomIpPrefix definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting the IP allocated for the resource + * needs to come from.. + * + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the CustomIpPrefix definition allowing to specify cidr. */ + interface WithCidr { + /** + * Specifies the cidr property: The prefix range in CIDR notation. Should include the start address and the + * prefix length.. + * + * @param cidr The prefix range in CIDR notation. Should include the start address and the prefix length. + * @return the next definition stage. + */ + WithCreate withCidr(String cidr); + } + /** The stage of the CustomIpPrefix definition allowing to specify signedMessage. */ + interface WithSignedMessage { + /** + * Specifies the signedMessage property: Signed message for WAN validation.. + * + * @param signedMessage Signed message for WAN validation. + * @return the next definition stage. + */ + WithCreate withSignedMessage(String signedMessage); + } + /** The stage of the CustomIpPrefix definition allowing to specify authorizationMessage. */ + interface WithAuthorizationMessage { + /** + * Specifies the authorizationMessage property: Authorization message for WAN validation.. + * + * @param authorizationMessage Authorization message for WAN validation. + * @return the next definition stage. + */ + WithCreate withAuthorizationMessage(String authorizationMessage); + } + /** The stage of the CustomIpPrefix definition allowing to specify customIpPrefixParent. */ + interface WithCustomIpPrefixParent { + /** + * Specifies the customIpPrefixParent property: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix.. + * + * @param customIpPrefixParent The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + * @return the next definition stage. + */ + WithCreate withCustomIpPrefixParent(CustomIpPrefixInner customIpPrefixParent); + } + /** The stage of the CustomIpPrefix definition allowing to specify commissionedState. */ + interface WithCommissionedState { + /** + * Specifies the commissionedState property: The commissioned state of the Custom IP Prefix.. + * + * @param commissionedState The commissioned state of the Custom IP Prefix. + * @return the next definition stage. + */ + WithCreate withCommissionedState(CommissionedState commissionedState); + } + } + /** + * Begins update for the CustomIpPrefix resource. + * + * @return the stage of resource update. + */ + CustomIpPrefix.Update update(); + + /** The template for CustomIpPrefix update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CustomIpPrefix apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CustomIpPrefix apply(Context context); + } + /** The CustomIpPrefix update stages. */ + interface UpdateStages { + /** The stage of the CustomIpPrefix 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomIpPrefix refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomIpPrefix refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixListResult.java new file mode 100644 index 0000000000000..972681b5e3de6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListCustomIpPrefixes API service call. */ +@Fluent +public final class CustomIpPrefixListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomIpPrefixListResult.class); + + /* + * A list of Custom IP prefixes that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of Custom IP prefixes that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Custom IP prefixes that exists in a resource group. + * + * @param value the value value to set. + * @return the CustomIpPrefixListResult object itself. + */ + public CustomIpPrefixListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the CustomIpPrefixListResult object itself. + */ + public CustomIpPrefixListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixes.java new file mode 100644 index 0000000000000..b93824dc0a04c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixes.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 CustomIpPrefixes. */ +public interface CustomIpPrefixes { + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 customIpPrefixName); + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 customIpPrefixName, Context context); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + CustomIpPrefix getByResourceGroup(String resourceGroupName, String customIpPrefixName); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String customIpPrefixName, String expand, Context context); + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the custom IP prefixes 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 all the custom IP prefixes in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all custom IP prefixes in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @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 the specified custom IP prefix in a specified resource group. + */ + CustomIpPrefix getById(String id); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified custom IP prefix. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified custom IP prefix. + * + * @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 CustomIpPrefix resource. + * + * @param name resource name. + * @return the first stage of the new CustomIpPrefix definition. + */ + CustomIpPrefix.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicies.java new file mode 100644 index 0000000000000..156383f7e9c4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicies.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DdosCustomPolicies. */ +public interface DdosCustomPolicies { + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ddosCustomPolicyName); + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ddosCustomPolicyName, Context context); + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + DdosCustomPolicy getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName); + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosCustomPolicyName, Context context); + + /** + * Gets information about the specified DDoS custom policy. + * + * @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 information about the specified DDoS custom policy. + */ + DdosCustomPolicy getById(String id); + + /** + * Gets information about the specified DDoS custom policy. + * + * @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 information about the specified DDoS custom policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified DDoS custom policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified DDoS custom policy. + * + * @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 DdosCustomPolicy resource. + * + * @param name resource name. + * @return the first stage of the new DdosCustomPolicy definition. + */ + DdosCustomPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicy.java new file mode 100644 index 0000000000000..c0ef8dc954673 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicy.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DdosCustomPolicy. */ +public interface DdosCustomPolicy { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the resourceGuid property: The resource GUID property of the DDoS custom policy resource. It uniquely + * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or + * resource groups. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the DDoS custom policy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the publicIpAddresses property: The list of public IPs associated with the DDoS custom policy resource. This + * list is read-only. + * + * @return the publicIpAddresses value. + */ + List publicIpAddresses(); + + /** + * Gets the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. + * + * @return the protocolCustomSettings value. + */ + List protocolCustomSettings(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.DdosCustomPolicyInner object. + * + * @return the inner object. + */ + DdosCustomPolicyInner innerModel(); + + /** The entirety of the DdosCustomPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DdosCustomPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the DdosCustomPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DdosCustomPolicy 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 DdosCustomPolicy definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DdosCustomPolicy 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.WithProtocolCustomSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + DdosCustomPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DdosCustomPolicy create(Context context); + } + /** The stage of the DdosCustomPolicy 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 DdosCustomPolicy definition allowing to specify protocolCustomSettings. */ + interface WithProtocolCustomSettings { + /** + * Specifies the protocolCustomSettings property: The protocol-specific DDoS policy customization + * parameters.. + * + * @param protocolCustomSettings The protocol-specific DDoS policy customization parameters. + * @return the next definition stage. + */ + WithCreate withProtocolCustomSettings(List protocolCustomSettings); + } + } + /** + * Begins update for the DdosCustomPolicy resource. + * + * @return the stage of resource update. + */ + DdosCustomPolicy.Update update(); + + /** The template for DdosCustomPolicy update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DdosCustomPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DdosCustomPolicy apply(Context context); + } + /** The DdosCustomPolicy update stages. */ + interface UpdateStages { + /** The stage of the DdosCustomPolicy 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DdosCustomPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DdosCustomPolicy refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyProtocol.java new file mode 100644 index 0000000000000..dc5ba57706efc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DdosCustomPolicyProtocol. */ +public final class DdosCustomPolicyProtocol extends ExpandableStringEnum { + /** Static value Tcp for DdosCustomPolicyProtocol. */ + public static final DdosCustomPolicyProtocol TCP = fromString("Tcp"); + + /** Static value Udp for DdosCustomPolicyProtocol. */ + public static final DdosCustomPolicyProtocol UDP = fromString("Udp"); + + /** Static value Syn for DdosCustomPolicyProtocol. */ + public static final DdosCustomPolicyProtocol SYN = fromString("Syn"); + + /** + * Creates or finds a DdosCustomPolicyProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding DdosCustomPolicyProtocol. + */ + @JsonCreator + public static DdosCustomPolicyProtocol fromString(String name) { + return fromString(name, DdosCustomPolicyProtocol.class); + } + + /** @return known DdosCustomPolicyProtocol values. */ + public static Collection values() { + return values(DdosCustomPolicyProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyTriggerSensitivityOverride.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyTriggerSensitivityOverride.java new file mode 100644 index 0000000000000..d44a2c216d722 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyTriggerSensitivityOverride.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DdosCustomPolicyTriggerSensitivityOverride. */ +public final class DdosCustomPolicyTriggerSensitivityOverride + extends ExpandableStringEnum { + /** Static value Relaxed for DdosCustomPolicyTriggerSensitivityOverride. */ + public static final DdosCustomPolicyTriggerSensitivityOverride RELAXED = fromString("Relaxed"); + + /** Static value Low for DdosCustomPolicyTriggerSensitivityOverride. */ + public static final DdosCustomPolicyTriggerSensitivityOverride LOW = fromString("Low"); + + /** Static value Default for DdosCustomPolicyTriggerSensitivityOverride. */ + public static final DdosCustomPolicyTriggerSensitivityOverride DEFAULT = fromString("Default"); + + /** Static value High for DdosCustomPolicyTriggerSensitivityOverride. */ + public static final DdosCustomPolicyTriggerSensitivityOverride HIGH = fromString("High"); + + /** + * Creates or finds a DdosCustomPolicyTriggerSensitivityOverride from its string representation. + * + * @param name a name to look for. + * @return the corresponding DdosCustomPolicyTriggerSensitivityOverride. + */ + @JsonCreator + public static DdosCustomPolicyTriggerSensitivityOverride fromString(String name) { + return fromString(name, DdosCustomPolicyTriggerSensitivityOverride.class); + } + + /** @return known DdosCustomPolicyTriggerSensitivityOverride values. */ + public static Collection values() { + return values(DdosCustomPolicyTriggerSensitivityOverride.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlan.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlan.java new file mode 100644 index 0000000000000..0c90a203da0de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlan.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DdosProtectionPlan. */ +public interface DdosProtectionPlan { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the resourceGuid property: The resource GUID property of the DDoS protection plan resource. It uniquely + * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or + * resource groups. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the DDoS protection plan resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the virtualNetworks property: The list of virtual networks associated with the DDoS protection plan + * resource. This list is read-only. + * + * @return the virtualNetworks value. + */ + List virtualNetworks(); + + /** + * 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.network.generated.fluent.models.DdosProtectionPlanInner object. + * + * @return the inner object. + */ + DdosProtectionPlanInner innerModel(); + + /** The entirety of the DdosProtectionPlan definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DdosProtectionPlan definition stages. */ + interface DefinitionStages { + /** The first stage of the DdosProtectionPlan definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DdosProtectionPlan 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 DdosProtectionPlan definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DdosProtectionPlan 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + DdosProtectionPlan create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DdosProtectionPlan create(Context context); + } + /** The stage of the DdosProtectionPlan 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); + } + } + /** + * Begins update for the DdosProtectionPlan resource. + * + * @return the stage of resource update. + */ + DdosProtectionPlan.Update update(); + + /** The template for DdosProtectionPlan update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DdosProtectionPlan apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DdosProtectionPlan apply(Context context); + } + /** The DdosProtectionPlan update stages. */ + interface UpdateStages { + /** The stage of the DdosProtectionPlan 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DdosProtectionPlan refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DdosProtectionPlan refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlanListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlanListResult.java new file mode 100644 index 0000000000000..cf0c7ee326c49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlanListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of DDoS protection plans. */ +@Fluent +public final class DdosProtectionPlanListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlanListResult.class); + + /* + * A list of DDoS protection plans. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of DDoS protection plans. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of DDoS protection plans. + * + * @param value the value value to set. + * @return the DdosProtectionPlanListResult object itself. + */ + public DdosProtectionPlanListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlans.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlans.java new file mode 100644 index 0000000000000..4df99c64241c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlans.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 DdosProtectionPlans. */ +public interface DdosProtectionPlans { + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ddosProtectionPlanName); + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ddosProtectionPlanName, Context context); + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + DdosProtectionPlan getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName); + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosProtectionPlanName, Context context); + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + PagedIterable list(); + + /** + * Gets all DDoS protection plans 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 all DDoS protection plans in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the DDoS protection plans in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified DDoS protection plan. + * + * @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 information about the specified DDoS protection plan. + */ + DdosProtectionPlan getById(String id); + + /** + * Gets information about the specified DDoS protection plan. + * + * @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 information about the specified DDoS protection plan. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified DDoS protection plan. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified DDoS protection plan. + * + * @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 DdosProtectionPlan resource. + * + * @param name resource name. + * @return the first stage of the new DdosProtectionPlan definition. + */ + DdosProtectionPlan.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettings.java new file mode 100644 index 0000000000000..94d6bb30ffff5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettings.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the DDoS protection settings of the public IP. */ +@Fluent +public final class DdosSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosSettings.class); + + /* + * The DDoS custom policy associated with the public IP. + */ + @JsonProperty(value = "ddosCustomPolicy") + private SubResource ddosCustomPolicy; + + /* + * The DDoS protection policy customizability of the public IP. Only + * standard coverage will have the ability to be customized. + */ + @JsonProperty(value = "protectionCoverage") + private DdosSettingsProtectionCoverage protectionCoverage; + + /* + * Enables DDoS protection on the public IP. + */ + @JsonProperty(value = "protectedIP") + private Boolean protectedIp; + + /** + * Get the ddosCustomPolicy property: The DDoS custom policy associated with the public IP. + * + * @return the ddosCustomPolicy value. + */ + public SubResource ddosCustomPolicy() { + return this.ddosCustomPolicy; + } + + /** + * Set the ddosCustomPolicy property: The DDoS custom policy associated with the public IP. + * + * @param ddosCustomPolicy the ddosCustomPolicy value to set. + * @return the DdosSettings object itself. + */ + public DdosSettings withDdosCustomPolicy(SubResource ddosCustomPolicy) { + this.ddosCustomPolicy = ddosCustomPolicy; + return this; + } + + /** + * Get the protectionCoverage property: The DDoS protection policy customizability of the public IP. Only standard + * coverage will have the ability to be customized. + * + * @return the protectionCoverage value. + */ + public DdosSettingsProtectionCoverage protectionCoverage() { + return this.protectionCoverage; + } + + /** + * Set the protectionCoverage property: The DDoS protection policy customizability of the public IP. Only standard + * coverage will have the ability to be customized. + * + * @param protectionCoverage the protectionCoverage value to set. + * @return the DdosSettings object itself. + */ + public DdosSettings withProtectionCoverage(DdosSettingsProtectionCoverage protectionCoverage) { + this.protectionCoverage = protectionCoverage; + return this; + } + + /** + * Get the protectedIp property: Enables DDoS protection on the public IP. + * + * @return the protectedIp value. + */ + public Boolean protectedIp() { + return this.protectedIp; + } + + /** + * Set the protectedIp property: Enables DDoS protection on the public IP. + * + * @param protectedIp the protectedIp value to set. + * @return the DdosSettings object itself. + */ + public DdosSettings withProtectedIp(Boolean protectedIp) { + this.protectedIp = protectedIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionCoverage.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionCoverage.java new file mode 100644 index 0000000000000..cbebb705ecba8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionCoverage.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DdosSettingsProtectionCoverage. */ +public final class DdosSettingsProtectionCoverage extends ExpandableStringEnum { + /** Static value Basic for DdosSettingsProtectionCoverage. */ + public static final DdosSettingsProtectionCoverage BASIC = fromString("Basic"); + + /** Static value Standard for DdosSettingsProtectionCoverage. */ + public static final DdosSettingsProtectionCoverage STANDARD = fromString("Standard"); + + /** + * Creates or finds a DdosSettingsProtectionCoverage from its string representation. + * + * @param name a name to look for. + * @return the corresponding DdosSettingsProtectionCoverage. + */ + @JsonCreator + public static DdosSettingsProtectionCoverage fromString(String name) { + return fromString(name, DdosSettingsProtectionCoverage.class); + } + + /** @return known DdosSettingsProtectionCoverage values. */ + public static Collection values() { + return values(DdosSettingsProtectionCoverage.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultSecurityRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultSecurityRules.java new file mode 100644 index 0000000000000..fbc102d16eb8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultSecurityRules.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.network.generated.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 DefaultSecurityRules. */ +public interface DefaultSecurityRules { + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + PagedIterable list(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all default security rules in a network security group. + */ + PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + SecurityRule get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Delegation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Delegation.java new file mode 100644 index 0000000000000..ffeb3061be944 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Delegation.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details the service to which the subnet is delegated. */ +@JsonFlatten +@Fluent +public class Delegation extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Delegation.class); + + /* + * The name of the resource that is unique within a subnet. This name can + * be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The name of the service to whom the subnet should be delegated (e.g. + * Microsoft.Sql/servers). + */ + @JsonProperty(value = "properties.serviceName") + private String serviceName; + + /* + * The actions permitted to the service upon delegation. + */ + @JsonProperty(value = "properties.actions", access = JsonProperty.Access.WRITE_ONLY) + private List actions; + + /* + * The provisioning state of the service delegation resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a subnet. This name can be used to access + * the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a subnet. This name can be used to access + * the resource. + * + * @param name the name value to set. + * @return the Delegation object itself. + */ + public Delegation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. + * + * @param type the type value to set. + * @return the Delegation object itself. + */ + public Delegation withType(String type) { + this.type = type; + return this; + } + + /** + * Get the serviceName property: The name of the service to whom the subnet should be delegated (e.g. + * Microsoft.Sql/servers). + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the service to whom the subnet should be delegated (e.g. + * Microsoft.Sql/servers). + * + * @param serviceName the serviceName value to set. + * @return the Delegation object itself. + */ + public Delegation withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the actions property: The actions permitted to the service upon delegation. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Get the provisioningState property: The provisioning state of the service delegation resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public Delegation withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteOptions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteOptions.java new file mode 100644 index 0000000000000..02069df654c73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteOptions.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeleteOptions. */ +public final class DeleteOptions extends ExpandableStringEnum { + /** Static value Delete for DeleteOptions. */ + public static final DeleteOptions DELETE = fromString("Delete"); + + /** Static value Detach for DeleteOptions. */ + public static final DeleteOptions DETACH = fromString("Detach"); + + /** + * Creates or finds a DeleteOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteOptions. + */ + @JsonCreator + public static DeleteOptions fromString(String name) { + return fromString(name, DeleteOptions.class); + } + + /** @return known DeleteOptions values. */ + public static Collection values() { + return values(DeleteOptions.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DestinationPortBehavior.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DestinationPortBehavior.java new file mode 100644 index 0000000000000..92b7e1e5cc1d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DestinationPortBehavior.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DestinationPortBehavior. */ +public final class DestinationPortBehavior extends ExpandableStringEnum { + /** Static value None for DestinationPortBehavior. */ + public static final DestinationPortBehavior NONE = fromString("None"); + + /** Static value ListenIfAvailable for DestinationPortBehavior. */ + public static final DestinationPortBehavior LISTEN_IF_AVAILABLE = fromString("ListenIfAvailable"); + + /** + * Creates or finds a DestinationPortBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding DestinationPortBehavior. + */ + @JsonCreator + public static DestinationPortBehavior fromString(String name) { + return fromString(name, DestinationPortBehavior.class); + } + + /** @return known DestinationPortBehavior values. */ + public static Collection values() { + return values(DestinationPortBehavior.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeviceProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeviceProperties.java new file mode 100644 index 0000000000000..ee486433f3918 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeviceProperties.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.network.generated.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; + +/** List of properties of the device. */ +@Fluent +public final class DeviceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceProperties.class); + + /* + * Name of the device Vendor. + */ + @JsonProperty(value = "deviceVendor") + private String deviceVendor; + + /* + * Model of the device. + */ + @JsonProperty(value = "deviceModel") + private String deviceModel; + + /* + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + private Integer linkSpeedInMbps; + + /** + * Get the deviceVendor property: Name of the device Vendor. + * + * @return the deviceVendor value. + */ + public String deviceVendor() { + return this.deviceVendor; + } + + /** + * Set the deviceVendor property: Name of the device Vendor. + * + * @param deviceVendor the deviceVendor value to set. + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceVendor(String deviceVendor) { + this.deviceVendor = deviceVendor; + return this; + } + + /** + * Get the deviceModel property: Model of the device. + * + * @return the deviceModel value. + */ + public String deviceModel() { + return this.deviceModel; + } + + /** + * Set the deviceModel property: Model of the device. + * + * @param deviceModel the deviceModel value to set. + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceModel(String deviceModel) { + this.deviceModel = deviceModel; + return this; + } + + /** + * Get the linkSpeedInMbps property: Link speed. + * + * @return the linkSpeedInMbps value. + */ + public Integer linkSpeedInMbps() { + return this.linkSpeedInMbps; + } + + /** + * Set the linkSpeedInMbps property: Link speed. + * + * @param linkSpeedInMbps the linkSpeedInMbps value to set. + * @return the DeviceProperties object itself. + */ + public DeviceProperties withLinkSpeedInMbps(Integer linkSpeedInMbps) { + this.linkSpeedInMbps = linkSpeedInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhGroup.java new file mode 100644 index 0000000000000..3d614a3ac6f14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhGroup.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DhGroup. */ +public final class DhGroup extends ExpandableStringEnum { + /** Static value None for DhGroup. */ + public static final DhGroup NONE = fromString("None"); + + /** Static value DHGroup1 for DhGroup. */ + public static final DhGroup DHGROUP1 = fromString("DHGroup1"); + + /** Static value DHGroup2 for DhGroup. */ + public static final DhGroup DHGROUP2 = fromString("DHGroup2"); + + /** Static value DHGroup14 for DhGroup. */ + public static final DhGroup DHGROUP14 = fromString("DHGroup14"); + + /** Static value DHGroup2048 for DhGroup. */ + public static final DhGroup DHGROUP2048 = fromString("DHGroup2048"); + + /** Static value ECP256 for DhGroup. */ + public static final DhGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for DhGroup. */ + public static final DhGroup ECP384 = fromString("ECP384"); + + /** Static value DHGroup24 for DhGroup. */ + public static final DhGroup DHGROUP24 = fromString("DHGroup24"); + + /** + * Creates or finds a DhGroup from its string representation. + * + * @param name a name to look for. + * @return the corresponding DhGroup. + */ + @JsonCreator + public static DhGroup fromString(String name) { + return fromString(name, DhGroup.class); + } + + /** @return known DhGroup values. */ + public static Collection values() { + return values(DhGroup.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhcpOptions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhcpOptions.java new file mode 100644 index 0000000000000..136c68998e4b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhcpOptions.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.network.generated.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; + +/** + * DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option + * for a subnet overrides VNET DHCP options. + */ +@Fluent +public final class DhcpOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DhcpOptions.class); + + /* + * The list of DNS servers IP addresses. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the dnsServers property: The list of DNS servers IP addresses. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: The list of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set. + * @return the DhcpOptions object itself. + */ + public DhcpOptions withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Dimension.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Dimension.java new file mode 100644 index 0000000000000..21406b19b1927 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Dimension.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.network.generated.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; + +/** Dimension of the metric. */ +@Fluent +public final class Dimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dimension.class); + + /* + * The name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The internal name of the dimension. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** + * Get the name property: The name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the dimension. + * + * @param name the name value to set. + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The display name of the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the dimension. + * + * @param displayName the displayName value to set. + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internalName property: The internal name of the dimension. + * + * @return the internalName value. + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internalName property: The internal name of the dimension. + * + * @param internalName the internalName value to set. + * @return the Dimension object itself. + */ + public Dimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Direction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Direction.java new file mode 100644 index 0000000000000..b05f63b1d107e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Direction.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Direction. */ +public final class Direction extends ExpandableStringEnum { + /** Static value Inbound for Direction. */ + public static final Direction INBOUND = fromString("Inbound"); + + /** Static value Outbound for Direction. */ + public static final Direction OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Direction from its string representation. + * + * @param name a name to look for. + * @return the corresponding Direction. + */ + @JsonCreator + public static Direction fromString(String name) { + return fromString(name, Direction.class); + } + + /** @return known Direction values. */ + public static Collection values() { + return values(Direction.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.java new file mode 100644 index 0000000000000..f6bbf2df973c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; + +/** An immutable client-side representation of DnsNameAvailabilityResult. */ +public interface DnsNameAvailabilityResult { + /** + * Gets the available property: Domain availability (True/False). + * + * @return the available value. + */ + Boolean available(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner object. + * + * @return the inner object. + */ + DnsNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.java new file mode 100644 index 0000000000000..aa7964a6b2ed8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.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.network.generated.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; + +/** DNS Proxy Settings in Firewall Policy. */ +@Fluent +public final class DnsSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DnsSettings.class); + + /* + * List of Custom DNS Servers. + */ + @JsonProperty(value = "servers") + private List servers; + + /* + * Enable DNS Proxy on Firewalls attached to the Firewall Policy. + */ + @JsonProperty(value = "enableProxy") + private Boolean enableProxy; + + /* + * FQDNs in Network Rules are supported when set to true. + */ + @JsonProperty(value = "requireProxyForNetworkRules") + private Boolean requireProxyForNetworkRules; + + /** + * Get the servers property: List of Custom DNS Servers. + * + * @return the servers value. + */ + public List servers() { + return this.servers; + } + + /** + * Set the servers property: List of Custom DNS Servers. + * + * @param servers the servers value to set. + * @return the DnsSettings object itself. + */ + public DnsSettings withServers(List servers) { + this.servers = servers; + return this; + } + + /** + * Get the enableProxy property: Enable DNS Proxy on Firewalls attached to the Firewall Policy. + * + * @return the enableProxy value. + */ + public Boolean enableProxy() { + return this.enableProxy; + } + + /** + * Set the enableProxy property: Enable DNS Proxy on Firewalls attached to the Firewall Policy. + * + * @param enableProxy the enableProxy value to set. + * @return the DnsSettings object itself. + */ + public DnsSettings withEnableProxy(Boolean enableProxy) { + this.enableProxy = enableProxy; + return this; + } + + /** + * Get the requireProxyForNetworkRules property: FQDNs in Network Rules are supported when set to true. + * + * @return the requireProxyForNetworkRules value. + */ + public Boolean requireProxyForNetworkRules() { + return this.requireProxyForNetworkRules; + } + + /** + * Set the requireProxyForNetworkRules property: FQDNs in Network Rules are supported when set to true. + * + * @param requireProxyForNetworkRules the requireProxyForNetworkRules value to set. + * @return the DnsSettings object itself. + */ + public DnsSettings withRequireProxyForNetworkRules(Boolean requireProxyForNetworkRules) { + this.requireProxyForNetworkRules = requireProxyForNetworkRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfiguration.java new file mode 100644 index 0000000000000..81eb06530b578 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfiguration.java @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DscpConfiguration. */ +public interface DscpConfiguration { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the markings property: List of markings to be used in the configuration. + * + * @return the markings value. + */ + List markings(); + + /** + * Gets the sourceIpRanges property: Source IP ranges. + * + * @return the sourceIpRanges value. + */ + List sourceIpRanges(); + + /** + * Gets the destinationIpRanges property: Destination IP ranges. + * + * @return the destinationIpRanges value. + */ + List destinationIpRanges(); + + /** + * Gets the sourcePortRanges property: Sources port ranges. + * + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + + /** + * Gets the destinationPortRanges property: Destination port ranges. + * + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * Gets the protocol property: RNM supported protocol types. + * + * @return the protocol value. + */ + ProtocolType protocol(); + + /** + * Gets the qosCollectionId property: Qos Collection ID generated by RNM. + * + * @return the qosCollectionId value. + */ + String qosCollectionId(); + + /** + * Gets the associatedNetworkInterfaces property: Associated Network Interfaces to the DSCP Configuration. + * + * @return the associatedNetworkInterfaces value. + */ + List associatedNetworkInterfaces(); + + /** + * Gets the resourceGuid property: The resource GUID property of the DSCP Configuration resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the DSCP Configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.DscpConfigurationInner object. + * + * @return the inner object. + */ + DscpConfigurationInner innerModel(); + + /** The entirety of the DscpConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DscpConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the DscpConfiguration definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DscpConfiguration 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 DscpConfiguration definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DscpConfiguration 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.WithMarkings, + DefinitionStages.WithSourceIpRanges, + DefinitionStages.WithDestinationIpRanges, + DefinitionStages.WithSourcePortRanges, + DefinitionStages.WithDestinationPortRanges, + DefinitionStages.WithProtocol { + /** + * Executes the create request. + * + * @return the created resource. + */ + DscpConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DscpConfiguration create(Context context); + } + /** The stage of the DscpConfiguration 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 DscpConfiguration definition allowing to specify markings. */ + interface WithMarkings { + /** + * Specifies the markings property: List of markings to be used in the configuration.. + * + * @param markings List of markings to be used in the configuration. + * @return the next definition stage. + */ + WithCreate withMarkings(List markings); + } + /** The stage of the DscpConfiguration definition allowing to specify sourceIpRanges. */ + interface WithSourceIpRanges { + /** + * Specifies the sourceIpRanges property: Source IP ranges.. + * + * @param sourceIpRanges Source IP ranges. + * @return the next definition stage. + */ + WithCreate withSourceIpRanges(List sourceIpRanges); + } + /** The stage of the DscpConfiguration definition allowing to specify destinationIpRanges. */ + interface WithDestinationIpRanges { + /** + * Specifies the destinationIpRanges property: Destination IP ranges.. + * + * @param destinationIpRanges Destination IP ranges. + * @return the next definition stage. + */ + WithCreate withDestinationIpRanges(List destinationIpRanges); + } + /** The stage of the DscpConfiguration definition allowing to specify sourcePortRanges. */ + interface WithSourcePortRanges { + /** + * Specifies the sourcePortRanges property: Sources port ranges.. + * + * @param sourcePortRanges Sources port ranges. + * @return the next definition stage. + */ + WithCreate withSourcePortRanges(List sourcePortRanges); + } + /** The stage of the DscpConfiguration definition allowing to specify destinationPortRanges. */ + interface WithDestinationPortRanges { + /** + * Specifies the destinationPortRanges property: Destination port ranges.. + * + * @param destinationPortRanges Destination port ranges. + * @return the next definition stage. + */ + WithCreate withDestinationPortRanges(List destinationPortRanges); + } + /** The stage of the DscpConfiguration definition allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: RNM supported protocol types.. + * + * @param protocol RNM supported protocol types. + * @return the next definition stage. + */ + WithCreate withProtocol(ProtocolType protocol); + } + } + /** + * Begins update for the DscpConfiguration resource. + * + * @return the stage of resource update. + */ + DscpConfiguration.Update update(); + + /** The template for DscpConfiguration update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithMarkings, + UpdateStages.WithSourceIpRanges, + UpdateStages.WithDestinationIpRanges, + UpdateStages.WithSourcePortRanges, + UpdateStages.WithDestinationPortRanges, + UpdateStages.WithProtocol { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DscpConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DscpConfiguration apply(Context context); + } + /** The DscpConfiguration update stages. */ + interface UpdateStages { + /** The stage of the DscpConfiguration 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 DscpConfiguration update allowing to specify markings. */ + interface WithMarkings { + /** + * Specifies the markings property: List of markings to be used in the configuration.. + * + * @param markings List of markings to be used in the configuration. + * @return the next definition stage. + */ + Update withMarkings(List markings); + } + /** The stage of the DscpConfiguration update allowing to specify sourceIpRanges. */ + interface WithSourceIpRanges { + /** + * Specifies the sourceIpRanges property: Source IP ranges.. + * + * @param sourceIpRanges Source IP ranges. + * @return the next definition stage. + */ + Update withSourceIpRanges(List sourceIpRanges); + } + /** The stage of the DscpConfiguration update allowing to specify destinationIpRanges. */ + interface WithDestinationIpRanges { + /** + * Specifies the destinationIpRanges property: Destination IP ranges.. + * + * @param destinationIpRanges Destination IP ranges. + * @return the next definition stage. + */ + Update withDestinationIpRanges(List destinationIpRanges); + } + /** The stage of the DscpConfiguration update allowing to specify sourcePortRanges. */ + interface WithSourcePortRanges { + /** + * Specifies the sourcePortRanges property: Sources port ranges.. + * + * @param sourcePortRanges Sources port ranges. + * @return the next definition stage. + */ + Update withSourcePortRanges(List sourcePortRanges); + } + /** The stage of the DscpConfiguration update allowing to specify destinationPortRanges. */ + interface WithDestinationPortRanges { + /** + * Specifies the destinationPortRanges property: Destination port ranges.. + * + * @param destinationPortRanges Destination port ranges. + * @return the next definition stage. + */ + Update withDestinationPortRanges(List destinationPortRanges); + } + /** The stage of the DscpConfiguration update allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: RNM supported protocol types.. + * + * @param protocol RNM supported protocol types. + * @return the next definition stage. + */ + Update withProtocol(ProtocolType protocol); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DscpConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DscpConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurationListResult.java new file mode 100644 index 0000000000000..4eec5dddb8b90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the DscpConfigurationList API service call. */ +@Fluent +public final class DscpConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DscpConfigurationListResult.class); + + /* + * A list of dscp configurations in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of dscp configurations in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of dscp configurations in a resource group. + * + * @param value the value value to set. + * @return the DscpConfigurationListResult object itself. + */ + public DscpConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurations.java new file mode 100644 index 0000000000000..f30a8d9d2df98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurations.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 DscpConfigurations. */ +public interface DscpConfigurations { + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String dscpConfigurationName); + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dscpConfigurationName, Context context); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + DscpConfiguration getByResourceGroup(String resourceGroupName, String dscpConfigurationName); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String dscpConfigurationName, Context context); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource 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 a DSCP Configuration. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all dscp configurations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + PagedIterable list(); + + /** + * Gets all dscp configurations 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 all dscp configurations in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets a DSCP Configuration. + * + * @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 DSCP Configuration. + */ + DscpConfiguration getById(String id); + + /** + * Gets a DSCP Configuration. + * + * @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 DSCP Configuration. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a DSCP Configuration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a DSCP Configuration. + * + * @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 DscpConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new DscpConfiguration definition. + */ + DscpConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroup.java new file mode 100644 index 0000000000000..818bbdc006cc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroup.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Effective network security group. */ +@Fluent +public final class EffectiveNetworkSecurityGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityGroup.class); + + /* + * The ID of network security group that is applied. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * Associated resources. + */ + @JsonProperty(value = "association") + private EffectiveNetworkSecurityGroupAssociation association; + + /* + * A collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /* + * Mapping of tags to list of IP Addresses included within the tag. + */ + @JsonProperty(value = "tagMap") + private String tagMap; + + /** + * Get the networkSecurityGroup property: The ID of network security group that is applied. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the networkSecurityGroup property: The ID of network security group that is applied. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withNetworkSecurityGroup(SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the association property: Associated resources. + * + * @return the association value. + */ + public EffectiveNetworkSecurityGroupAssociation association() { + return this.association; + } + + /** + * Set the association property: Associated resources. + * + * @param association the association value to set. + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withAssociation(EffectiveNetworkSecurityGroupAssociation association) { + this.association = association; + return this; + } + + /** + * Get the effectiveSecurityRules property: A collection of effective security rules. + * + * @return the effectiveSecurityRules value. + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set the effectiveSecurityRules property: A collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set. + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withEffectiveSecurityRules( + List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + + /** + * Get the tagMap property: Mapping of tags to list of IP Addresses included within the tag. + * + * @return the tagMap value. + */ + public String tagMap() { + return this.tagMap; + } + + /** + * Set the tagMap property: Mapping of tags to list of IP Addresses included within the tag. + * + * @param tagMap the tagMap value to set. + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withTagMap(String tagMap) { + this.tagMap = tagMap; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (association() != null) { + association().validate(); + } + if (effectiveSecurityRules() != null) { + effectiveSecurityRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupAssociation.java new file mode 100644 index 0000000000000..6b08191ffce03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupAssociation.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The effective network security group association. */ +@Fluent +public final class EffectiveNetworkSecurityGroupAssociation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityGroupAssociation.class); + + /* + * The ID of the Azure network manager if assigned. + */ + @JsonProperty(value = "networkManager") + private SubResource networkManager; + + /* + * The ID of the subnet if assigned. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * The ID of the network interface if assigned. + */ + @JsonProperty(value = "networkInterface") + private SubResource networkInterface; + + /** + * Get the networkManager property: The ID of the Azure network manager if assigned. + * + * @return the networkManager value. + */ + public SubResource networkManager() { + return this.networkManager; + } + + /** + * Set the networkManager property: The ID of the Azure network manager if assigned. + * + * @param networkManager the networkManager value to set. + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withNetworkManager(SubResource networkManager) { + this.networkManager = networkManager; + return this; + } + + /** + * Get the subnet property: The ID of the subnet if assigned. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The ID of the subnet if assigned. + * + * @param subnet the subnet value to set. + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the networkInterface property: The ID of the network interface if assigned. + * + * @return the networkInterface value. + */ + public SubResource networkInterface() { + return this.networkInterface; + } + + /** + * Set the networkInterface property: The ID of the network interface if assigned. + * + * @param networkInterface the networkInterface value to set. + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withNetworkInterface(SubResource networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java new file mode 100644 index 0000000000000..d11a4d350adf0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import java.util.List; + +/** An immutable client-side representation of EffectiveNetworkSecurityGroupListResult. */ +public interface EffectiveNetworkSecurityGroupListResult { + /** + * Gets the value property: A list of effective network security groups. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner object. + * + * @return the inner object. + */ + EffectiveNetworkSecurityGroupListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java new file mode 100644 index 0000000000000..ddf7a8bce67fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Effective network security rules. */ +@Fluent +public final class EffectiveNetworkSecurityRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityRule.class); + + /* + * The name of the security rule specified by the user (if created by the + * user). + */ + @JsonProperty(value = "name") + private String name; + + /* + * The network protocol this rule applies to. + */ + @JsonProperty(value = "protocol") + private EffectiveSecurityRuleProtocol protocol; + + /* + * The source port or range. + */ + @JsonProperty(value = "sourcePortRange") + private String sourcePortRange; + + /* + * The destination port or range. + */ + @JsonProperty(value = "destinationPortRange") + private String destinationPortRange; + + /* + * The source port ranges. Expected values include a single integer between + * 0 and 65535, a range using '-' as separator (e.g. 100-400), or an + * asterisk (*). + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /* + * The destination port ranges. Expected values include a single integer + * between 0 and 65535, a range using '-' as separator (e.g. 100-400), or + * an asterisk (*). + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /* + * The source address prefix. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /* + * The destination address prefix. + */ + @JsonProperty(value = "destinationAddressPrefix") + private String destinationAddressPrefix; + + /* + * The source address prefixes. Expected values include CIDR IP ranges, + * Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, + * and the asterisk (*). + */ + @JsonProperty(value = "sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /* + * The destination address prefixes. Expected values include CIDR IP + * ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), + * System Tags, and the asterisk (*). + */ + @JsonProperty(value = "destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /* + * The expanded source address prefix. + */ + @JsonProperty(value = "expandedSourceAddressPrefix") + private List expandedSourceAddressPrefix; + + /* + * Expanded destination address prefix. + */ + @JsonProperty(value = "expandedDestinationAddressPrefix") + private List expandedDestinationAddressPrefix; + + /* + * Whether network traffic is allowed or denied. + */ + @JsonProperty(value = "access") + private SecurityRuleAccess access; + + /* + * The priority of the rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * The direction of the rule. + */ + @JsonProperty(value = "direction") + private SecurityRuleDirection direction; + + /** + * Get the name property: The name of the security rule specified by the user (if created by the user). + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the security rule specified by the user (if created by the user). + * + * @param name the name value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol property: The network protocol this rule applies to. + * + * @return the protocol value. + */ + public EffectiveSecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The network protocol this rule applies to. + * + * @param protocol the protocol value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withProtocol(EffectiveSecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourcePortRange property: The source port or range. + * + * @return the sourcePortRange value. + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the sourcePortRange property: The source port or range. + * + * @param sourcePortRange the sourcePortRange value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the destinationPortRange property: The destination port or range. + * + * @return the destinationPortRange value. + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destinationPortRange property: The destination port or range. + * + * @param destinationPortRange the destinationPortRange value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the sourcePortRanges property: The source port ranges. Expected values include a single integer between 0 and + * 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the sourcePortRanges property: The source port ranges. Expected values include a single integer between 0 and + * 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + * + * @param sourcePortRanges the sourcePortRanges value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destinationPortRanges property: The destination port ranges. Expected values include a single integer + * between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destinationPortRanges property: The destination port ranges. Expected values include a single integer + * between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + * + * @param destinationPortRanges the destinationPortRanges value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the sourceAddressPrefix property: The source address prefix. + * + * @return the sourceAddressPrefix value. + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the sourceAddressPrefix property: The source address prefix. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the destinationAddressPrefix property: The destination address prefix. + * + * @return the destinationAddressPrefix value. + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destinationAddressPrefix property: The destination address prefix. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the sourceAddressPrefixes property: The source address prefixes. Expected values include CIDR IP ranges, + * Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + * + * @return the sourceAddressPrefixes value. + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the sourceAddressPrefixes property: The source address prefixes. Expected values include CIDR IP ranges, + * Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the destinationAddressPrefixes property: The destination address prefixes. Expected values include CIDR IP + * ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + * + * @return the destinationAddressPrefixes value. + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destinationAddressPrefixes property: The destination address prefixes. Expected values include CIDR IP + * ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the expandedSourceAddressPrefix property: The expanded source address prefix. + * + * @return the expandedSourceAddressPrefix value. + */ + public List expandedSourceAddressPrefix() { + return this.expandedSourceAddressPrefix; + } + + /** + * Set the expandedSourceAddressPrefix property: The expanded source address prefix. + * + * @param expandedSourceAddressPrefix the expandedSourceAddressPrefix value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedSourceAddressPrefix(List expandedSourceAddressPrefix) { + this.expandedSourceAddressPrefix = expandedSourceAddressPrefix; + return this; + } + + /** + * Get the expandedDestinationAddressPrefix property: Expanded destination address prefix. + * + * @return the expandedDestinationAddressPrefix value. + */ + public List expandedDestinationAddressPrefix() { + return this.expandedDestinationAddressPrefix; + } + + /** + * Set the expandedDestinationAddressPrefix property: Expanded destination address prefix. + * + * @param expandedDestinationAddressPrefix the expandedDestinationAddressPrefix value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedDestinationAddressPrefix( + List expandedDestinationAddressPrefix) { + this.expandedDestinationAddressPrefix = expandedDestinationAddressPrefix; + return this; + } + + /** + * Get the access property: Whether network traffic is allowed or denied. + * + * @return the access value. + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set the access property: Whether network traffic is allowed or denied. + * + * @param access the access value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority property: The priority of the rule. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the rule. + * + * @param priority the priority value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction property: The direction of the rule. + * + * @return the direction value. + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of the rule. + * + * @param direction the direction value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoute.java new file mode 100644 index 0000000000000..1eea2556326f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoute.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.network.generated.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; + +/** Effective Route. */ +@Fluent +public final class EffectiveRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveRoute.class); + + /* + * The name of the user defined route. This is optional. + */ + @JsonProperty(value = "name") + private String name; + + /* + * If true, on-premises routes are not propagated to the network interfaces + * in the subnet. + */ + @JsonProperty(value = "disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /* + * Who created the route. + */ + @JsonProperty(value = "source") + private EffectiveRouteSource source; + + /* + * The value of effective route. + */ + @JsonProperty(value = "state") + private EffectiveRouteState state; + + /* + * The address prefixes of the effective routes in CIDR notation. + */ + @JsonProperty(value = "addressPrefix") + private List addressPrefix; + + /* + * The IP address of the next hop of the effective route. + */ + @JsonProperty(value = "nextHopIpAddress") + private List nextHopIpAddress; + + /* + * The type of Azure hop the packet should be sent to. + */ + @JsonProperty(value = "nextHopType") + private RouteNextHopType nextHopType; + + /** + * Get the name property: The name of the user defined route. This is optional. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the user defined route. This is optional. + * + * @param name the name value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withName(String name) { + this.name = name; + return this; + } + + /** + * Get the disableBgpRoutePropagation property: If true, on-premises routes are not propagated to the network + * interfaces in the subnet. + * + * @return the disableBgpRoutePropagation value. + */ + public Boolean disableBgpRoutePropagation() { + return this.disableBgpRoutePropagation; + } + + /** + * Set the disableBgpRoutePropagation property: If true, on-premises routes are not propagated to the network + * interfaces in the subnet. + * + * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.disableBgpRoutePropagation = disableBgpRoutePropagation; + return this; + } + + /** + * Get the source property: Who created the route. + * + * @return the source value. + */ + public EffectiveRouteSource source() { + return this.source; + } + + /** + * Set the source property: Who created the route. + * + * @param source the source value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withSource(EffectiveRouteSource source) { + this.source = source; + return this; + } + + /** + * Get the state property: The value of effective route. + * + * @return the state value. + */ + public EffectiveRouteState state() { + return this.state; + } + + /** + * Set the state property: The value of effective route. + * + * @param state the state value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withState(EffectiveRouteState state) { + this.state = state; + return this; + } + + /** + * Get the addressPrefix property: The address prefixes of the effective routes in CIDR notation. + * + * @return the addressPrefix value. + */ + public List addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: The address prefixes of the effective routes in CIDR notation. + * + * @param addressPrefix the addressPrefix value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withAddressPrefix(List addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the nextHopIpAddress property: The IP address of the next hop of the effective route. + * + * @return the nextHopIpAddress value. + */ + public List nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: The IP address of the next hop of the effective route. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopIpAddress(List nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the nextHopType property: The type of Azure hop the packet should be sent to. + * + * @return the nextHopType value. + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: The type of Azure hop the packet should be sent to. + * + * @param nextHopType the nextHopType value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.java new file mode 100644 index 0000000000000..c956b9188cc9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import java.util.List; + +/** An immutable client-side representation of EffectiveRouteListResult. */ +public interface EffectiveRouteListResult { + /** + * Gets the value property: A list of effective routes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner object. + * + * @return the inner object. + */ + EffectiveRouteListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.java new file mode 100644 index 0000000000000..244b2c0f1ac99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EffectiveRouteSource. */ +public final class EffectiveRouteSource extends ExpandableStringEnum { + /** Static value Unknown for EffectiveRouteSource. */ + public static final EffectiveRouteSource UNKNOWN = fromString("Unknown"); + + /** Static value User for EffectiveRouteSource. */ + public static final EffectiveRouteSource USER = fromString("User"); + + /** Static value VirtualNetworkGateway for EffectiveRouteSource. */ + public static final EffectiveRouteSource VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value Default for EffectiveRouteSource. */ + public static final EffectiveRouteSource DEFAULT = fromString("Default"); + + /** + * Creates or finds a EffectiveRouteSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveRouteSource. + */ + @JsonCreator + public static EffectiveRouteSource fromString(String name) { + return fromString(name, EffectiveRouteSource.class); + } + + /** @return known EffectiveRouteSource values. */ + public static Collection values() { + return values(EffectiveRouteSource.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteState.java new file mode 100644 index 0000000000000..f547803ed4ac2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EffectiveRouteState. */ +public final class EffectiveRouteState extends ExpandableStringEnum { + /** Static value Active for EffectiveRouteState. */ + public static final EffectiveRouteState ACTIVE = fromString("Active"); + + /** Static value Invalid for EffectiveRouteState. */ + public static final EffectiveRouteState INVALID = fromString("Invalid"); + + /** + * Creates or finds a EffectiveRouteState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveRouteState. + */ + @JsonCreator + public static EffectiveRouteState fromString(String name) { + return fromString(name, EffectiveRouteState.class); + } + + /** @return known EffectiveRouteState values. */ + public static Collection values() { + return values(EffectiveRouteState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoutesParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoutesParameters.java new file mode 100644 index 0000000000000..2caa69797fdcb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoutesParameters.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 parameters specifying the resource whose effective routes are being requested. */ +@Fluent +public final class EffectiveRoutesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveRoutesParameters.class); + + /* + * The resource whose effective routes are being requested. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The type of the specified resource like RouteTable, + * ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and + * P2SConnection. + */ + @JsonProperty(value = "virtualWanResourceType") + private String virtualWanResourceType; + + /** + * Get the resourceId property: The resource whose effective routes are being requested. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource whose effective routes are being requested. + * + * @param resourceId the resourceId value to set. + * @return the EffectiveRoutesParameters object itself. + */ + public EffectiveRoutesParameters withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the virtualWanResourceType property: The type of the specified resource like RouteTable, + * ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + * + * @return the virtualWanResourceType value. + */ + public String virtualWanResourceType() { + return this.virtualWanResourceType; + } + + /** + * Set the virtualWanResourceType property: The type of the specified resource like RouteTable, + * ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + * + * @param virtualWanResourceType the virtualWanResourceType value to set. + * @return the EffectiveRoutesParameters object itself. + */ + public EffectiveRoutesParameters withVirtualWanResourceType(String virtualWanResourceType) { + this.virtualWanResourceType = virtualWanResourceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.java new file mode 100644 index 0000000000000..663844cb82ee4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EffectiveSecurityRuleProtocol. */ +public final class EffectiveSecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value All for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol ALL = fromString("All"); + + /** + * Creates or finds a EffectiveSecurityRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveSecurityRuleProtocol. + */ + @JsonCreator + public static EffectiveSecurityRuleProtocol fromString(String name) { + return fromString(name, EffectiveSecurityRuleProtocol.class); + } + + /** @return known EffectiveSecurityRuleProtocol values. */ + public static Collection values() { + return values(EffectiveSecurityRuleProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServiceResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServiceResult.java new file mode 100644 index 0000000000000..917886e1f7f53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServiceResult.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; + +/** An immutable client-side representation of EndpointServiceResult. */ +public interface EndpointServiceResult { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the endpoint service. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Type of the endpoint service. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner object. + * + * @return the inner object. + */ + EndpointServiceResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java new file mode 100644 index 0000000000000..993fe02ca5a8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListAvailableEndpointServices API service call. */ +@Fluent +public final class EndpointServicesListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointServicesListResult.class); + + /* + * List of available endpoint services in a region. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of available endpoint services in a region. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of available endpoint services in a region. + * + * @param value the value value to set. + * @return the EndpointServicesListResult object itself. + */ + public EndpointServicesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the EndpointServicesListResult object itself. + */ + public EndpointServicesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointType.java new file mode 100644 index 0000000000000..b573e648e1170 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EndpointType. */ +public final class EndpointType extends ExpandableStringEnum { + /** Static value AzureVM for EndpointType. */ + public static final EndpointType AZURE_VM = fromString("AzureVM"); + + /** Static value AzureVNet for EndpointType. */ + public static final EndpointType AZURE_VNET = fromString("AzureVNet"); + + /** Static value AzureSubnet for EndpointType. */ + public static final EndpointType AZURE_SUBNET = fromString("AzureSubnet"); + + /** Static value ExternalAddress for EndpointType. */ + public static final EndpointType EXTERNAL_ADDRESS = fromString("ExternalAddress"); + + /** Static value MMAWorkspaceMachine for EndpointType. */ + public static final EndpointType MMAWORKSPACE_MACHINE = fromString("MMAWorkspaceMachine"); + + /** Static value MMAWorkspaceNetwork for EndpointType. */ + public static final EndpointType MMAWORKSPACE_NETWORK = fromString("MMAWorkspaceNetwork"); + + /** + * Creates or finds a EndpointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointType. + */ + @JsonCreator + public static EndpointType fromString(String name) { + return fromString(name, EndpointType.class); + } + + /** @return known EndpointType values. */ + public static Collection values() { + return values(EndpointType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Error.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Error.java new file mode 100644 index 0000000000000..2f2463d4433a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Error.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.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common error representation. */ +@Immutable +public final class Error extends ManagementError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); + + /* + * Inner error message. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private String innerError; + + /** + * Get the innerError property: Inner error message. + * + * @return the innerError value. + */ + public String getInnerError() { + return this.innerError; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.java new file mode 100644 index 0000000000000..834682a50a79b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.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.network.generated.models; + +import com.azure.core.http.HttpResponse; +import com.azure.core.management.exception.ManagementException; + +/** Exception thrown for an invalid response with Error information. */ +public final class ErrorException extends ManagementException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ErrorException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public ErrorException(String message, HttpResponse response, Error value) { + super(message, response, value); + } + + @Override + public Error getValue() { + return (Error) super.getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluatedNetworkSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluatedNetworkSecurityGroup.java new file mode 100644 index 0000000000000..30e28f32a5c74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluatedNetworkSecurityGroup.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Results of network security group evaluation. */ +@Fluent +public final class EvaluatedNetworkSecurityGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EvaluatedNetworkSecurityGroup.class); + + /* + * Network security group ID. + */ + @JsonProperty(value = "networkSecurityGroupId") + private String networkSecurityGroupId; + + /* + * Resource ID of nic or subnet to which network security group is applied. + */ + @JsonProperty(value = "appliedTo") + private String appliedTo; + + /* + * Matched network security rule. + */ + @JsonProperty(value = "matchedRule") + private MatchedRule matchedRule; + + /* + * List of network security rules evaluation results. + */ + @JsonProperty(value = "rulesEvaluationResult", access = JsonProperty.Access.WRITE_ONLY) + private List rulesEvaluationResult; + + /** + * Get the networkSecurityGroupId property: Network security group ID. + * + * @return the networkSecurityGroupId value. + */ + public String networkSecurityGroupId() { + return this.networkSecurityGroupId; + } + + /** + * Set the networkSecurityGroupId property: Network security group ID. + * + * @param networkSecurityGroupId the networkSecurityGroupId value to set. + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withNetworkSecurityGroupId(String networkSecurityGroupId) { + this.networkSecurityGroupId = networkSecurityGroupId; + return this; + } + + /** + * Get the appliedTo property: Resource ID of nic or subnet to which network security group is applied. + * + * @return the appliedTo value. + */ + public String appliedTo() { + return this.appliedTo; + } + + /** + * Set the appliedTo property: Resource ID of nic or subnet to which network security group is applied. + * + * @param appliedTo the appliedTo value to set. + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withAppliedTo(String appliedTo) { + this.appliedTo = appliedTo; + return this; + } + + /** + * Get the matchedRule property: Matched network security rule. + * + * @return the matchedRule value. + */ + public MatchedRule matchedRule() { + return this.matchedRule; + } + + /** + * Set the matchedRule property: Matched network security rule. + * + * @param matchedRule the matchedRule value to set. + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withMatchedRule(MatchedRule matchedRule) { + this.matchedRule = matchedRule; + return this; + } + + /** + * Get the rulesEvaluationResult property: List of network security rules evaluation results. + * + * @return the rulesEvaluationResult value. + */ + public List rulesEvaluationResult() { + return this.rulesEvaluationResult; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchedRule() != null) { + matchedRule().validate(); + } + if (rulesEvaluationResult() != null) { + rulesEvaluationResult().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluationState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluationState.java new file mode 100644 index 0000000000000..cbf2062946914 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluationState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EvaluationState. */ +public final class EvaluationState extends ExpandableStringEnum { + /** Static value NotStarted for EvaluationState. */ + public static final EvaluationState NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for EvaluationState. */ + public static final EvaluationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for EvaluationState. */ + public static final EvaluationState COMPLETED = fromString("Completed"); + + /** + * Creates or finds a EvaluationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EvaluationState. + */ + @JsonCreator + public static EvaluationState fromString(String name) { + return fromString(name, EvaluationState.class); + } + + /** @return known EvaluationState values. */ + public static Collection values() { + return values(EvaluationState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuit.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuit.java new file mode 100644 index 0000000000000..11b26d6d1cfdc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuit.java @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRouteCircuit. */ +public interface ExpressRouteCircuit { + /** + * 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 SKU. + * + * @return the sku value. + */ + ExpressRouteCircuitSku sku(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the allowClassicOperations property: Allow classic operations. + * + * @return the allowClassicOperations value. + */ + Boolean allowClassicOperations(); + + /** + * Gets the circuitProvisioningState property: The CircuitProvisioningState state of the resource. + * + * @return the circuitProvisioningState value. + */ + String circuitProvisioningState(); + + /** + * Gets the serviceProviderProvisioningState property: The ServiceProviderProvisioningState state of the resource. + * + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * Gets the authorizations property: The list of authorizations. + * + * @return the authorizations value. + */ + List authorizations(); + + /** + * Gets the peerings property: The list of peerings. + * + * @return the peerings value. + */ + List peerings(); + + /** + * Gets the serviceKey property: The ServiceKey. + * + * @return the serviceKey value. + */ + String serviceKey(); + + /** + * Gets the serviceProviderNotes property: The ServiceProviderNotes. + * + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * Gets the serviceProviderProperties property: The ServiceProviderProperties. + * + * @return the serviceProviderProperties value. + */ + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties(); + + /** + * Gets the expressRoutePort property: The reference to the ExpressRoutePort resource when the circuit is + * provisioned on an ExpressRoutePort resource. + * + * @return the expressRoutePort value. + */ + SubResource expressRoutePort(); + + /** + * Gets the bandwidthInGbps property: The bandwidth of the circuit when the circuit is provisioned on an + * ExpressRoutePort resource. + * + * @return the bandwidthInGbps value. + */ + Float bandwidthInGbps(); + + /** + * Gets the stag property: The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + * + * @return the stag value. + */ + Integer stag(); + + /** + * Gets the provisioningState property: The provisioning state of the express route circuit resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * Gets the globalReachEnabled property: Flag denoting global reach status. + * + * @return the globalReachEnabled value. + */ + Boolean globalReachEnabled(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.ExpressRouteCircuitInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitInner innerModel(); + + /** The entirety of the ExpressRouteCircuit definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ExpressRouteCircuit definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCircuit definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ExpressRouteCircuit 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 ExpressRouteCircuit definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ExpressRouteCircuit 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.WithSku, + DefinitionStages.WithAllowClassicOperations, + DefinitionStages.WithCircuitProvisioningState, + DefinitionStages.WithServiceProviderProvisioningState, + DefinitionStages.WithAuthorizations, + DefinitionStages.WithPeerings, + DefinitionStages.WithServiceKey, + DefinitionStages.WithServiceProviderNotes, + DefinitionStages.WithServiceProviderProperties, + DefinitionStages.WithExpressRoutePort, + DefinitionStages.WithBandwidthInGbps, + DefinitionStages.WithGatewayManagerEtag, + DefinitionStages.WithGlobalReachEnabled { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteCircuit create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteCircuit create(Context context); + } + /** The stage of the ExpressRouteCircuit 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 ExpressRouteCircuit definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU.. + * + * @param sku The SKU. + * @return the next definition stage. + */ + WithCreate withSku(ExpressRouteCircuitSku sku); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify allowClassicOperations. */ + interface WithAllowClassicOperations { + /** + * Specifies the allowClassicOperations property: Allow classic operations.. + * + * @param allowClassicOperations Allow classic operations. + * @return the next definition stage. + */ + WithCreate withAllowClassicOperations(Boolean allowClassicOperations); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify circuitProvisioningState. */ + interface WithCircuitProvisioningState { + /** + * Specifies the circuitProvisioningState property: The CircuitProvisioningState state of the resource.. + * + * @param circuitProvisioningState The CircuitProvisioningState state of the resource. + * @return the next definition stage. + */ + WithCreate withCircuitProvisioningState(String circuitProvisioningState); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify serviceProviderProvisioningState. */ + interface WithServiceProviderProvisioningState { + /** + * Specifies the serviceProviderProvisioningState property: The ServiceProviderProvisioningState state of + * the resource.. + * + * @param serviceProviderProvisioningState The ServiceProviderProvisioningState state of the resource. + * @return the next definition stage. + */ + WithCreate withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify authorizations. */ + interface WithAuthorizations { + /** + * Specifies the authorizations property: The list of authorizations.. + * + * @param authorizations The list of authorizations. + * @return the next definition stage. + */ + WithCreate withAuthorizations(List authorizations); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify peerings. */ + interface WithPeerings { + /** + * Specifies the peerings property: The list of peerings.. + * + * @param peerings The list of peerings. + * @return the next definition stage. + */ + WithCreate withPeerings(List peerings); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify serviceKey. */ + interface WithServiceKey { + /** + * Specifies the serviceKey property: The ServiceKey.. + * + * @param serviceKey The ServiceKey. + * @return the next definition stage. + */ + WithCreate withServiceKey(String serviceKey); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify serviceProviderNotes. */ + interface WithServiceProviderNotes { + /** + * Specifies the serviceProviderNotes property: The ServiceProviderNotes.. + * + * @param serviceProviderNotes The ServiceProviderNotes. + * @return the next definition stage. + */ + WithCreate withServiceProviderNotes(String serviceProviderNotes); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify serviceProviderProperties. */ + interface WithServiceProviderProperties { + /** + * Specifies the serviceProviderProperties property: The ServiceProviderProperties.. + * + * @param serviceProviderProperties The ServiceProviderProperties. + * @return the next definition stage. + */ + WithCreate withServiceProviderProperties( + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify expressRoutePort. */ + interface WithExpressRoutePort { + /** + * Specifies the expressRoutePort property: The reference to the ExpressRoutePort resource when the circuit + * is provisioned on an ExpressRoutePort resource.. + * + * @param expressRoutePort The reference to the ExpressRoutePort resource when the circuit is provisioned on + * an ExpressRoutePort resource. + * @return the next definition stage. + */ + WithCreate withExpressRoutePort(SubResource expressRoutePort); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify bandwidthInGbps. */ + interface WithBandwidthInGbps { + /** + * Specifies the bandwidthInGbps property: The bandwidth of the circuit when the circuit is provisioned on + * an ExpressRoutePort resource.. + * + * @param bandwidthInGbps The bandwidth of the circuit when the circuit is provisioned on an + * ExpressRoutePort resource. + * @return the next definition stage. + */ + WithCreate withBandwidthInGbps(Float bandwidthInGbps); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify gatewayManagerEtag. */ + interface WithGatewayManagerEtag { + /** + * Specifies the gatewayManagerEtag property: The GatewayManager Etag.. + * + * @param gatewayManagerEtag The GatewayManager Etag. + * @return the next definition stage. + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify globalReachEnabled. */ + interface WithGlobalReachEnabled { + /** + * Specifies the globalReachEnabled property: Flag denoting global reach status.. + * + * @param globalReachEnabled Flag denoting global reach status. + * @return the next definition stage. + */ + WithCreate withGlobalReachEnabled(Boolean globalReachEnabled); + } + } + /** + * Begins update for the ExpressRouteCircuit resource. + * + * @return the stage of resource update. + */ + ExpressRouteCircuit.Update update(); + + /** The template for ExpressRouteCircuit update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteCircuit apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteCircuit apply(Context context); + } + /** The ExpressRouteCircuit update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteCircuit 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteCircuit refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteCircuit refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitArpTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitArpTable.java new file mode 100644 index 0000000000000..a41460fc7d816 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitArpTable.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 ARP table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitArpTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitArpTable.class); + + /* + * Entry age in minutes. + */ + @JsonProperty(value = "age") + private Integer age; + + /* + * Interface address. + */ + @JsonProperty(value = "interface") + private String interfaceProperty; + + /* + * The IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The MAC address. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /** + * Get the age property: Entry age in minutes. + * + * @return the age value. + */ + public Integer age() { + return this.age; + } + + /** + * Set the age property: Entry age in minutes. + * + * @param age the age value to set. + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withAge(Integer age) { + this.age = age; + return this; + } + + /** + * Get the interfaceProperty property: Interface address. + * + * @return the interfaceProperty value. + */ + public String interfaceProperty() { + return this.interfaceProperty; + } + + /** + * Set the interfaceProperty property: Interface address. + * + * @param interfaceProperty the interfaceProperty value to set. + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withInterfaceProperty(String interfaceProperty) { + this.interfaceProperty = interfaceProperty; + return this; + } + + /** + * Get the ipAddress property: The IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the macAddress property: The MAC address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the macAddress property: The MAC address. + * + * @param macAddress the macAddress value to set. + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorization.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorization.java new file mode 100644 index 0000000000000..f608fb85f2f23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorization.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; + +/** An immutable client-side representation of ExpressRouteCircuitAuthorization. */ +public interface ExpressRouteCircuitAuthorization { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the authorizationUseStatus property: The authorization use status. + * + * @return the authorizationUseStatus value. + */ + AuthorizationUseStatus authorizationUseStatus(); + + /** + * Gets the provisioningState property: The provisioning state of the authorization resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner + * object. + * + * @return the inner object. + */ + ExpressRouteCircuitAuthorizationInner innerModel(); + + /** The entirety of the ExpressRouteCircuitAuthorization definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExpressRouteCircuitAuthorization definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCircuitAuthorization definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExpressRouteCircuitAuthorization definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, circuitName. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @return the next definition stage. + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + /** + * The stage of the ExpressRouteCircuitAuthorization 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.WithName, + DefinitionStages.WithAuthorizationKey, + DefinitionStages.WithAuthorizationUseStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteCircuitAuthorization create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteCircuitAuthorization create(Context context); + } + /** The stage of the ExpressRouteCircuitAuthorization definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the ExpressRouteCircuitAuthorization definition allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorization key.. + * + * @param authorizationKey The authorization key. + * @return the next definition stage. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + /** The stage of the ExpressRouteCircuitAuthorization definition allowing to specify authorizationUseStatus. */ + interface WithAuthorizationUseStatus { + /** + * Specifies the authorizationUseStatus property: The authorization use status.. + * + * @param authorizationUseStatus The authorization use status. + * @return the next definition stage. + */ + WithCreate withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + } + /** + * Begins update for the ExpressRouteCircuitAuthorization resource. + * + * @return the stage of resource update. + */ + ExpressRouteCircuitAuthorization.Update update(); + + /** The template for ExpressRouteCircuitAuthorization update. */ + interface Update + extends UpdateStages.WithName, UpdateStages.WithAuthorizationKey, UpdateStages.WithAuthorizationUseStatus { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteCircuitAuthorization apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteCircuitAuthorization apply(Context context); + } + /** The ExpressRouteCircuitAuthorization update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteCircuitAuthorization update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the ExpressRouteCircuitAuthorization update allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorization key.. + * + * @param authorizationKey The authorization key. + * @return the next definition stage. + */ + Update withAuthorizationKey(String authorizationKey); + } + /** The stage of the ExpressRouteCircuitAuthorization update allowing to specify authorizationUseStatus. */ + interface WithAuthorizationUseStatus { + /** + * Specifies the authorizationUseStatus property: The authorization use status.. + * + * @param authorizationUseStatus The authorization use status. + * @return the next definition stage. + */ + Update withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteCircuitAuthorization refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteCircuitAuthorization refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorizations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorizations.java new file mode 100644 index 0000000000000..72c38be6a3667 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorizations.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.network.generated.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 ExpressRouteCircuitAuthorizations. */ +public interface ExpressRouteCircuitAuthorizations { + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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. + */ + void delete(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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. + */ + void delete(String resourceGroupName, String circuitName, String authorizationName, Context context); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the specified authorization from the specified express route circuit. + */ + ExpressRouteCircuitAuthorization get(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the 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 the specified authorization from the specified express route circuit. + */ + Response getWithResponse( + String resourceGroupName, String circuitName, String authorizationName, Context context); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName, Context context); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @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 the specified authorization from the specified express route circuit. + */ + ExpressRouteCircuitAuthorization getById(String id); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @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 specified authorization from the specified express route circuit. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @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 ExpressRouteCircuitAuthorization resource. + * + * @param name resource name. + * @return the first stage of the new ExpressRouteCircuitAuthorization definition. + */ + ExpressRouteCircuitAuthorization.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnection.java new file mode 100644 index 0000000000000..cf760b7924eae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnection.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; + +/** An immutable client-side representation of ExpressRouteCircuitConnection. */ +public interface ExpressRouteCircuitConnection { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + * + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * Gets the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of + * the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * Gets the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the ipv6CircuitConnectionConfig property: IPv6 Address PrefixProperties of the express route circuit + * connection. + * + * @return the ipv6CircuitConnectionConfig value. + */ + Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig(); + + /** + * Gets the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * Gets the provisioningState property: The provisioning state of the express route circuit connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner + * object. + * + * @return the inner object. + */ + ExpressRouteCircuitConnectionInner innerModel(); + + /** The entirety of the ExpressRouteCircuitConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExpressRouteCircuitConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCircuitConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, circuitName, peeringName. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @return the next definition stage. + */ + WithCreate withExistingPeering(String resourceGroupName, String circuitName, String peeringName); + } + /** + * The stage of the ExpressRouteCircuitConnection 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.WithName, + DefinitionStages.WithExpressRouteCircuitPeering, + DefinitionStages.WithPeerExpressRouteCircuitPeering, + DefinitionStages.WithAddressPrefix, + DefinitionStages.WithAuthorizationKey, + DefinitionStages.WithIpv6CircuitConnectionConfig { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteCircuitConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteCircuitConnection create(Context context); + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify expressRouteCircuitPeering. */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering + * Resource of the circuit initiating connection.. + * + * @param expressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + * @return the next definition stage. + */ + WithCreate withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + /** + * The stage of the ExpressRouteCircuitConnection definition allowing to specify peerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering + * Resource of the peered circuit.. + * + * @param peerExpressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + * @return the next definition stage. + */ + WithCreate withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels.. + * + * @param addressPrefix /29 IP address space to carve out Customer addresses for tunnels. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorization key.. + * + * @param authorizationKey The authorization key. + * @return the next definition stage. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + /** + * The stage of the ExpressRouteCircuitConnection definition allowing to specify ipv6CircuitConnectionConfig. + */ + interface WithIpv6CircuitConnectionConfig { + /** + * Specifies the ipv6CircuitConnectionConfig property: IPv6 Address PrefixProperties of the express route + * circuit connection.. + * + * @param ipv6CircuitConnectionConfig IPv6 Address PrefixProperties of the express route circuit connection. + * @return the next definition stage. + */ + WithCreate withIpv6CircuitConnectionConfig(Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig); + } + } + /** + * Begins update for the ExpressRouteCircuitConnection resource. + * + * @return the stage of resource update. + */ + ExpressRouteCircuitConnection.Update update(); + + /** The template for ExpressRouteCircuitConnection update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithExpressRouteCircuitPeering, + UpdateStages.WithPeerExpressRouteCircuitPeering, + UpdateStages.WithAddressPrefix, + UpdateStages.WithAuthorizationKey, + UpdateStages.WithIpv6CircuitConnectionConfig { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteCircuitConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteCircuitConnection apply(Context context); + } + /** The ExpressRouteCircuitConnection update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteCircuitConnection update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify expressRouteCircuitPeering. */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering + * Resource of the circuit initiating connection.. + * + * @param expressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + * @return the next definition stage. + */ + Update withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify peerExpressRouteCircuitPeering. */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering + * Resource of the peered circuit.. + * + * @param peerExpressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + * @return the next definition stage. + */ + Update withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels.. + * + * @param addressPrefix /29 IP address space to carve out Customer addresses for tunnels. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorization key.. + * + * @param authorizationKey The authorization key. + * @return the next definition stage. + */ + Update withAuthorizationKey(String authorizationKey); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify ipv6CircuitConnectionConfig. */ + interface WithIpv6CircuitConnectionConfig { + /** + * Specifies the ipv6CircuitConnectionConfig property: IPv6 Address PrefixProperties of the express route + * circuit connection.. + * + * @param ipv6CircuitConnectionConfig IPv6 Address PrefixProperties of the express route circuit connection. + * @return the next definition stage. + */ + Update withIpv6CircuitConnectionConfig(Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteCircuitConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteCircuitConnection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnectionListResult.java new file mode 100644 index 0000000000000..4a9fd90bd2a5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnectionListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListConnections API service call retrieves all global reach connections that belongs to a Private + * Peering for an ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionListResult.class); + + /* + * The global reach connection associated with Private Peering in an + * ExpressRoute Circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The global reach connection associated with Private Peering in an ExpressRoute Circuit. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The global reach connection associated with Private Peering in an ExpressRoute Circuit. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitConnectionListResult object itself. + */ + public ExpressRouteCircuitConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitConnectionListResult object itself. + */ + public ExpressRouteCircuitConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnections.java new file mode 100644 index 0000000000000..4bf0be73454c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnections.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 ExpressRouteCircuitConnections. */ +public interface ExpressRouteCircuitConnections { + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, String peeringName, String connectionName); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, String peeringName, String connectionName, Context context); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + ExpressRouteCircuitConnection get( + String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @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 the specified Express Route Circuit Connection from the specified express route circuit. + */ + ExpressRouteCircuitConnection getById(String id); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @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 specified Express Route Circuit Connection from the specified express route circuit. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @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 ExpressRouteCircuitConnection resource. + * + * @param name resource name. + * @return the first stage of the new ExpressRouteCircuitConnection definition. + */ + ExpressRouteCircuitConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitListResult.java new file mode 100644 index 0000000000000..f622c4f91db43 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRouteCircuit API service call. */ +@Fluent +public final class ExpressRouteCircuitListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitListResult.class); + + /* + * A list of ExpressRouteCircuits in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of ExpressRouteCircuits in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ExpressRouteCircuits in a resource group. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitListResult object itself. + */ + public ExpressRouteCircuitListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitListResult object itself. + */ + public ExpressRouteCircuitListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeering.java new file mode 100644 index 0000000000000..75097a2ca7ccd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeering.java @@ -0,0 +1,680 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCircuitPeering. */ +public interface ExpressRouteCircuitPeering { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the peeringType property: The peering type. + * + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * Gets the state property: The peering state. + * + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * Gets the azureAsn property: The Azure ASN. + * + * @return the azureAsn value. + */ + Integer azureAsn(); + + /** + * Gets the peerAsn property: The peer ASN. + * + * @return the peerAsn value. + */ + Long peerAsn(); + + /** + * Gets the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * Gets the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * Gets the primaryAzurePort property: The primary port. + * + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * Gets the secondaryAzurePort property: The secondary port. + * + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * Gets the sharedKey property: The shared key. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the vlanId property: The VLAN ID. + * + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * Gets the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * Gets the stats property: The peering stats of express route circuit. + * + * @return the stats value. + */ + ExpressRouteCircuitStats stats(); + + /** + * Gets the provisioningState property: The provisioning state of the express route circuit peering resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * Gets the lastModifiedBy property: Who was the last to modify the peering. + * + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * Gets the routeFilter property: The reference to the RouteFilter resource. + * + * @return the routeFilter value. + */ + SubResource routeFilter(); + + /** + * Gets the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * Gets the expressRouteConnection property: The ExpressRoute connection. + * + * @return the expressRouteConnection value. + */ + ExpressRouteConnectionId expressRouteConnection(); + + /** + * Gets the connections property: The list of circuit connections associated with Azure Private Peering for this + * circuit. + * + * @return the connections value. + */ + List connections(); + + /** + * Gets the peeredConnections property: The list of peered circuit connections associated with Azure Private Peering + * for this circuit. + * + * @return the peeredConnections value. + */ + List peeredConnections(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitPeeringInner innerModel(); + + /** The entirety of the ExpressRouteCircuitPeering definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExpressRouteCircuitPeering definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCircuitPeering definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, circuitName. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @return the next definition stage. + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + /** + * The stage of the ExpressRouteCircuitPeering 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.WithName, + DefinitionStages.WithPeeringType, + DefinitionStages.WithState, + DefinitionStages.WithAzureAsn, + DefinitionStages.WithPeerAsn, + DefinitionStages.WithPrimaryPeerAddressPrefix, + DefinitionStages.WithSecondaryPeerAddressPrefix, + DefinitionStages.WithPrimaryAzurePort, + DefinitionStages.WithSecondaryAzurePort, + DefinitionStages.WithSharedKey, + DefinitionStages.WithVlanId, + DefinitionStages.WithMicrosoftPeeringConfig, + DefinitionStages.WithStats, + DefinitionStages.WithGatewayManagerEtag, + DefinitionStages.WithRouteFilter, + DefinitionStages.WithIpv6PeeringConfig, + DefinitionStages.WithExpressRouteConnection, + DefinitionStages.WithConnections { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteCircuitPeering create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteCircuitPeering create(Context context); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify peeringType. */ + interface WithPeeringType { + /** + * Specifies the peeringType property: The peering type.. + * + * @param peeringType The peering type. + * @return the next definition stage. + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: The peering state.. + * + * @param state The peering state. + * @return the next definition stage. + */ + WithCreate withState(ExpressRoutePeeringState state); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify azureAsn. */ + interface WithAzureAsn { + /** + * Specifies the azureAsn property: The Azure ASN.. + * + * @param azureAsn The Azure ASN. + * @return the next definition stage. + */ + WithCreate withAzureAsn(Integer azureAsn); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: The peer ASN.. + * + * @param peerAsn The peer ASN. + * @return the next definition stage. + */ + WithCreate withPeerAsn(Long peerAsn); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify primaryPeerAddressPrefix. */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies the primaryPeerAddressPrefix property: The primary address prefix.. + * + * @param primaryPeerAddressPrefix The primary address prefix. + * @return the next definition stage. + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify secondaryPeerAddressPrefix. */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies the secondaryPeerAddressPrefix property: The secondary address prefix.. + * + * @param secondaryPeerAddressPrefix The secondary address prefix. + * @return the next definition stage. + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify primaryAzurePort. */ + interface WithPrimaryAzurePort { + /** + * Specifies the primaryAzurePort property: The primary port.. + * + * @param primaryAzurePort The primary port. + * @return the next definition stage. + */ + WithCreate withPrimaryAzurePort(String primaryAzurePort); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify secondaryAzurePort. */ + interface WithSecondaryAzurePort { + /** + * Specifies the secondaryAzurePort property: The secondary port.. + * + * @param secondaryAzurePort The secondary port. + * @return the next definition stage. + */ + WithCreate withSecondaryAzurePort(String secondaryAzurePort); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify sharedKey. */ + interface WithSharedKey { + /** + * Specifies the sharedKey property: The shared key.. + * + * @param sharedKey The shared key. + * @return the next definition stage. + */ + WithCreate withSharedKey(String sharedKey); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify vlanId. */ + interface WithVlanId { + /** + * Specifies the vlanId property: The VLAN ID.. + * + * @param vlanId The VLAN ID. + * @return the next definition stage. + */ + WithCreate withVlanId(Integer vlanId); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify microsoftPeeringConfig. */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies the microsoftPeeringConfig property: The Microsoft peering configuration.. + * + * @param microsoftPeeringConfig The Microsoft peering configuration. + * @return the next definition stage. + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify stats. */ + interface WithStats { + /** + * Specifies the stats property: The peering stats of express route circuit.. + * + * @param stats The peering stats of express route circuit. + * @return the next definition stage. + */ + WithCreate withStats(ExpressRouteCircuitStatsInner stats); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify gatewayManagerEtag. */ + interface WithGatewayManagerEtag { + /** + * Specifies the gatewayManagerEtag property: The GatewayManager Etag.. + * + * @param gatewayManagerEtag The GatewayManager Etag. + * @return the next definition stage. + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify routeFilter. */ + interface WithRouteFilter { + /** + * Specifies the routeFilter property: The reference to the RouteFilter resource.. + * + * @param routeFilter The reference to the RouteFilter resource. + * @return the next definition stage. + */ + WithCreate withRouteFilter(SubResource routeFilter); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify ipv6PeeringConfig. */ + interface WithIpv6PeeringConfig { + /** + * Specifies the ipv6PeeringConfig property: The IPv6 peering configuration.. + * + * @param ipv6PeeringConfig The IPv6 peering configuration. + * @return the next definition stage. + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify expressRouteConnection. */ + interface WithExpressRouteConnection { + /** + * Specifies the expressRouteConnection property: The ExpressRoute connection.. + * + * @param expressRouteConnection The ExpressRoute connection. + * @return the next definition stage. + */ + WithCreate withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify connections. */ + interface WithConnections { + /** + * Specifies the connections property: The list of circuit connections associated with Azure Private Peering + * for this circuit.. + * + * @param connections The list of circuit connections associated with Azure Private Peering for this + * circuit. + * @return the next definition stage. + */ + WithCreate withConnections(List connections); + } + } + /** + * Begins update for the ExpressRouteCircuitPeering resource. + * + * @return the stage of resource update. + */ + ExpressRouteCircuitPeering.Update update(); + + /** The template for ExpressRouteCircuitPeering update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithPeeringType, + UpdateStages.WithState, + UpdateStages.WithAzureAsn, + UpdateStages.WithPeerAsn, + UpdateStages.WithPrimaryPeerAddressPrefix, + UpdateStages.WithSecondaryPeerAddressPrefix, + UpdateStages.WithPrimaryAzurePort, + UpdateStages.WithSecondaryAzurePort, + UpdateStages.WithSharedKey, + UpdateStages.WithVlanId, + UpdateStages.WithMicrosoftPeeringConfig, + UpdateStages.WithStats, + UpdateStages.WithGatewayManagerEtag, + UpdateStages.WithRouteFilter, + UpdateStages.WithIpv6PeeringConfig, + UpdateStages.WithExpressRouteConnection, + UpdateStages.WithConnections { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteCircuitPeering apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteCircuitPeering apply(Context context); + } + /** The ExpressRouteCircuitPeering update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteCircuitPeering update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify peeringType. */ + interface WithPeeringType { + /** + * Specifies the peeringType property: The peering type.. + * + * @param peeringType The peering type. + * @return the next definition stage. + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: The peering state.. + * + * @param state The peering state. + * @return the next definition stage. + */ + Update withState(ExpressRoutePeeringState state); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify azureAsn. */ + interface WithAzureAsn { + /** + * Specifies the azureAsn property: The Azure ASN.. + * + * @param azureAsn The Azure ASN. + * @return the next definition stage. + */ + Update withAzureAsn(Integer azureAsn); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: The peer ASN.. + * + * @param peerAsn The peer ASN. + * @return the next definition stage. + */ + Update withPeerAsn(Long peerAsn); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify primaryPeerAddressPrefix. */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies the primaryPeerAddressPrefix property: The primary address prefix.. + * + * @param primaryPeerAddressPrefix The primary address prefix. + * @return the next definition stage. + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify secondaryPeerAddressPrefix. */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies the secondaryPeerAddressPrefix property: The secondary address prefix.. + * + * @param secondaryPeerAddressPrefix The secondary address prefix. + * @return the next definition stage. + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify primaryAzurePort. */ + interface WithPrimaryAzurePort { + /** + * Specifies the primaryAzurePort property: The primary port.. + * + * @param primaryAzurePort The primary port. + * @return the next definition stage. + */ + Update withPrimaryAzurePort(String primaryAzurePort); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify secondaryAzurePort. */ + interface WithSecondaryAzurePort { + /** + * Specifies the secondaryAzurePort property: The secondary port.. + * + * @param secondaryAzurePort The secondary port. + * @return the next definition stage. + */ + Update withSecondaryAzurePort(String secondaryAzurePort); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify sharedKey. */ + interface WithSharedKey { + /** + * Specifies the sharedKey property: The shared key.. + * + * @param sharedKey The shared key. + * @return the next definition stage. + */ + Update withSharedKey(String sharedKey); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify vlanId. */ + interface WithVlanId { + /** + * Specifies the vlanId property: The VLAN ID.. + * + * @param vlanId The VLAN ID. + * @return the next definition stage. + */ + Update withVlanId(Integer vlanId); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify microsoftPeeringConfig. */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies the microsoftPeeringConfig property: The Microsoft peering configuration.. + * + * @param microsoftPeeringConfig The Microsoft peering configuration. + * @return the next definition stage. + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify stats. */ + interface WithStats { + /** + * Specifies the stats property: The peering stats of express route circuit.. + * + * @param stats The peering stats of express route circuit. + * @return the next definition stage. + */ + Update withStats(ExpressRouteCircuitStatsInner stats); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify gatewayManagerEtag. */ + interface WithGatewayManagerEtag { + /** + * Specifies the gatewayManagerEtag property: The GatewayManager Etag.. + * + * @param gatewayManagerEtag The GatewayManager Etag. + * @return the next definition stage. + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify routeFilter. */ + interface WithRouteFilter { + /** + * Specifies the routeFilter property: The reference to the RouteFilter resource.. + * + * @param routeFilter The reference to the RouteFilter resource. + * @return the next definition stage. + */ + Update withRouteFilter(SubResource routeFilter); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify ipv6PeeringConfig. */ + interface WithIpv6PeeringConfig { + /** + * Specifies the ipv6PeeringConfig property: The IPv6 peering configuration.. + * + * @param ipv6PeeringConfig The IPv6 peering configuration. + * @return the next definition stage. + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify expressRouteConnection. */ + interface WithExpressRouteConnection { + /** + * Specifies the expressRouteConnection property: The ExpressRoute connection.. + * + * @param expressRouteConnection The ExpressRoute connection. + * @return the next definition stage. + */ + Update withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify connections. */ + interface WithConnections { + /** + * Specifies the connections property: The list of circuit connections associated with Azure Private Peering + * for this circuit.. + * + * @param connections The list of circuit connections associated with Azure Private Peering for this + * circuit. + * @return the next definition stage. + */ + Update withConnections(List connections); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteCircuitPeering refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteCircuitPeering refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java new file mode 100644 index 0000000000000..a161364f51fce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ +public final class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + extends ExpandableStringEnum { + /** Static value NotConfigured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState NOT_CONFIGURED = + fromString("NotConfigured"); + + /** Static value Configuring for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURING = fromString("Configuring"); + + /** Static value Configured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURED = fromString("Configured"); + + /** Static value ValidationNeeded for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState VALIDATION_NEEDED = + fromString("ValidationNeeded"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringAdvertisedPublicPrefixState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. + */ + @JsonCreator + public static ExpressRouteCircuitPeeringAdvertisedPublicPrefixState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } + + /** @return known ExpressRouteCircuitPeeringAdvertisedPublicPrefixState values. */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..3c544891aa3fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Specifies the peering configuration. */ +@Fluent +public final class ExpressRouteCircuitPeeringConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringConfig.class); + + /* + * The reference to AdvertisedPublicPrefixes. + */ + @JsonProperty(value = "advertisedPublicPrefixes") + private List advertisedPublicPrefixes; + + /* + * The communities of bgp peering. Specified for microsoft peering. + */ + @JsonProperty(value = "advertisedCommunities") + private List advertisedCommunities; + + /* + * The advertised public prefix state of the Peering resource. + */ + @JsonProperty(value = "advertisedPublicPrefixesState", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState; + + /* + * The legacy mode of the peering. + */ + @JsonProperty(value = "legacyMode") + private Integer legacyMode; + + /* + * The CustomerASN of the peering. + */ + @JsonProperty(value = "customerASN") + private Integer customerAsn; + + /* + * The RoutingRegistryName of the configuration. + */ + @JsonProperty(value = "routingRegistryName") + private String routingRegistryName; + + /** + * Get the advertisedPublicPrefixes property: The reference to AdvertisedPublicPrefixes. + * + * @return the advertisedPublicPrefixes value. + */ + public List advertisedPublicPrefixes() { + return this.advertisedPublicPrefixes; + } + + /** + * Set the advertisedPublicPrefixes property: The reference to AdvertisedPublicPrefixes. + * + * @param advertisedPublicPrefixes the advertisedPublicPrefixes value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixes(List advertisedPublicPrefixes) { + this.advertisedPublicPrefixes = advertisedPublicPrefixes; + return this; + } + + /** + * Get the advertisedCommunities property: The communities of bgp peering. Specified for microsoft peering. + * + * @return the advertisedCommunities value. + */ + public List advertisedCommunities() { + return this.advertisedCommunities; + } + + /** + * Set the advertisedCommunities property: The communities of bgp peering. Specified for microsoft peering. + * + * @param advertisedCommunities the advertisedCommunities value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedCommunities(List advertisedCommunities) { + this.advertisedCommunities = advertisedCommunities; + return this; + } + + /** + * Get the advertisedPublicPrefixesState property: The advertised public prefix state of the Peering resource. + * + * @return the advertisedPublicPrefixesState value. + */ + public ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState() { + return this.advertisedPublicPrefixesState; + } + + /** + * Get the legacyMode property: The legacy mode of the peering. + * + * @return the legacyMode value. + */ + public Integer legacyMode() { + return this.legacyMode; + } + + /** + * Set the legacyMode property: The legacy mode of the peering. + * + * @param legacyMode the legacyMode value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withLegacyMode(Integer legacyMode) { + this.legacyMode = legacyMode; + return this; + } + + /** + * Get the customerAsn property: The CustomerASN of the peering. + * + * @return the customerAsn value. + */ + public Integer customerAsn() { + return this.customerAsn; + } + + /** + * Set the customerAsn property: The CustomerASN of the peering. + * + * @param customerAsn the customerAsn value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withCustomerAsn(Integer customerAsn) { + this.customerAsn = customerAsn; + return this; + } + + /** + * Get the routingRegistryName property: The RoutingRegistryName of the configuration. + * + * @return the routingRegistryName value. + */ + public String routingRegistryName() { + return this.routingRegistryName; + } + + /** + * Set the routingRegistryName property: The RoutingRegistryName of the configuration. + * + * @param routingRegistryName the routingRegistryName value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withRoutingRegistryName(String routingRegistryName) { + this.routingRegistryName = routingRegistryName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringId.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringId.java new file mode 100644 index 0000000000000..fd666af74daf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringId.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.network.generated.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; + +/** ExpressRoute circuit peering identifier. */ +@Fluent +public final class ExpressRouteCircuitPeeringId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringId.class); + + /* + * The ID of the ExpressRoute circuit peering. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The ID of the ExpressRoute circuit peering. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the ExpressRoute circuit peering. + * + * @param id the id value to set. + * @return the ExpressRouteCircuitPeeringId object itself. + */ + public ExpressRouteCircuitPeeringId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringListResult.java new file mode 100644 index 0000000000000..88353b03882dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitPeeringListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringListResult.class); + + /* + * The peerings in an express route circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The peerings in an express route circuit. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The peerings in an express route circuit. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitPeeringListResult object itself. + */ + public ExpressRouteCircuitPeeringListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitPeeringListResult object itself. + */ + public ExpressRouteCircuitPeeringListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringState.java new file mode 100644 index 0000000000000..8a5374b0f131f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteCircuitPeeringState. */ +public final class ExpressRouteCircuitPeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitPeeringState. + */ + @JsonCreator + public static ExpressRouteCircuitPeeringState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringState.class); + } + + /** @return known ExpressRouteCircuitPeeringState values. */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeerings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeerings.java new file mode 100644 index 0000000000000..46a60011e4e5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeerings.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.network.generated.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 ExpressRouteCircuitPeerings. */ +public interface ExpressRouteCircuitPeerings { + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, String peeringName); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, String peeringName, Context context); + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + ExpressRouteCircuitPeering get(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName, Context context); + + /** + * Gets the specified peering for the express route circuit. + * + * @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 the specified peering for the express route circuit. + */ + ExpressRouteCircuitPeering getById(String id); + + /** + * Gets the specified peering for the express route circuit. + * + * @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 specified peering for the express route circuit. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @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 ExpressRouteCircuitPeering resource. + * + * @param name resource name. + * @return the first stage of the new ExpressRouteCircuitPeering definition. + */ + ExpressRouteCircuitPeering.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitReference.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitReference.java new file mode 100644 index 0000000000000..2c07a8b516f0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitReference.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.network.generated.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; + +/** Reference to an express route circuit. */ +@Fluent +public final class ExpressRouteCircuitReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitReference.class); + + /* + * Corresponding Express Route Circuit Id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Corresponding Express Route Circuit Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Corresponding Express Route Circuit Id. + * + * @param id the id value to set. + * @return the ExpressRouteCircuitReference object itself. + */ + public ExpressRouteCircuitReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTable.java new file mode 100644 index 0000000000000..33be99caaaedc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTable.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.network.generated.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 routes table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitRoutesTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitRoutesTable.class); + + /* + * IP address of a network entity. + */ + @JsonProperty(value = "network") + private String network; + + /* + * NextHop address. + */ + @JsonProperty(value = "nextHop") + private String nextHop; + + /* + * Local preference value as set with the set local-preference route-map + * configuration command. + */ + @JsonProperty(value = "locPrf") + private String locPrf; + + /* + * Route Weight. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * Autonomous system paths to the destination network. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get the network property: IP address of a network entity. + * + * @return the network value. + */ + public String network() { + return this.network; + } + + /** + * Set the network property: IP address of a network entity. + * + * @param network the network value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNetwork(String network) { + this.network = network; + return this; + } + + /** + * Get the nextHop property: NextHop address. + * + * @return the nextHop value. + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Set the nextHop property: NextHop address. + * + * @param nextHop the nextHop value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNextHop(String nextHop) { + this.nextHop = nextHop; + return this; + } + + /** + * Get the locPrf property: Local preference value as set with the set local-preference route-map configuration + * command. + * + * @return the locPrf value. + */ + public String locPrf() { + return this.locPrf; + } + + /** + * Set the locPrf property: Local preference value as set with the set local-preference route-map configuration + * command. + * + * @param locPrf the locPrf value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withLocPrf(String locPrf) { + this.locPrf = locPrf; + return this; + } + + /** + * Get the weight property: Route Weight. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Route Weight. + * + * @param weight the weight value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the path property: Autonomous system paths to the destination network. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Autonomous system paths to the destination network. + * + * @param path the path value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTableSummary.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTableSummary.java new file mode 100644 index 0000000000000..bd28e694e106a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTableSummary.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 routes table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitRoutesTableSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitRoutesTableSummary.class); + + /* + * IP address of the neighbor. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /* + * BGP version number spoken to the neighbor. + */ + @JsonProperty(value = "v") + private Integer v; + + /* + * Autonomous system number. + */ + @JsonProperty(value = "as") + private Integer as; + + /* + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /* + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "statePfxRcd") + private String statePfxRcd; + + /** + * Get the neighbor property: IP address of the neighbor. + * + * @return the neighbor value. + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set the neighbor property: IP address of the neighbor. + * + * @param neighbor the neighbor value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get the v property: BGP version number spoken to the neighbor. + * + * @return the v value. + */ + public Integer v() { + return this.v; + } + + /** + * Set the v property: BGP version number spoken to the neighbor. + * + * @param v the v value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withV(Integer v) { + this.v = v; + return this; + } + + /** + * Get the as property: Autonomous system number. + * + * @return the as value. + */ + public Integer as() { + return this.as; + } + + /** + * Set the as property: Autonomous system number. + * + * @param as the as value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withAs(Integer as) { + this.as = as; + return this; + } + + /** + * Get the upDown property: The length of time that the BGP session has been in the Established state, or the + * current status if not in the Established state. + * + * @return the upDown value. + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the upDown property: The length of time that the BGP session has been in the Established state, or the + * current status if not in the Established state. + * + * @param upDown the upDown value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get the statePfxRcd property: Current state of the BGP session, and the number of prefixes that have been + * received from a neighbor or peer group. + * + * @return the statePfxRcd value. + */ + public String statePfxRcd() { + return this.statePfxRcd; + } + + /** + * Set the statePfxRcd property: Current state of the BGP session, and the number of prefixes that have been + * received from a neighbor or peer group. + * + * @param statePfxRcd the statePfxRcd value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withStatePfxRcd(String statePfxRcd) { + this.statePfxRcd = statePfxRcd; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitServiceProviderProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitServiceProviderProperties.java new file mode 100644 index 0000000000000..201e91ce7014b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitServiceProviderProperties.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.network.generated.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; + +/** Contains ServiceProviderProperties in an ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitServiceProviderProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitServiceProviderProperties.class); + + /* + * The serviceProviderName. + */ + @JsonProperty(value = "serviceProviderName") + private String serviceProviderName; + + /* + * The peering location. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /* + * The BandwidthInMbps. + */ + @JsonProperty(value = "bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * Get the serviceProviderName property: The serviceProviderName. + * + * @return the serviceProviderName value. + */ + public String serviceProviderName() { + return this.serviceProviderName; + } + + /** + * Set the serviceProviderName property: The serviceProviderName. + * + * @param serviceProviderName the serviceProviderName value to set. + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withServiceProviderName(String serviceProviderName) { + this.serviceProviderName = serviceProviderName; + return this; + } + + /** + * Get the peeringLocation property: The peering location. + * + * @return the peeringLocation value. + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peeringLocation property: The peering location. + * + * @param peeringLocation the peeringLocation value to set. + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the bandwidthInMbps property: The BandwidthInMbps. + * + * @return the bandwidthInMbps value. + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the bandwidthInMbps property: The BandwidthInMbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set. + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSku.java new file mode 100644 index 0000000000000..7847eee8a0bfa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSku.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.network.generated.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; + +/** Contains SKU in an ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitSku.class); + + /* + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The tier of the SKU. + */ + @JsonProperty(value = "tier") + private ExpressRouteCircuitSkuTier tier; + + /* + * The family of the SKU. + */ + @JsonProperty(value = "family") + private ExpressRouteCircuitSkuFamily family; + + /** + * 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 ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The tier of the SKU. + * + * @return the tier value. + */ + public ExpressRouteCircuitSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: The tier of the SKU. + * + * @param tier the tier value to set. + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withTier(ExpressRouteCircuitSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the family property: The family of the SKU. + * + * @return the family value. + */ + public ExpressRouteCircuitSkuFamily family() { + return this.family; + } + + /** + * Set the family property: The family of the SKU. + * + * @param family the family value to set. + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withFamily(ExpressRouteCircuitSkuFamily family) { + this.family = family; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuFamily.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuFamily.java new file mode 100644 index 0000000000000..67ae9253d9188 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuFamily.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteCircuitSkuFamily. */ +public final class ExpressRouteCircuitSkuFamily extends ExpandableStringEnum { + /** Static value UnlimitedData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily UNLIMITED_DATA = fromString("UnlimitedData"); + + /** Static value MeteredData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily METERED_DATA = fromString("MeteredData"); + + /** + * Creates or finds a ExpressRouteCircuitSkuFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitSkuFamily. + */ + @JsonCreator + public static ExpressRouteCircuitSkuFamily fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuFamily.class); + } + + /** @return known ExpressRouteCircuitSkuFamily values. */ + public static Collection values() { + return values(ExpressRouteCircuitSkuFamily.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuTier.java new file mode 100644 index 0000000000000..a46e6c0a3f8c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuTier.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteCircuitSkuTier. */ +public final class ExpressRouteCircuitSkuTier extends ExpandableStringEnum { + /** Static value Standard for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier PREMIUM = fromString("Premium"); + + /** Static value Basic for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier BASIC = fromString("Basic"); + + /** Static value Local for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier LOCAL = fromString("Local"); + + /** + * Creates or finds a ExpressRouteCircuitSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitSkuTier. + */ + @JsonCreator + public static ExpressRouteCircuitSkuTier fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuTier.class); + } + + /** @return known ExpressRouteCircuitSkuTier values. */ + public static Collection values() { + return values(ExpressRouteCircuitSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitStats.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitStats.java new file mode 100644 index 0000000000000..671681671b22d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitStats.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; + +/** An immutable client-side representation of ExpressRouteCircuitStats. */ +public interface ExpressRouteCircuitStats { + /** + * Gets the primarybytesIn property: The Primary BytesIn of the peering. + * + * @return the primarybytesIn value. + */ + Long primarybytesIn(); + + /** + * Gets the primarybytesOut property: The primary BytesOut of the peering. + * + * @return the primarybytesOut value. + */ + Long primarybytesOut(); + + /** + * Gets the secondarybytesIn property: The secondary BytesIn of the peering. + * + * @return the secondarybytesIn value. + */ + Long secondarybytesIn(); + + /** + * Gets the secondarybytesOut property: The secondary BytesOut of the peering. + * + * @return the secondarybytesOut value. + */ + Long secondarybytesOut(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitStatsInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java new file mode 100644 index 0000000000000..ceaa9413e4789 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 ExpressRouteCircuits. */ +public interface ExpressRouteCircuits { + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName); + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 circuitName, Context context); + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + ExpressRouteCircuit getByResourceGroup(String resourceGroupName, String circuitName); + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String circuitName, Context context); + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + ExpressRouteCircuitsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + ExpressRouteCircuitsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + ExpressRouteCircuitStats getStats(String resourceGroupName, String circuitName); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + Response getStatsWithResponse( + String resourceGroupName, String circuitName, Context context); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + ExpressRouteCircuitStats getPeeringStats(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + Response getPeeringStatsWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the express route circuits in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the express route circuits in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the express route circuits 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 all the express route circuits in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets information about the specified express route circuit. + * + * @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 information about the specified express route circuit. + */ + ExpressRouteCircuit getById(String id); + + /** + * Gets information about the specified express route circuit. + * + * @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 information about the specified express route circuit. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified express route circuit. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified express route circuit. + * + * @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 ExpressRouteCircuit resource. + * + * @param name resource name. + * @return the first stage of the new ExpressRouteCircuit definition. + */ + ExpressRouteCircuit.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsArpTableListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsArpTableListResult.java new file mode 100644 index 0000000000000..25e6466bb5e15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsArpTableListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCircuitsArpTableListResult. */ +public interface ExpressRouteCircuitsArpTableListResult { + /** + * Gets the value property: A list of the ARP tables. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitsArpTableListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableListResult.java new file mode 100644 index 0000000000000..250b2134d9cc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCircuitsRoutesTableListResult. */ +public interface ExpressRouteCircuitsRoutesTableListResult { + /** + * Gets the value property: The list of routes table. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitsRoutesTableListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableSummaryListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableSummaryListResult.java new file mode 100644 index 0000000000000..a99488a7585d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableSummaryListResult.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCircuitsRoutesTableSummaryListResult. */ +public interface ExpressRouteCircuitsRoutesTableSummaryListResult { + /** + * Gets the value property: A list of the routes table. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner + * object. + * + * @return the inner object. + */ + ExpressRouteCircuitsRoutesTableSummaryListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnection.java new file mode 100644 index 0000000000000..38ecf7bbfefbb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnection.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; + +/** An immutable client-side representation of ExpressRouteConnection. */ +public interface ExpressRouteConnection { + /** + * 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 provisioningState property: The provisioning state of the express route connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the expressRouteCircuitPeering property: The ExpressRoute circuit peering. + * + * @return the expressRouteCircuitPeering value. + */ + ExpressRouteCircuitPeeringId expressRouteCircuitPeering(); + + /** + * Gets the authorizationKey property: Authorization key to establish the connection. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the routingWeight property: The routing weight associated to the connection. + * + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * Gets the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * Gets the expressRouteGatewayBypass property: Enable FastPath to vWan Firewall hub. + * + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * Gets the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + RoutingConfiguration routingConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner object. + * + * @return the inner object. + */ + ExpressRouteConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionId.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionId.java new file mode 100644 index 0000000000000..528ebb92f1414 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionId.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** The ID of the ExpressRouteConnection. */ +@Immutable +public final class ExpressRouteConnectionId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionId.class); + + /* + * The ID of the ExpressRouteConnection. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: The ID of the ExpressRouteConnection. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java new file mode 100644 index 0000000000000..0e014f16c54b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteConnectionList. */ +public interface ExpressRouteConnectionList { + /** + * Gets the value property: The list of ExpressRoute connections. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner object. + * + * @return the inner object. + */ + ExpressRouteConnectionListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java new file mode 100644 index 0000000000000..d9f4be5255f3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; + +/** Resource collection API of ExpressRouteConnections. */ +public interface ExpressRouteConnections { + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters); + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context); + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + ExpressRouteConnection get(String resourceGroupName, String expressRouteGatewayName, String connectionName); + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + Response getWithResponse( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 expressRouteGatewayName, String connectionName); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 expressRouteGatewayName, String connectionName, Context context); + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + ExpressRouteConnectionList list(String resourceGroupName, String expressRouteGatewayName); + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + Response listWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnection.java new file mode 100644 index 0000000000000..cba9bb0eea6da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnection.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRouteCrossConnection. */ +public interface ExpressRouteCrossConnection { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the primaryAzurePort property: The name of the primary port. + * + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * Gets the secondaryAzurePort property: The name of the secondary port. + * + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * Gets the stag property: The identifier of the circuit traffic. + * + * @return the stag value. + */ + Integer stag(); + + /** + * Gets the peeringLocation property: The peering location of the ExpressRoute circuit. + * + * @return the peeringLocation value. + */ + String peeringLocation(); + + /** + * Gets the bandwidthInMbps property: The circuit bandwidth In Mbps. + * + * @return the bandwidthInMbps value. + */ + Integer bandwidthInMbps(); + + /** + * Gets the expressRouteCircuit property: The ExpressRouteCircuit. + * + * @return the expressRouteCircuit value. + */ + ExpressRouteCircuitReference expressRouteCircuit(); + + /** + * Gets the serviceProviderProvisioningState property: The provisioning state of the circuit in the connectivity + * provider system. + * + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * Gets the serviceProviderNotes property: Additional read only notes set by the connectivity provider. + * + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * Gets the provisioningState property: The provisioning state of the express route cross connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the peerings property: The list of peerings. + * + * @return the peerings value. + */ + List peerings(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.ExpressRouteCrossConnectionInner object. + * + * @return the inner object. + */ + ExpressRouteCrossConnectionInner innerModel(); + + /** The entirety of the ExpressRouteCrossConnection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ExpressRouteCrossConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCrossConnection definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ExpressRouteCrossConnection 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 ExpressRouteCrossConnection definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ExpressRouteCrossConnection 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.WithExpressRouteCircuit, + DefinitionStages.WithServiceProviderProvisioningState, + DefinitionStages.WithServiceProviderNotes, + DefinitionStages.WithPeerings { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteCrossConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteCrossConnection create(Context context); + } + /** The stage of the ExpressRouteCrossConnection 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 ExpressRouteCrossConnection definition allowing to specify expressRouteCircuit. */ + interface WithExpressRouteCircuit { + /** + * Specifies the expressRouteCircuit property: The ExpressRouteCircuit.. + * + * @param expressRouteCircuit The ExpressRouteCircuit. + * @return the next definition stage. + */ + WithCreate withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + /** + * The stage of the ExpressRouteCrossConnection definition allowing to specify serviceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies the serviceProviderProvisioningState property: The provisioning state of the circuit in the + * connectivity provider system.. + * + * @param serviceProviderProvisioningState The provisioning state of the circuit in the connectivity + * provider system. + * @return the next definition stage. + */ + WithCreate withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState); + } + /** The stage of the ExpressRouteCrossConnection definition allowing to specify serviceProviderNotes. */ + interface WithServiceProviderNotes { + /** + * Specifies the serviceProviderNotes property: Additional read only notes set by the connectivity + * provider.. + * + * @param serviceProviderNotes Additional read only notes set by the connectivity provider. + * @return the next definition stage. + */ + WithCreate withServiceProviderNotes(String serviceProviderNotes); + } + /** The stage of the ExpressRouteCrossConnection definition allowing to specify peerings. */ + interface WithPeerings { + /** + * Specifies the peerings property: The list of peerings.. + * + * @param peerings The list of peerings. + * @return the next definition stage. + */ + WithCreate withPeerings(List peerings); + } + } + /** + * Begins update for the ExpressRouteCrossConnection resource. + * + * @return the stage of resource update. + */ + ExpressRouteCrossConnection.Update update(); + + /** The template for ExpressRouteCrossConnection update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteCrossConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteCrossConnection apply(Context context); + } + /** The ExpressRouteCrossConnection update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteCrossConnection 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteCrossConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteCrossConnection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionListResult.java new file mode 100644 index 0000000000000..94c149bcf5fc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRouteCrossConnection API service call. */ +@Fluent +public final class ExpressRouteCrossConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionListResult.class); + + /* + * A list of ExpressRouteCrossConnection resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of ExpressRouteCrossConnection resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ExpressRouteCrossConnection resources. + * + * @param value the value value to set. + * @return the ExpressRouteCrossConnectionListResult object itself. + */ + public ExpressRouteCrossConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java new file mode 100644 index 0000000000000..a659710ea0fe4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; + +/** An immutable client-side representation of ExpressRouteCrossConnectionPeering. */ +public interface ExpressRouteCrossConnectionPeering { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the peeringType property: The peering type. + * + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * Gets the state property: The peering state. + * + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * Gets the azureAsn property: The Azure ASN. + * + * @return the azureAsn value. + */ + Integer azureAsn(); + + /** + * Gets the peerAsn property: The peer ASN. + * + * @return the peerAsn value. + */ + Long peerAsn(); + + /** + * Gets the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * Gets the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * Gets the primaryAzurePort property: The primary port. + * + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * Gets the secondaryAzurePort property: The secondary port. + * + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * Gets the sharedKey property: The shared key. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the vlanId property: The VLAN ID. + * + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * Gets the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * Gets the provisioningState property: The provisioning state of the express route cross connection peering + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * Gets the lastModifiedBy property: Who was the last to modify the peering. + * + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * Gets the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner + * object. + * + * @return the inner object. + */ + ExpressRouteCrossConnectionPeeringInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java new file mode 100644 index 0000000000000..95a229f73840a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCrossConnection. */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringList.class); + + /* + * The peerings in an express route cross connection. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The peerings in an express route cross connection. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The peerings in an express route cross connection. + * + * @param value the value value to set. + * @return the ExpressRouteCrossConnectionPeeringList object itself. + */ + public ExpressRouteCrossConnectionPeeringList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeerings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeerings.java new file mode 100644 index 0000000000000..c3bd25cbef943 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeerings.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; + +/** Resource collection API of ExpressRouteCrossConnectionPeerings. */ +public interface ExpressRouteCrossConnectionPeerings { + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + PagedIterable list(String resourceGroupName, String crossConnectionName); + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + PagedIterable list( + String resourceGroupName, String crossConnectionName, Context context); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 crossConnectionName, String peeringName); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 crossConnectionName, String peeringName, Context context); + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + ExpressRouteCrossConnectionPeering get(String resourceGroupName, String crossConnectionName, String peeringName); + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + Response getWithResponse( + String resourceGroupName, String crossConnectionName, String peeringName, Context context); + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + ExpressRouteCrossConnectionPeering createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters); + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + ExpressRouteCrossConnectionPeering createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionRoutesTableSummary.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionRoutesTableSummary.java new file mode 100644 index 0000000000000..4e76e84a59395 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionRoutesTableSummary.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 routes table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCrossConnectionRoutesTableSummary { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionRoutesTableSummary.class); + + /* + * IP address of Neighbor router. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /* + * Autonomous system number. + */ + @JsonProperty(value = "asn") + private Integer asn; + + /* + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /* + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "stateOrPrefixesReceived") + private String stateOrPrefixesReceived; + + /** + * Get the neighbor property: IP address of Neighbor router. + * + * @return the neighbor value. + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set the neighbor property: IP address of Neighbor router. + * + * @param neighbor the neighbor value to set. + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get the asn property: Autonomous system number. + * + * @return the asn value. + */ + public Integer asn() { + return this.asn; + } + + /** + * Set the asn property: Autonomous system number. + * + * @param asn the asn value to set. + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withAsn(Integer asn) { + this.asn = asn; + return this; + } + + /** + * Get the upDown property: The length of time that the BGP session has been in the Established state, or the + * current status if not in the Established state. + * + * @return the upDown value. + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the upDown property: The length of time that the BGP session has been in the Established state, or the + * current status if not in the Established state. + * + * @param upDown the upDown value to set. + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get the stateOrPrefixesReceived property: Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + * + * @return the stateOrPrefixesReceived value. + */ + public String stateOrPrefixesReceived() { + return this.stateOrPrefixesReceived; + } + + /** + * Set the stateOrPrefixesReceived property: Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + * + * @param stateOrPrefixesReceived the stateOrPrefixesReceived value to set. + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withStateOrPrefixesReceived(String stateOrPrefixesReceived) { + this.stateOrPrefixesReceived = stateOrPrefixesReceived; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnections.java new file mode 100644 index 0000000000000..f46bac93385e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnections.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.network.generated.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 ExpressRouteCrossConnections. */ +public interface ExpressRouteCrossConnections { + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + PagedIterable list(); + + /** + * Retrieves all the ExpressRouteCrossConnections 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 response for ListExpressRouteCrossConnection API service call. + */ + PagedIterable list(Context context); + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRouteCrossConnection API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + ExpressRouteCrossConnection getByResourceGroup(String resourceGroupName, String crossConnectionName); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String crossConnectionName, Context context); + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + ExpressRouteCrossConnectionsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + ExpressRouteCrossConnectionsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @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 details about the specified ExpressRouteCrossConnection. + */ + ExpressRouteCrossConnection getById(String id); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @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 details about the specified ExpressRouteCrossConnection. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ExpressRouteCrossConnection resource. + * + * @param name resource name. + * @return the first stage of the new ExpressRouteCrossConnection definition. + */ + ExpressRouteCrossConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java new file mode 100644 index 0000000000000..3fc4c85573dd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCrossConnectionsRoutesTableSummaryListResult. */ +public interface ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + /** + * Gets the value property: A list of the routes table. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner + * object. + * + * @return the inner object. + */ + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateway.java new file mode 100644 index 0000000000000..ad8a1f118415f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateway.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRouteGateway. */ +public interface ExpressRouteGateway { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the autoScaleConfiguration property: Configuration for auto scaling. + * + * @return the autoScaleConfiguration value. + */ + ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration(); + + /** + * Gets the expressRouteConnections property: List of ExpressRoute connections to the ExpressRoute gateway. + * + * @return the expressRouteConnections value. + */ + List expressRouteConnections(); + + /** + * Gets the provisioningState property: The provisioning state of the express route gateway resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the virtualHub property: The Virtual Hub where the ExpressRoute gateway is or will be deployed. + * + * @return the virtualHub value. + */ + VirtualHubId virtualHub(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.ExpressRouteGatewayInner object. + * + * @return the inner object. + */ + ExpressRouteGatewayInner innerModel(); + + /** The entirety of the ExpressRouteGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ExpressRouteGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ExpressRouteGateway 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 ExpressRouteGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ExpressRouteGateway 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.WithAutoScaleConfiguration, + DefinitionStages.WithVirtualHub { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteGateway create(Context context); + } + /** The stage of the ExpressRouteGateway 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 ExpressRouteGateway definition allowing to specify autoScaleConfiguration. */ + interface WithAutoScaleConfiguration { + /** + * Specifies the autoScaleConfiguration property: Configuration for auto scaling.. + * + * @param autoScaleConfiguration Configuration for auto scaling. + * @return the next definition stage. + */ + WithCreate withAutoScaleConfiguration( + ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration); + } + /** The stage of the ExpressRouteGateway definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The Virtual Hub where the ExpressRoute gateway is or will be + * deployed.. + * + * @param virtualHub The Virtual Hub where the ExpressRoute gateway is or will be deployed. + * @return the next definition stage. + */ + WithCreate withVirtualHub(VirtualHubId virtualHub); + } + } + /** + * Begins update for the ExpressRouteGateway resource. + * + * @return the stage of resource update. + */ + ExpressRouteGateway.Update update(); + + /** The template for ExpressRouteGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteGateway apply(Context context); + } + /** The ExpressRouteGateway update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteGateway 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteGateway refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayList.java new file mode 100644 index 0000000000000..56d586f2676c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteGatewayList. */ +public interface ExpressRouteGatewayList { + /** + * Gets the value property: List of ExpressRoute gateways. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner object. + * + * @return the inner object. + */ + ExpressRouteGatewayListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java new file mode 100644 index 0000000000000..9647e53d95d76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.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.network.generated.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; + +/** Configuration for auto scaling. */ +@Fluent +public final class ExpressRouteGatewayPropertiesAutoScaleConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayPropertiesAutoScaleConfiguration.class); + + /* + * Minimum and maximum number of scale units to deploy. + */ + @JsonProperty(value = "bounds") + private ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds; + + /** + * Get the bounds property: Minimum and maximum number of scale units to deploy. + * + * @return the bounds value. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds() { + return this.bounds; + } + + /** + * Set the bounds property: Minimum and maximum number of scale units to deploy. + * + * @param bounds the bounds value to set. + * @return the ExpressRouteGatewayPropertiesAutoScaleConfiguration object itself. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfiguration withBounds( + ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds) { + this.bounds = bounds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bounds() != null) { + bounds().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java new file mode 100644 index 0000000000000..34eece58b4595 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Minimum and maximum number of scale units to deploy. */ +@Fluent +public final class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.class); + + /* + * Minimum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "min") + private Integer min; + + /* + * Maximum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "max") + private Integer max; + + /** + * Get the min property: Minimum number of scale units deployed for ExpressRoute gateway. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: Minimum number of scale units deployed for ExpressRoute gateway. + * + * @param min the min value to set. + * @return the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds object itself. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Get the max property: Maximum number of scale units deployed for ExpressRoute gateway. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: Maximum number of scale units deployed for ExpressRoute gateway. + * + * @param max the max value to set. + * @return the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds object itself. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateways.java new file mode 100644 index 0000000000000..d504b8b415936 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateways.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.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteGateways. */ +public interface ExpressRouteGateways { + /** + * Lists ExpressRoute gateways under a given 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 list of ExpressRoute gateways. + */ + ExpressRouteGatewayList listBySubscription(); + + /** + * Lists ExpressRoute gateways under a given 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 list of ExpressRoute gateways. + */ + Response listBySubscriptionWithResponse(Context context); + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource 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 list of ExpressRoute gateways. + */ + ExpressRouteGatewayList listByResourceGroup(String resourceGroupName); + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource 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 list of ExpressRoute gateways. + */ + Response listByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + ExpressRouteGateway getByResourceGroup(String resourceGroupName, String expressRouteGatewayName); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 gateway resource. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 expressRouteGatewayName); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 expressRouteGatewayName, Context context); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @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 expressRoute gateway resource. + */ + ExpressRouteGateway getById(String id); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @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 expressRoute gateway resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @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 ExpressRouteGateway resource. + * + * @param name resource name. + * @return the first stage of the new ExpressRouteGateway definition. + */ + ExpressRouteGateway.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLink.java new file mode 100644 index 0000000000000..dad3186fae6fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLink.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; + +/** An immutable client-side representation of ExpressRouteLink. */ +public interface ExpressRouteLink { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of child port resource that is unique among child port resources of the parent. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the routerName property: Name of Azure router associated with physical port. + * + * @return the routerName value. + */ + String routerName(); + + /** + * Gets the interfaceName property: Name of Azure router interface. + * + * @return the interfaceName value. + */ + String interfaceName(); + + /** + * Gets the patchPanelId property: Mapping between physical port to patch panel port. + * + * @return the patchPanelId value. + */ + String patchPanelId(); + + /** + * Gets the rackId property: Mapping of physical patch panel to rack. + * + * @return the rackId value. + */ + String rackId(); + + /** + * Gets the connectorType property: Physical fiber port type. + * + * @return the connectorType value. + */ + ExpressRouteLinkConnectorType connectorType(); + + /** + * Gets the adminState property: Administrative state of the physical port. + * + * @return the adminState value. + */ + ExpressRouteLinkAdminState adminState(); + + /** + * Gets the provisioningState property: The provisioning state of the express route link resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the macSecConfig property: MacSec configuration. + * + * @return the macSecConfig value. + */ + ExpressRouteLinkMacSecConfig macSecConfig(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner object. + * + * @return the inner object. + */ + ExpressRouteLinkInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkAdminState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkAdminState.java new file mode 100644 index 0000000000000..bef1094d29933 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkAdminState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteLinkAdminState. */ +public final class ExpressRouteLinkAdminState extends ExpandableStringEnum { + /** Static value Enabled for ExpressRouteLinkAdminState. */ + public static final ExpressRouteLinkAdminState ENABLED = fromString("Enabled"); + + /** Static value Disabled for ExpressRouteLinkAdminState. */ + public static final ExpressRouteLinkAdminState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ExpressRouteLinkAdminState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkAdminState. + */ + @JsonCreator + public static ExpressRouteLinkAdminState fromString(String name) { + return fromString(name, ExpressRouteLinkAdminState.class); + } + + /** @return known ExpressRouteLinkAdminState values. */ + public static Collection values() { + return values(ExpressRouteLinkAdminState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkConnectorType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkConnectorType.java new file mode 100644 index 0000000000000..ebdf087fed0c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkConnectorType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteLinkConnectorType. */ +public final class ExpressRouteLinkConnectorType extends ExpandableStringEnum { + /** Static value LC for ExpressRouteLinkConnectorType. */ + public static final ExpressRouteLinkConnectorType LC = fromString("LC"); + + /** Static value SC for ExpressRouteLinkConnectorType. */ + public static final ExpressRouteLinkConnectorType SC = fromString("SC"); + + /** + * Creates or finds a ExpressRouteLinkConnectorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkConnectorType. + */ + @JsonCreator + public static ExpressRouteLinkConnectorType fromString(String name) { + return fromString(name, ExpressRouteLinkConnectorType.class); + } + + /** @return known ExpressRouteLinkConnectorType values. */ + public static Collection values() { + return values(ExpressRouteLinkConnectorType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkListResult.java new file mode 100644 index 0000000000000..6af63932975aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRouteLinks API service call. */ +@Fluent +public final class ExpressRouteLinkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkListResult.class); + + /* + * The list of ExpressRouteLink sub-resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of ExpressRouteLink sub-resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of ExpressRouteLink sub-resources. + * + * @param value the value value to set. + * @return the ExpressRouteLinkListResult object itself. + */ + public ExpressRouteLinkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteLinkListResult object itself. + */ + public ExpressRouteLinkListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecCipher.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecCipher.java new file mode 100644 index 0000000000000..c2ae1efdeebc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecCipher.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteLinkMacSecCipher. */ +public final class ExpressRouteLinkMacSecCipher extends ExpandableStringEnum { + /** Static value GcmAes256 for ExpressRouteLinkMacSecCipher. */ + public static final ExpressRouteLinkMacSecCipher GCM_AES256 = fromString("GcmAes256"); + + /** Static value GcmAes128 for ExpressRouteLinkMacSecCipher. */ + public static final ExpressRouteLinkMacSecCipher GCM_AES128 = fromString("GcmAes128"); + + /** Static value GcmAesXpn128 for ExpressRouteLinkMacSecCipher. */ + public static final ExpressRouteLinkMacSecCipher GCM_AES_XPN128 = fromString("GcmAesXpn128"); + + /** Static value GcmAesXpn256 for ExpressRouteLinkMacSecCipher. */ + public static final ExpressRouteLinkMacSecCipher GCM_AES_XPN256 = fromString("GcmAesXpn256"); + + /** + * Creates or finds a ExpressRouteLinkMacSecCipher from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkMacSecCipher. + */ + @JsonCreator + public static ExpressRouteLinkMacSecCipher fromString(String name) { + return fromString(name, ExpressRouteLinkMacSecCipher.class); + } + + /** @return known ExpressRouteLinkMacSecCipher values. */ + public static Collection values() { + return values(ExpressRouteLinkMacSecCipher.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecConfig.java new file mode 100644 index 0000000000000..268538f1108e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecConfig.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** ExpressRouteLink Mac Security Configuration. */ +@Fluent +public final class ExpressRouteLinkMacSecConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkMacSecConfig.class); + + /* + * Keyvault Secret Identifier URL containing Mac security CKN key. + */ + @JsonProperty(value = "cknSecretIdentifier") + private String cknSecretIdentifier; + + /* + * Keyvault Secret Identifier URL containing Mac security CAK key. + */ + @JsonProperty(value = "cakSecretIdentifier") + private String cakSecretIdentifier; + + /* + * Mac security cipher. + */ + @JsonProperty(value = "cipher") + private ExpressRouteLinkMacSecCipher cipher; + + /* + * Sci mode enabled/disabled. + */ + @JsonProperty(value = "sciState") + private ExpressRouteLinkMacSecSciState sciState; + + /** + * Get the cknSecretIdentifier property: Keyvault Secret Identifier URL containing Mac security CKN key. + * + * @return the cknSecretIdentifier value. + */ + public String cknSecretIdentifier() { + return this.cknSecretIdentifier; + } + + /** + * Set the cknSecretIdentifier property: Keyvault Secret Identifier URL containing Mac security CKN key. + * + * @param cknSecretIdentifier the cknSecretIdentifier value to set. + * @return the ExpressRouteLinkMacSecConfig object itself. + */ + public ExpressRouteLinkMacSecConfig withCknSecretIdentifier(String cknSecretIdentifier) { + this.cknSecretIdentifier = cknSecretIdentifier; + return this; + } + + /** + * Get the cakSecretIdentifier property: Keyvault Secret Identifier URL containing Mac security CAK key. + * + * @return the cakSecretIdentifier value. + */ + public String cakSecretIdentifier() { + return this.cakSecretIdentifier; + } + + /** + * Set the cakSecretIdentifier property: Keyvault Secret Identifier URL containing Mac security CAK key. + * + * @param cakSecretIdentifier the cakSecretIdentifier value to set. + * @return the ExpressRouteLinkMacSecConfig object itself. + */ + public ExpressRouteLinkMacSecConfig withCakSecretIdentifier(String cakSecretIdentifier) { + this.cakSecretIdentifier = cakSecretIdentifier; + return this; + } + + /** + * Get the cipher property: Mac security cipher. + * + * @return the cipher value. + */ + public ExpressRouteLinkMacSecCipher cipher() { + return this.cipher; + } + + /** + * Set the cipher property: Mac security cipher. + * + * @param cipher the cipher value to set. + * @return the ExpressRouteLinkMacSecConfig object itself. + */ + public ExpressRouteLinkMacSecConfig withCipher(ExpressRouteLinkMacSecCipher cipher) { + this.cipher = cipher; + return this; + } + + /** + * Get the sciState property: Sci mode enabled/disabled. + * + * @return the sciState value. + */ + public ExpressRouteLinkMacSecSciState sciState() { + return this.sciState; + } + + /** + * Set the sciState property: Sci mode enabled/disabled. + * + * @param sciState the sciState value to set. + * @return the ExpressRouteLinkMacSecConfig object itself. + */ + public ExpressRouteLinkMacSecConfig withSciState(ExpressRouteLinkMacSecSciState sciState) { + this.sciState = sciState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecSciState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecSciState.java new file mode 100644 index 0000000000000..5930d7e7d0bf1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecSciState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteLinkMacSecSciState. */ +public final class ExpressRouteLinkMacSecSciState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRouteLinkMacSecSciState. */ + public static final ExpressRouteLinkMacSecSciState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRouteLinkMacSecSciState. */ + public static final ExpressRouteLinkMacSecSciState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRouteLinkMacSecSciState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkMacSecSciState. + */ + @JsonCreator + public static ExpressRouteLinkMacSecSciState fromString(String name) { + return fromString(name, ExpressRouteLinkMacSecSciState.class); + } + + /** @return known ExpressRouteLinkMacSecSciState values. */ + public static Collection values() { + return values(ExpressRouteLinkMacSecSciState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinks.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinks.java new file mode 100644 index 0000000000000..2851552c8ab46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinks.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.network.generated.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 ExpressRouteLinks. */ +public interface ExpressRouteLinks { + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink child resource definition. + */ + ExpressRouteLink get(String resourceGroupName, String expressRoutePortName, String linkName); + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink child resource definition. + */ + Response getWithResponse( + String resourceGroupName, String expressRoutePortName, String linkName, Context context); + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + PagedIterable list(String resourceGroupName, String expressRoutePortName); + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteLinks API service call. + */ + PagedIterable list(String resourceGroupName, String expressRoutePortName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringState.java new file mode 100644 index 0000000000000..08bb4ee329753 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRoutePeeringState. */ +public final class ExpressRoutePeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRoutePeeringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePeeringState. + */ + @JsonCreator + public static ExpressRoutePeeringState fromString(String name) { + return fromString(name, ExpressRoutePeeringState.class); + } + + /** @return known ExpressRoutePeeringState values. */ + public static Collection values() { + return values(ExpressRoutePeeringState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringType.java new file mode 100644 index 0000000000000..b5e9954a14fbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRoutePeeringType. */ +public final class ExpressRoutePeeringType extends ExpandableStringEnum { + /** Static value AzurePublicPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PUBLIC_PEERING = fromString("AzurePublicPeering"); + + /** Static value AzurePrivatePeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PRIVATE_PEERING = fromString("AzurePrivatePeering"); + + /** Static value MicrosoftPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType MICROSOFT_PEERING = fromString("MicrosoftPeering"); + + /** + * Creates or finds a ExpressRoutePeeringType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePeeringType. + */ + @JsonCreator + public static ExpressRoutePeeringType fromString(String name) { + return fromString(name, ExpressRoutePeeringType.class); + } + + /** @return known ExpressRoutePeeringType values. */ + public static Collection values() { + return values(ExpressRoutePeeringType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePort.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePort.java new file mode 100644 index 0000000000000..f5df0e83b8960 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePort.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRoutePort. */ +public interface ExpressRoutePort { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the identity property: The identity of ExpressRoutePort, if configured. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the peeringLocation property: The name of the peering location that the ExpressRoutePort is mapped to + * physically. + * + * @return the peeringLocation value. + */ + String peeringLocation(); + + /** + * Gets the bandwidthInGbps property: Bandwidth of procured ports in Gbps. + * + * @return the bandwidthInGbps value. + */ + Integer bandwidthInGbps(); + + /** + * Gets the provisionedBandwidthInGbps property: Aggregate Gbps of associated circuit bandwidths. + * + * @return the provisionedBandwidthInGbps value. + */ + Float provisionedBandwidthInGbps(); + + /** + * Gets the mtu property: Maximum transmission unit of the physical port pair(s). + * + * @return the mtu value. + */ + String mtu(); + + /** + * Gets the encapsulation property: Encapsulation method on physical ports. + * + * @return the encapsulation value. + */ + ExpressRoutePortsEncapsulation encapsulation(); + + /** + * Gets the etherType property: Ether type of the physical port. + * + * @return the etherType value. + */ + String etherType(); + + /** + * Gets the allocationDate property: Date of the physical port allocation to be used in Letter of Authorization. + * + * @return the allocationDate value. + */ + String allocationDate(); + + /** + * Gets the links property: The set of physical links of the ExpressRoutePort resource. + * + * @return the links value. + */ + List links(); + + /** + * Gets the circuits property: Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort + * resource. + * + * @return the circuits value. + */ + List circuits(); + + /** + * Gets the provisioningState property: The provisioning state of the express route port resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: The resource GUID property of the express route port resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.ExpressRoutePortInner object. + * + * @return the inner object. + */ + ExpressRoutePortInner innerModel(); + + /** The entirety of the ExpressRoutePort definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ExpressRoutePort definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRoutePort definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ExpressRoutePort 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 ExpressRoutePort definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ExpressRoutePort definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithPeeringLocation, + DefinitionStages.WithBandwidthInGbps, + DefinitionStages.WithEncapsulation, + DefinitionStages.WithLinks { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRoutePort create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRoutePort create(Context context); + } + /** The stage of the ExpressRoutePort 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 ExpressRoutePort definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of ExpressRoutePort, if configured.. + * + * @param identity The identity of ExpressRoutePort, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the ExpressRoutePort definition allowing to specify peeringLocation. */ + interface WithPeeringLocation { + /** + * Specifies the peeringLocation property: The name of the peering location that the ExpressRoutePort is + * mapped to physically.. + * + * @param peeringLocation The name of the peering location that the ExpressRoutePort is mapped to + * physically. + * @return the next definition stage. + */ + WithCreate withPeeringLocation(String peeringLocation); + } + /** The stage of the ExpressRoutePort definition allowing to specify bandwidthInGbps. */ + interface WithBandwidthInGbps { + /** + * Specifies the bandwidthInGbps property: Bandwidth of procured ports in Gbps.. + * + * @param bandwidthInGbps Bandwidth of procured ports in Gbps. + * @return the next definition stage. + */ + WithCreate withBandwidthInGbps(Integer bandwidthInGbps); + } + /** The stage of the ExpressRoutePort definition allowing to specify encapsulation. */ + interface WithEncapsulation { + /** + * Specifies the encapsulation property: Encapsulation method on physical ports.. + * + * @param encapsulation Encapsulation method on physical ports. + * @return the next definition stage. + */ + WithCreate withEncapsulation(ExpressRoutePortsEncapsulation encapsulation); + } + /** The stage of the ExpressRoutePort definition allowing to specify links. */ + interface WithLinks { + /** + * Specifies the links property: The set of physical links of the ExpressRoutePort resource.. + * + * @param links The set of physical links of the ExpressRoutePort resource. + * @return the next definition stage. + */ + WithCreate withLinks(List links); + } + } + /** + * Begins update for the ExpressRoutePort resource. + * + * @return the stage of resource update. + */ + ExpressRoutePort.Update update(); + + /** The template for ExpressRoutePort update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRoutePort apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRoutePort apply(Context context); + } + /** The ExpressRoutePort update stages. */ + interface UpdateStages { + /** The stage of the ExpressRoutePort 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRoutePort refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRoutePort refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortListResult.java new file mode 100644 index 0000000000000..14d29ebdf8ad8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRoutePorts API service call. */ +@Fluent +public final class ExpressRoutePortListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortListResult.class); + + /* + * A list of ExpressRoutePort resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of ExpressRoutePort resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ExpressRoutePort resources. + * + * @param value the value value to set. + * @return the ExpressRoutePortListResult object itself. + */ + public ExpressRoutePortListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRoutePortListResult object itself. + */ + public ExpressRoutePortListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePorts.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePorts.java new file mode 100644 index 0000000000000..e7f9f9c6e8ac3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePorts.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 ExpressRoutePorts. */ +public interface ExpressRoutePorts { + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String expressRoutePortName); + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String expressRoutePortName, Context context); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + ExpressRoutePort getByResourceGroup(String resourceGroupName, String expressRoutePortName); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRoutePortName, Context context); + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListExpressRoutePorts API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + PagedIterable list(); + + /** + * List all the ExpressRoutePort resources in the specified 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 response for ListExpressRoutePorts API service call. + */ + PagedIterable list(Context context); + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of 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 response for GenerateExpressRoutePortsLOA API service call. + */ + GenerateExpressRoutePortsLoaResult generateLoa( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request); + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of 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 response for GenerateExpressRoutePortsLOA API service call. + */ + Response generateLoaWithResponse( + String resourceGroupName, + String expressRoutePortName, + GenerateExpressRoutePortsLoaRequest request, + Context context); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + ExpressRoutePort getById(String id); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePort resource definition. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ExpressRoutePort resource. + * + * @param name resource name. + * @return the first stage of the new ExpressRoutePort definition. + */ + ExpressRoutePort.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsEncapsulation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsEncapsulation.java new file mode 100644 index 0000000000000..529fec434dfc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsEncapsulation.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRoutePortsEncapsulation. */ +public final class ExpressRoutePortsEncapsulation extends ExpandableStringEnum { + /** Static value Dot1Q for ExpressRoutePortsEncapsulation. */ + public static final ExpressRoutePortsEncapsulation DOT1Q = fromString("Dot1Q"); + + /** Static value QinQ for ExpressRoutePortsEncapsulation. */ + public static final ExpressRoutePortsEncapsulation QINQ = fromString("QinQ"); + + /** + * Creates or finds a ExpressRoutePortsEncapsulation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePortsEncapsulation. + */ + @JsonCreator + public static ExpressRoutePortsEncapsulation fromString(String name) { + return fromString(name, ExpressRoutePortsEncapsulation.class); + } + + /** @return known ExpressRoutePortsEncapsulation values. */ + public static Collection values() { + return values(ExpressRoutePortsEncapsulation.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocation.java new file mode 100644 index 0000000000000..4fb94daec4a89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocation.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRoutePortsLocation. */ +public interface ExpressRoutePortsLocation { + /** + * 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 address property: Address of peering location. + * + * @return the address value. + */ + String address(); + + /** + * Gets the contact property: Contact details of peering locations. + * + * @return the contact value. + */ + String contact(); + + /** + * Gets the availableBandwidths property: The inventory of available ExpressRoutePort bandwidths. + * + * @return the availableBandwidths value. + */ + List availableBandwidths(); + + /** + * Gets the provisioningState property: The provisioning state of the express route port location resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner object. + * + * @return the inner object. + */ + ExpressRoutePortsLocationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationBandwidths.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationBandwidths.java new file mode 100644 index 0000000000000..7c8e049f65a56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationBandwidths.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.network.generated.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; + +/** Real-time inventory of available ExpressRoute port bandwidths. */ +@Immutable +public final class ExpressRoutePortsLocationBandwidths { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationBandwidths.class); + + /* + * Bandwidth descriptive name. + */ + @JsonProperty(value = "offerName", access = JsonProperty.Access.WRITE_ONLY) + private String offerName; + + /* + * Bandwidth value in Gbps. + */ + @JsonProperty(value = "valueInGbps", access = JsonProperty.Access.WRITE_ONLY) + private Integer valueInGbps; + + /** + * Get the offerName property: Bandwidth descriptive name. + * + * @return the offerName value. + */ + public String offerName() { + return this.offerName; + } + + /** + * Get the valueInGbps property: Bandwidth value in Gbps. + * + * @return the valueInGbps value. + */ + public Integer valueInGbps() { + return this.valueInGbps; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationListResult.java new file mode 100644 index 0000000000000..d0bf886a8ab37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRoutePortsLocations API service call. */ +@Fluent +public final class ExpressRoutePortsLocationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationListResult.class); + + /* + * The list of all ExpressRoutePort peering locations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of all ExpressRoutePort peering locations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of all ExpressRoutePort peering locations. + * + * @param value the value value to set. + * @return the ExpressRoutePortsLocationListResult object itself. + */ + public ExpressRoutePortsLocationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRoutePortsLocationListResult object itself. + */ + public ExpressRoutePortsLocationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocations.java new file mode 100644 index 0000000000000..009aeea59ae48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocations.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.network.generated.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 ExpressRoutePortsLocations. */ +public interface ExpressRoutePortsLocations { + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + PagedIterable list(); + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRoutePortsLocations API service call. + */ + PagedIterable list(Context context); + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the ExpressRoutePorts peering location resource. + */ + ExpressRoutePortsLocation get(String locationName); + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the ExpressRoutePorts peering location resource. + */ + Response getWithResponse(String locationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProvider.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProvider.java new file mode 100644 index 0000000000000..74088a4e2e0e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProvider.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRouteServiceProvider. */ +public interface ExpressRouteServiceProvider { + /** + * 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 peeringLocations property: A list of peering locations. + * + * @return the peeringLocations value. + */ + List peeringLocations(); + + /** + * Gets the bandwidthsOffered property: A list of bandwidths offered. + * + * @return the bandwidthsOffered value. + */ + List bandwidthsOffered(); + + /** + * Gets the provisioningState property: The provisioning state of the express route service provider resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner object. + * + * @return the inner object. + */ + ExpressRouteServiceProviderInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderBandwidthsOffered.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderBandwidthsOffered.java new file mode 100644 index 0000000000000..742467efbc5f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderBandwidthsOffered.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.network.generated.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; + +/** Contains bandwidths offered in ExpressRouteServiceProvider resources. */ +@Fluent +public final class ExpressRouteServiceProviderBandwidthsOffered { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderBandwidthsOffered.class); + + /* + * The OfferName. + */ + @JsonProperty(value = "offerName") + private String offerName; + + /* + * The ValueInMbps. + */ + @JsonProperty(value = "valueInMbps") + private Integer valueInMbps; + + /** + * Get the offerName property: The OfferName. + * + * @return the offerName value. + */ + public String offerName() { + return this.offerName; + } + + /** + * Set the offerName property: The OfferName. + * + * @param offerName the offerName value to set. + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withOfferName(String offerName) { + this.offerName = offerName; + return this; + } + + /** + * Get the valueInMbps property: The ValueInMbps. + * + * @return the valueInMbps value. + */ + public Integer valueInMbps() { + return this.valueInMbps; + } + + /** + * Set the valueInMbps property: The ValueInMbps. + * + * @param valueInMbps the valueInMbps value to set. + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withValueInMbps(Integer valueInMbps) { + this.valueInMbps = valueInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderListResult.java new file mode 100644 index 0000000000000..7d4b031dca8ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListExpressRouteServiceProvider API service call. */ +@Fluent +public final class ExpressRouteServiceProviderListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderListResult.class); + + /* + * A list of ExpressRouteResourceProvider resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of ExpressRouteResourceProvider resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ExpressRouteResourceProvider resources. + * + * @param value the value value to set. + * @return the ExpressRouteServiceProviderListResult object itself. + */ + public ExpressRouteServiceProviderListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteServiceProviderListResult object itself. + */ + public ExpressRouteServiceProviderListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviders.java new file mode 100644 index 0000000000000..88602f86e5522 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviders.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteServiceProviders. */ +public interface ExpressRouteServiceProviders { + /** + * Gets all the available express route service providers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + PagedIterable list(); + + /** + * Gets all the available express route service providers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocation.java new file mode 100644 index 0000000000000..188b68168608f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocation.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.network.generated.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; + +/** ExtendedLocation complex type. */ +@Fluent +public final class ExtendedLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedLocation.class); + + /* + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type property: The type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocationTypes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocationTypes.java new file mode 100644 index 0000000000000..6a9fa9df2b881 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocationTypes.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtendedLocationTypes. */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + @JsonCreator + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** @return known ExtendedLocationTypes values. */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicies.java new file mode 100644 index 0000000000000..0b49962a7394e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicies.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 FirewallPolicies. */ +public interface FirewallPolicies { + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 firewallPolicyName); + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 firewallPolicyName, Context context); + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + FirewallPolicy getByResourceGroup(String resourceGroupName, String firewallPolicyName); + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String firewallPolicyName, String expand, Context context); + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListFirewallPolicies API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Firewall Policies 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 all the Firewall Policies in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Firewall Policy. + * + * @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 the specified Firewall Policy. + */ + FirewallPolicy getById(String id); + + /** + * Gets the specified Firewall Policy. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified Firewall Policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Firewall Policy. + * + * @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 FirewallPolicy resource. + * + * @param name resource name. + * @return the first stage of the new FirewallPolicy definition. + */ + FirewallPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicy.java new file mode 100644 index 0000000000000..14780a050bd2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicy.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of FirewallPolicy. */ +public interface FirewallPolicy { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the identity property: The identity of the firewall policy. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the ruleCollectionGroups property: List of references to FirewallPolicyRuleCollectionGroups. + * + * @return the ruleCollectionGroups value. + */ + List ruleCollectionGroups(); + + /** + * Gets the provisioningState property: The provisioning state of the firewall policy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the basePolicy property: The parent firewall policy from which rules are inherited. + * + * @return the basePolicy value. + */ + SubResource basePolicy(); + + /** + * Gets the firewalls property: List of references to Azure Firewalls that this Firewall Policy is associated with. + * + * @return the firewalls value. + */ + List firewalls(); + + /** + * Gets the childPolicies property: List of references to Child Firewall Policies. + * + * @return the childPolicies value. + */ + List childPolicies(); + + /** + * Gets the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @return the threatIntelMode value. + */ + AzureFirewallThreatIntelMode threatIntelMode(); + + /** + * Gets the threatIntelWhitelist property: ThreatIntel Whitelist for Firewall Policy. + * + * @return the threatIntelWhitelist value. + */ + FirewallPolicyThreatIntelWhitelist threatIntelWhitelist(); + + /** + * Gets the insights property: Insights on Firewall Policy. + * + * @return the insights value. + */ + FirewallPolicyInsights insights(); + + /** + * Gets the snat property: The private IP addresses/IP ranges to which traffic will not be SNAT. + * + * @return the snat value. + */ + FirewallPolicySnat snat(); + + /** + * Gets the dnsSettings property: DNS Proxy Settings definition. + * + * @return the dnsSettings value. + */ + DnsSettings dnsSettings(); + + /** + * Gets the intrusionDetection property: The configuration for Intrusion detection. + * + * @return the intrusionDetection value. + */ + FirewallPolicyIntrusionDetection intrusionDetection(); + + /** + * Gets the transportSecurity property: TLS Configuration definition. + * + * @return the transportSecurity value. + */ + FirewallPolicyTransportSecurity transportSecurity(); + + /** + * Gets the sku property: The Firewall Policy SKU. + * + * @return the sku value. + */ + FirewallPolicySku sku(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.FirewallPolicyInner object. + * + * @return the inner object. + */ + FirewallPolicyInner innerModel(); + + /** The entirety of the FirewallPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The FirewallPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the FirewallPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the FirewallPolicy 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 FirewallPolicy definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the FirewallPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithBasePolicy, + DefinitionStages.WithThreatIntelMode, + DefinitionStages.WithThreatIntelWhitelist, + DefinitionStages.WithInsights, + DefinitionStages.WithSnat, + DefinitionStages.WithDnsSettings, + DefinitionStages.WithIntrusionDetection, + DefinitionStages.WithTransportSecurity, + DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + FirewallPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FirewallPolicy create(Context context); + } + /** The stage of the FirewallPolicy 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 FirewallPolicy definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the firewall policy.. + * + * @param identity The identity of the firewall policy. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the FirewallPolicy definition allowing to specify basePolicy. */ + interface WithBasePolicy { + /** + * Specifies the basePolicy property: The parent firewall policy from which rules are inherited.. + * + * @param basePolicy The parent firewall policy from which rules are inherited. + * @return the next definition stage. + */ + WithCreate withBasePolicy(SubResource basePolicy); + } + /** The stage of the FirewallPolicy definition allowing to specify threatIntelMode. */ + interface WithThreatIntelMode { + /** + * Specifies the threatIntelMode property: The operation mode for Threat Intelligence.. + * + * @param threatIntelMode The operation mode for Threat Intelligence. + * @return the next definition stage. + */ + WithCreate withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode); + } + /** The stage of the FirewallPolicy definition allowing to specify threatIntelWhitelist. */ + interface WithThreatIntelWhitelist { + /** + * Specifies the threatIntelWhitelist property: ThreatIntel Whitelist for Firewall Policy.. + * + * @param threatIntelWhitelist ThreatIntel Whitelist for Firewall Policy. + * @return the next definition stage. + */ + WithCreate withThreatIntelWhitelist(FirewallPolicyThreatIntelWhitelist threatIntelWhitelist); + } + /** The stage of the FirewallPolicy definition allowing to specify insights. */ + interface WithInsights { + /** + * Specifies the insights property: Insights on Firewall Policy.. + * + * @param insights Insights on Firewall Policy. + * @return the next definition stage. + */ + WithCreate withInsights(FirewallPolicyInsights insights); + } + /** The stage of the FirewallPolicy definition allowing to specify snat. */ + interface WithSnat { + /** + * Specifies the snat property: The private IP addresses/IP ranges to which traffic will not be SNAT.. + * + * @param snat The private IP addresses/IP ranges to which traffic will not be SNAT. + * @return the next definition stage. + */ + WithCreate withSnat(FirewallPolicySnat snat); + } + /** The stage of the FirewallPolicy definition allowing to specify dnsSettings. */ + interface WithDnsSettings { + /** + * Specifies the dnsSettings property: DNS Proxy Settings definition.. + * + * @param dnsSettings DNS Proxy Settings definition. + * @return the next definition stage. + */ + WithCreate withDnsSettings(DnsSettings dnsSettings); + } + /** The stage of the FirewallPolicy definition allowing to specify intrusionDetection. */ + interface WithIntrusionDetection { + /** + * Specifies the intrusionDetection property: The configuration for Intrusion detection.. + * + * @param intrusionDetection The configuration for Intrusion detection. + * @return the next definition stage. + */ + WithCreate withIntrusionDetection(FirewallPolicyIntrusionDetection intrusionDetection); + } + /** The stage of the FirewallPolicy definition allowing to specify transportSecurity. */ + interface WithTransportSecurity { + /** + * Specifies the transportSecurity property: TLS Configuration definition.. + * + * @param transportSecurity TLS Configuration definition. + * @return the next definition stage. + */ + WithCreate withTransportSecurity(FirewallPolicyTransportSecurity transportSecurity); + } + /** The stage of the FirewallPolicy definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Firewall Policy SKU.. + * + * @param sku The Firewall Policy SKU. + * @return the next definition stage. + */ + WithCreate withSku(FirewallPolicySku sku); + } + } + /** + * Begins update for the FirewallPolicy resource. + * + * @return the stage of resource update. + */ + FirewallPolicy.Update update(); + + /** The template for FirewallPolicy update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithBasePolicy, + UpdateStages.WithThreatIntelMode, + UpdateStages.WithThreatIntelWhitelist, + UpdateStages.WithInsights, + UpdateStages.WithSnat, + UpdateStages.WithDnsSettings, + UpdateStages.WithIntrusionDetection, + UpdateStages.WithTransportSecurity, + UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FirewallPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FirewallPolicy apply(Context context); + } + /** The FirewallPolicy update stages. */ + interface UpdateStages { + /** The stage of the FirewallPolicy 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 FirewallPolicy update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the firewall policy.. + * + * @param identity The identity of the firewall policy. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the FirewallPolicy update allowing to specify basePolicy. */ + interface WithBasePolicy { + /** + * Specifies the basePolicy property: The parent firewall policy from which rules are inherited.. + * + * @param basePolicy The parent firewall policy from which rules are inherited. + * @return the next definition stage. + */ + Update withBasePolicy(SubResource basePolicy); + } + /** The stage of the FirewallPolicy update allowing to specify threatIntelMode. */ + interface WithThreatIntelMode { + /** + * Specifies the threatIntelMode property: The operation mode for Threat Intelligence.. + * + * @param threatIntelMode The operation mode for Threat Intelligence. + * @return the next definition stage. + */ + Update withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode); + } + /** The stage of the FirewallPolicy update allowing to specify threatIntelWhitelist. */ + interface WithThreatIntelWhitelist { + /** + * Specifies the threatIntelWhitelist property: ThreatIntel Whitelist for Firewall Policy.. + * + * @param threatIntelWhitelist ThreatIntel Whitelist for Firewall Policy. + * @return the next definition stage. + */ + Update withThreatIntelWhitelist(FirewallPolicyThreatIntelWhitelist threatIntelWhitelist); + } + /** The stage of the FirewallPolicy update allowing to specify insights. */ + interface WithInsights { + /** + * Specifies the insights property: Insights on Firewall Policy.. + * + * @param insights Insights on Firewall Policy. + * @return the next definition stage. + */ + Update withInsights(FirewallPolicyInsights insights); + } + /** The stage of the FirewallPolicy update allowing to specify snat. */ + interface WithSnat { + /** + * Specifies the snat property: The private IP addresses/IP ranges to which traffic will not be SNAT.. + * + * @param snat The private IP addresses/IP ranges to which traffic will not be SNAT. + * @return the next definition stage. + */ + Update withSnat(FirewallPolicySnat snat); + } + /** The stage of the FirewallPolicy update allowing to specify dnsSettings. */ + interface WithDnsSettings { + /** + * Specifies the dnsSettings property: DNS Proxy Settings definition.. + * + * @param dnsSettings DNS Proxy Settings definition. + * @return the next definition stage. + */ + Update withDnsSettings(DnsSettings dnsSettings); + } + /** The stage of the FirewallPolicy update allowing to specify intrusionDetection. */ + interface WithIntrusionDetection { + /** + * Specifies the intrusionDetection property: The configuration for Intrusion detection.. + * + * @param intrusionDetection The configuration for Intrusion detection. + * @return the next definition stage. + */ + Update withIntrusionDetection(FirewallPolicyIntrusionDetection intrusionDetection); + } + /** The stage of the FirewallPolicy update allowing to specify transportSecurity. */ + interface WithTransportSecurity { + /** + * Specifies the transportSecurity property: TLS Configuration definition.. + * + * @param transportSecurity TLS Configuration definition. + * @return the next definition stage. + */ + Update withTransportSecurity(FirewallPolicyTransportSecurity transportSecurity); + } + /** The stage of the FirewallPolicy update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Firewall Policy SKU.. + * + * @param sku The Firewall Policy SKU. + * @return the next definition stage. + */ + Update withSku(FirewallPolicySku sku); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FirewallPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FirewallPolicy refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.java new file mode 100644 index 0000000000000..ba8348b2a4133 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Trusted Root certificates properties for tls. */ +@Fluent +public final class FirewallPolicyCertificateAuthority { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyCertificateAuthority.class); + + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + */ + @JsonProperty(value = "keyVaultSecretId") + private String keyVaultSecretId; + + /* + * Name of the CA certificate. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + * + * @return the keyVaultSecretId value. + */ + public String keyVaultSecretId() { + return this.keyVaultSecretId; + } + + /** + * Set the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + * + * @param keyVaultSecretId the keyVaultSecretId value to set. + * @return the FirewallPolicyCertificateAuthority object itself. + */ + public FirewallPolicyCertificateAuthority withKeyVaultSecretId(String keyVaultSecretId) { + this.keyVaultSecretId = keyVaultSecretId; + return this; + } + + /** + * Get the name property: Name of the CA certificate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the CA certificate. + * + * @param name the name value to set. + * @return the FirewallPolicyCertificateAuthority object itself. + */ + public FirewallPolicyCertificateAuthority withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.java new file mode 100644 index 0000000000000..a853c8bc09c19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.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.network.generated.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; + +/** Firewall Policy Filter Rule Collection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleCollectionType") +@JsonTypeName("FirewallPolicyFilterRuleCollection") +@Fluent +public final class FirewallPolicyFilterRuleCollection extends FirewallPolicyRuleCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyFilterRuleCollection.class); + + /* + * The action type of a Filter rule collection. + */ + @JsonProperty(value = "action") + private FirewallPolicyFilterRuleCollectionAction action; + + /* + * List of rules included in a rule collection. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the action property: The action type of a Filter rule collection. + * + * @return the action value. + */ + public FirewallPolicyFilterRuleCollectionAction action() { + return this.action; + } + + /** + * Set the action property: The action type of a Filter rule collection. + * + * @param action the action value to set. + * @return the FirewallPolicyFilterRuleCollection object itself. + */ + public FirewallPolicyFilterRuleCollection withAction(FirewallPolicyFilterRuleCollectionAction action) { + this.action = action; + return this; + } + + /** + * Get the rules property: List of rules included in a rule collection. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules included in a rule collection. + * + * @param rules the rules value to set. + * @return the FirewallPolicyFilterRuleCollection object itself. + */ + public FirewallPolicyFilterRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyFilterRuleCollection withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyFilterRuleCollection withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java new file mode 100644 index 0000000000000..45f26950c7499 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.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.network.generated.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; + +/** Properties of the FirewallPolicyFilterRuleCollectionAction. */ +@Fluent +public final class FirewallPolicyFilterRuleCollectionAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyFilterRuleCollectionAction.class); + + /* + * The type of action. + */ + @JsonProperty(value = "type") + private FirewallPolicyFilterRuleCollectionActionType type; + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public FirewallPolicyFilterRuleCollectionActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the FirewallPolicyFilterRuleCollectionAction object itself. + */ + public FirewallPolicyFilterRuleCollectionAction withType(FirewallPolicyFilterRuleCollectionActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.java new file mode 100644 index 0000000000000..3ebc9e9cc14da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyFilterRuleCollectionActionType. */ +public final class FirewallPolicyFilterRuleCollectionActionType + extends ExpandableStringEnum { + /** Static value Allow for FirewallPolicyFilterRuleCollectionActionType. */ + public static final FirewallPolicyFilterRuleCollectionActionType ALLOW = fromString("Allow"); + + /** Static value Deny for FirewallPolicyFilterRuleCollectionActionType. */ + public static final FirewallPolicyFilterRuleCollectionActionType DENY = fromString("Deny"); + + /** + * Creates or finds a FirewallPolicyFilterRuleCollectionActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyFilterRuleCollectionActionType. + */ + @JsonCreator + public static FirewallPolicyFilterRuleCollectionActionType fromString(String name) { + return fromString(name, FirewallPolicyFilterRuleCollectionActionType.class); + } + + /** @return known FirewallPolicyFilterRuleCollectionActionType values. */ + public static Collection values() { + return values(FirewallPolicyFilterRuleCollectionActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyInsights.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyInsights.java new file mode 100644 index 0000000000000..1907ab78a1214 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyInsights.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Firewall Policy Insights. */ +@Fluent +public final class FirewallPolicyInsights { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyInsights.class); + + /* + * A flag to indicate if the insights are enabled on the policy. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * Number of days the insights should be enabled on the policy. + */ + @JsonProperty(value = "retentionDays") + private Integer retentionDays; + + /* + * Workspaces needed to configure the Firewall Policy Insights. + */ + @JsonProperty(value = "logAnalyticsResources") + private FirewallPolicyLogAnalyticsResources logAnalyticsResources; + + /** + * Get the isEnabled property: A flag to indicate if the insights are enabled on the policy. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: A flag to indicate if the insights are enabled on the policy. + * + * @param isEnabled the isEnabled value to set. + * @return the FirewallPolicyInsights object itself. + */ + public FirewallPolicyInsights withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the retentionDays property: Number of days the insights should be enabled on the policy. + * + * @return the retentionDays value. + */ + public Integer retentionDays() { + return this.retentionDays; + } + + /** + * Set the retentionDays property: Number of days the insights should be enabled on the policy. + * + * @param retentionDays the retentionDays value to set. + * @return the FirewallPolicyInsights object itself. + */ + public FirewallPolicyInsights withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + + /** + * Get the logAnalyticsResources property: Workspaces needed to configure the Firewall Policy Insights. + * + * @return the logAnalyticsResources value. + */ + public FirewallPolicyLogAnalyticsResources logAnalyticsResources() { + return this.logAnalyticsResources; + } + + /** + * Set the logAnalyticsResources property: Workspaces needed to configure the Firewall Policy Insights. + * + * @param logAnalyticsResources the logAnalyticsResources value to set. + * @return the FirewallPolicyInsights object itself. + */ + public FirewallPolicyInsights withLogAnalyticsResources(FirewallPolicyLogAnalyticsResources logAnalyticsResources) { + this.logAnalyticsResources = logAnalyticsResources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logAnalyticsResources() != null) { + logAnalyticsResources().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetection.java new file mode 100644 index 0000000000000..9f83cad2b9362 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetection.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Configuration for intrusion detection mode and rules. */ +@Fluent +public final class FirewallPolicyIntrusionDetection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyIntrusionDetection.class); + + /* + * Intrusion detection general state. + */ + @JsonProperty(value = "mode") + private FirewallPolicyIntrusionDetectionStateType mode; + + /* + * Intrusion detection configuration properties. + */ + @JsonProperty(value = "configuration") + private FirewallPolicyIntrusionDetectionConfiguration configuration; + + /** + * Get the mode property: Intrusion detection general state. + * + * @return the mode value. + */ + public FirewallPolicyIntrusionDetectionStateType mode() { + return this.mode; + } + + /** + * Set the mode property: Intrusion detection general state. + * + * @param mode the mode value to set. + * @return the FirewallPolicyIntrusionDetection object itself. + */ + public FirewallPolicyIntrusionDetection withMode(FirewallPolicyIntrusionDetectionStateType mode) { + this.mode = mode; + return this; + } + + /** + * Get the configuration property: Intrusion detection configuration properties. + * + * @return the configuration value. + */ + public FirewallPolicyIntrusionDetectionConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Intrusion detection configuration properties. + * + * @param configuration the configuration value to set. + * @return the FirewallPolicyIntrusionDetection object itself. + */ + public FirewallPolicyIntrusionDetection withConfiguration( + FirewallPolicyIntrusionDetectionConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() != null) { + configuration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.java new file mode 100644 index 0000000000000..d8b4925787346 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Intrusion detection bypass traffic specification. */ +@Fluent +public final class FirewallPolicyIntrusionDetectionBypassTrafficSpecifications { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.class); + + /* + * Name of the bypass traffic rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the bypass traffic rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The rule bypass protocol. + */ + @JsonProperty(value = "protocol") + private FirewallPolicyIntrusionDetectionProtocol protocol; + + /* + * List of source IP addresses or ranges for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or ranges for this rule. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports or ranges. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + @JsonProperty(value = "destinationIpGroups") + private List destinationIpGroups; + + /** + * Get the name property: Name of the bypass traffic rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the bypass traffic rule. + * + * @param name the name value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the bypass traffic rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the bypass traffic rule. + * + * @param description the description value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the protocol property: The rule bypass protocol. + * + * @return the protocol value. + */ + public FirewallPolicyIntrusionDetectionProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The rule bypass protocol. + * + * @param protocol the protocol value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withProtocol( + FirewallPolicyIntrusionDetectionProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses or ranges for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses or ranges for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withSourceAddresses( + List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or ranges for this rule. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or ranges for this rule. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withDestinationAddresses( + List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports or ranges. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports or ranges. + * + * @param destinationPorts the destinationPorts value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withDestinationPorts( + List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @return the destinationIpGroups value. + */ + public List destinationIpGroups() { + return this.destinationIpGroups; + } + + /** + * Set the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @param destinationIpGroups the destinationIpGroups value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withDestinationIpGroups( + List destinationIpGroups) { + this.destinationIpGroups = destinationIpGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionConfiguration.java new file mode 100644 index 0000000000000..a9c7a68db75ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionConfiguration.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 operation for configuring intrusion detection. */ +@Fluent +public final class FirewallPolicyIntrusionDetectionConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(FirewallPolicyIntrusionDetectionConfiguration.class); + + /* + * List of specific signatures states. + */ + @JsonProperty(value = "signatureOverrides") + private List signatureOverrides; + + /* + * List of rules for traffic to bypass. + */ + @JsonProperty(value = "bypassTrafficSettings") + private List bypassTrafficSettings; + + /** + * Get the signatureOverrides property: List of specific signatures states. + * + * @return the signatureOverrides value. + */ + public List signatureOverrides() { + return this.signatureOverrides; + } + + /** + * Set the signatureOverrides property: List of specific signatures states. + * + * @param signatureOverrides the signatureOverrides value to set. + * @return the FirewallPolicyIntrusionDetectionConfiguration object itself. + */ + public FirewallPolicyIntrusionDetectionConfiguration withSignatureOverrides( + List signatureOverrides) { + this.signatureOverrides = signatureOverrides; + return this; + } + + /** + * Get the bypassTrafficSettings property: List of rules for traffic to bypass. + * + * @return the bypassTrafficSettings value. + */ + public List bypassTrafficSettings() { + return this.bypassTrafficSettings; + } + + /** + * Set the bypassTrafficSettings property: List of rules for traffic to bypass. + * + * @param bypassTrafficSettings the bypassTrafficSettings value to set. + * @return the FirewallPolicyIntrusionDetectionConfiguration object itself. + */ + public FirewallPolicyIntrusionDetectionConfiguration withBypassTrafficSettings( + List bypassTrafficSettings) { + this.bypassTrafficSettings = bypassTrafficSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (signatureOverrides() != null) { + signatureOverrides().forEach(e -> e.validate()); + } + if (bypassTrafficSettings() != null) { + bypassTrafficSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProtocol.java new file mode 100644 index 0000000000000..ad1e1c3187129 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProtocol.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyIntrusionDetectionProtocol. */ +public final class FirewallPolicyIntrusionDetectionProtocol + extends ExpandableStringEnum { + /** Static value TCP for FirewallPolicyIntrusionDetectionProtocol. */ + public static final FirewallPolicyIntrusionDetectionProtocol TCP = fromString("TCP"); + + /** Static value UDP for FirewallPolicyIntrusionDetectionProtocol. */ + public static final FirewallPolicyIntrusionDetectionProtocol UDP = fromString("UDP"); + + /** Static value ICMP for FirewallPolicyIntrusionDetectionProtocol. */ + public static final FirewallPolicyIntrusionDetectionProtocol ICMP = fromString("ICMP"); + + /** Static value ANY for FirewallPolicyIntrusionDetectionProtocol. */ + public static final FirewallPolicyIntrusionDetectionProtocol ANY = fromString("ANY"); + + /** + * Creates or finds a FirewallPolicyIntrusionDetectionProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyIntrusionDetectionProtocol. + */ + @JsonCreator + public static FirewallPolicyIntrusionDetectionProtocol fromString(String name) { + return fromString(name, FirewallPolicyIntrusionDetectionProtocol.class); + } + + /** @return known FirewallPolicyIntrusionDetectionProtocol values. */ + public static Collection values() { + return values(FirewallPolicyIntrusionDetectionProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.java new file mode 100644 index 0000000000000..575aee0649175 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Intrusion detection signatures specification states. */ +@Fluent +public final class FirewallPolicyIntrusionDetectionSignatureSpecification { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(FirewallPolicyIntrusionDetectionSignatureSpecification.class); + + /* + * Signature id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The signature state. + */ + @JsonProperty(value = "mode") + private FirewallPolicyIntrusionDetectionStateType mode; + + /** + * Get the id property: Signature id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Signature id. + * + * @param id the id value to set. + * @return the FirewallPolicyIntrusionDetectionSignatureSpecification object itself. + */ + public FirewallPolicyIntrusionDetectionSignatureSpecification withId(String id) { + this.id = id; + return this; + } + + /** + * Get the mode property: The signature state. + * + * @return the mode value. + */ + public FirewallPolicyIntrusionDetectionStateType mode() { + return this.mode; + } + + /** + * Set the mode property: The signature state. + * + * @param mode the mode value to set. + * @return the FirewallPolicyIntrusionDetectionSignatureSpecification object itself. + */ + public FirewallPolicyIntrusionDetectionSignatureSpecification withMode( + FirewallPolicyIntrusionDetectionStateType mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.java new file mode 100644 index 0000000000000..f8b0a0899843d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyIntrusionDetectionStateType. */ +public final class FirewallPolicyIntrusionDetectionStateType + extends ExpandableStringEnum { + /** Static value Off for FirewallPolicyIntrusionDetectionStateType. */ + public static final FirewallPolicyIntrusionDetectionStateType OFF = fromString("Off"); + + /** Static value Alert for FirewallPolicyIntrusionDetectionStateType. */ + public static final FirewallPolicyIntrusionDetectionStateType ALERT = fromString("Alert"); + + /** Static value Deny for FirewallPolicyIntrusionDetectionStateType. */ + public static final FirewallPolicyIntrusionDetectionStateType DENY = fromString("Deny"); + + /** + * Creates or finds a FirewallPolicyIntrusionDetectionStateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyIntrusionDetectionStateType. + */ + @JsonCreator + public static FirewallPolicyIntrusionDetectionStateType fromString(String name) { + return fromString(name, FirewallPolicyIntrusionDetectionStateType.class); + } + + /** @return known FirewallPolicyIntrusionDetectionStateType values. */ + public static Collection values() { + return values(FirewallPolicyIntrusionDetectionStateType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.java new file mode 100644 index 0000000000000..7aab8d1099c0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListFirewallPolicies API service call. */ +@Fluent +public final class FirewallPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyListResult.class); + + /* + * List of Firewall Policies in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Firewall Policies in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Firewall Policies in a resource group. + * + * @param value the value value to set. + * @return the FirewallPolicyListResult object itself. + */ + public FirewallPolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the FirewallPolicyListResult object itself. + */ + public FirewallPolicyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.java new file mode 100644 index 0000000000000..e6bffa80b0fdd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Log Analytics Resources for Firewall Policy Insights. */ +@Fluent +public final class FirewallPolicyLogAnalyticsResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyLogAnalyticsResources.class); + + /* + * List of workspaces for Firewall Policy Insights. + */ + @JsonProperty(value = "workspaces") + private List workspaces; + + /* + * The default workspace Id for Firewall Policy Insights. + */ + @JsonProperty(value = "defaultWorkspaceId") + private SubResource defaultWorkspaceId; + + /** + * Get the workspaces property: List of workspaces for Firewall Policy Insights. + * + * @return the workspaces value. + */ + public List workspaces() { + return this.workspaces; + } + + /** + * Set the workspaces property: List of workspaces for Firewall Policy Insights. + * + * @param workspaces the workspaces value to set. + * @return the FirewallPolicyLogAnalyticsResources object itself. + */ + public FirewallPolicyLogAnalyticsResources withWorkspaces(List workspaces) { + this.workspaces = workspaces; + return this; + } + + /** + * Get the defaultWorkspaceId property: The default workspace Id for Firewall Policy Insights. + * + * @return the defaultWorkspaceId value. + */ + public SubResource defaultWorkspaceId() { + return this.defaultWorkspaceId; + } + + /** + * Set the defaultWorkspaceId property: The default workspace Id for Firewall Policy Insights. + * + * @param defaultWorkspaceId the defaultWorkspaceId value to set. + * @return the FirewallPolicyLogAnalyticsResources object itself. + */ + public FirewallPolicyLogAnalyticsResources withDefaultWorkspaceId(SubResource defaultWorkspaceId) { + this.defaultWorkspaceId = defaultWorkspaceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (workspaces() != null) { + workspaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.java new file mode 100644 index 0000000000000..1c0b5b3d1da10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log Analytics Workspace for Firewall Policy Insights. */ +@Fluent +public final class FirewallPolicyLogAnalyticsWorkspace { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyLogAnalyticsWorkspace.class); + + /* + * Region to configure the Workspace. + */ + @JsonProperty(value = "region") + private String region; + + /* + * The workspace Id for Firewall Policy Insights. + */ + @JsonProperty(value = "workspaceId") + private SubResource workspaceId; + + /** + * Get the region property: Region to configure the Workspace. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region to configure the Workspace. + * + * @param region the region value to set. + * @return the FirewallPolicyLogAnalyticsWorkspace object itself. + */ + public FirewallPolicyLogAnalyticsWorkspace withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the workspaceId property: The workspace Id for Firewall Policy Insights. + * + * @return the workspaceId value. + */ + public SubResource workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The workspace Id for Firewall Policy Insights. + * + * @param workspaceId the workspaceId value to set. + * @return the FirewallPolicyLogAnalyticsWorkspace object itself. + */ + public FirewallPolicyLogAnalyticsWorkspace withWorkspaceId(SubResource workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.java new file mode 100644 index 0000000000000..22452d7a6a4ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.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.network.generated.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; + +/** Firewall Policy NAT Rule Collection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleCollectionType") +@JsonTypeName("FirewallPolicyNatRuleCollection") +@Fluent +public final class FirewallPolicyNatRuleCollection extends FirewallPolicyRuleCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyNatRuleCollection.class); + + /* + * The action type of a Nat rule collection. + */ + @JsonProperty(value = "action") + private FirewallPolicyNatRuleCollectionAction action; + + /* + * List of rules included in a rule collection. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the action property: The action type of a Nat rule collection. + * + * @return the action value. + */ + public FirewallPolicyNatRuleCollectionAction action() { + return this.action; + } + + /** + * Set the action property: The action type of a Nat rule collection. + * + * @param action the action value to set. + * @return the FirewallPolicyNatRuleCollection object itself. + */ + public FirewallPolicyNatRuleCollection withAction(FirewallPolicyNatRuleCollectionAction action) { + this.action = action; + return this; + } + + /** + * Get the rules property: List of rules included in a rule collection. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules included in a rule collection. + * + * @param rules the rules value to set. + * @return the FirewallPolicyNatRuleCollection object itself. + */ + public FirewallPolicyNatRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyNatRuleCollection withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyNatRuleCollection withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java new file mode 100644 index 0000000000000..4565ab2c1be50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.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.network.generated.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; + +/** Properties of the FirewallPolicyNatRuleCollectionAction. */ +@Fluent +public final class FirewallPolicyNatRuleCollectionAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyNatRuleCollectionAction.class); + + /* + * The type of action. + */ + @JsonProperty(value = "type") + private FirewallPolicyNatRuleCollectionActionType type; + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public FirewallPolicyNatRuleCollectionActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the FirewallPolicyNatRuleCollectionAction object itself. + */ + public FirewallPolicyNatRuleCollectionAction withType(FirewallPolicyNatRuleCollectionActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.java new file mode 100644 index 0000000000000..4e881dede417f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyNatRuleCollectionActionType. */ +public final class FirewallPolicyNatRuleCollectionActionType + extends ExpandableStringEnum { + /** Static value DNAT for FirewallPolicyNatRuleCollectionActionType. */ + public static final FirewallPolicyNatRuleCollectionActionType DNAT = fromString("DNAT"); + + /** + * Creates or finds a FirewallPolicyNatRuleCollectionActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyNatRuleCollectionActionType. + */ + @JsonCreator + public static FirewallPolicyNatRuleCollectionActionType fromString(String name) { + return fromString(name, FirewallPolicyNatRuleCollectionActionType.class); + } + + /** @return known FirewallPolicyNatRuleCollectionActionType values. */ + public static Collection values() { + return values(FirewallPolicyNatRuleCollectionActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.java new file mode 100644 index 0000000000000..eab3c0fe34959 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Properties of a rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "ruleType", + defaultImpl = FirewallPolicyRule.class) +@JsonTypeName("FirewallPolicyRule") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ApplicationRule", value = ApplicationRule.class), + @JsonSubTypes.Type(name = "NatRule", value = NatRule.class), + @JsonSubTypes.Type(name = "NetworkRule", value = NetworkRule.class) +}) +@Fluent +public class FirewallPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRule.class); + + /* + * Name of the rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name property: Name of the rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the rule. + * + * @param name the name value to set. + * @return the FirewallPolicyRule object itself. + */ + public FirewallPolicyRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the rule. + * + * @param description the description value to set. + * @return the FirewallPolicyRule object itself. + */ + public FirewallPolicyRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java new file mode 100644 index 0000000000000..040c7c27b1fe3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.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.network.generated.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; + +/** Properties of the application rule protocol. */ +@Fluent +public final class FirewallPolicyRuleApplicationProtocol { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleApplicationProtocol.class); + + /* + * Protocol type. + */ + @JsonProperty(value = "protocolType") + private FirewallPolicyRuleApplicationProtocolType protocolType; + + /* + * Port number for the protocol, cannot be greater than 64000. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the protocolType property: Protocol type. + * + * @return the protocolType value. + */ + public FirewallPolicyRuleApplicationProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set the protocolType property: Protocol type. + * + * @param protocolType the protocolType value to set. + * @return the FirewallPolicyRuleApplicationProtocol object itself. + */ + public FirewallPolicyRuleApplicationProtocol withProtocolType( + FirewallPolicyRuleApplicationProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get the port property: Port number for the protocol, cannot be greater than 64000. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port number for the protocol, cannot be greater than 64000. + * + * @param port the port value to set. + * @return the FirewallPolicyRuleApplicationProtocol object itself. + */ + public FirewallPolicyRuleApplicationProtocol withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.java new file mode 100644 index 0000000000000..af558c3ea23bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyRuleApplicationProtocolType. */ +public final class FirewallPolicyRuleApplicationProtocolType + extends ExpandableStringEnum { + /** Static value Http for FirewallPolicyRuleApplicationProtocolType. */ + public static final FirewallPolicyRuleApplicationProtocolType HTTP = fromString("Http"); + + /** Static value Https for FirewallPolicyRuleApplicationProtocolType. */ + public static final FirewallPolicyRuleApplicationProtocolType HTTPS = fromString("Https"); + + /** + * Creates or finds a FirewallPolicyRuleApplicationProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleApplicationProtocolType. + */ + @JsonCreator + public static FirewallPolicyRuleApplicationProtocolType fromString(String name) { + return fromString(name, FirewallPolicyRuleApplicationProtocolType.class); + } + + /** @return known FirewallPolicyRuleApplicationProtocolType values. */ + public static Collection values() { + return values(FirewallPolicyRuleApplicationProtocolType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.java new file mode 100644 index 0000000000000..a9541ec85895a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Properties of the rule collection. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "ruleCollectionType", + defaultImpl = FirewallPolicyRuleCollection.class) +@JsonTypeName("FirewallPolicyRuleCollection") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FirewallPolicyNatRuleCollection", value = FirewallPolicyNatRuleCollection.class), + @JsonSubTypes.Type(name = "FirewallPolicyFilterRuleCollection", value = FirewallPolicyFilterRuleCollection.class) +}) +@Fluent +public class FirewallPolicyRuleCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollection.class); + + /* + * The name of the rule collection. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Priority of the Firewall Policy Rule Collection resource. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /** + * Get the name property: The name of the rule collection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the rule collection. + * + * @param name the name value to set. + * @return the FirewallPolicyRuleCollection object itself. + */ + public FirewallPolicyRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get the priority property: Priority of the Firewall Policy Rule Collection resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the Firewall Policy Rule Collection resource. + * + * @param priority the priority value to set. + * @return the FirewallPolicyRuleCollection object itself. + */ + public FirewallPolicyRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java new file mode 100644 index 0000000000000..912ce5dd4d56e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.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.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import java.util.List; + +/** An immutable client-side representation of FirewallPolicyRuleCollectionGroup. */ +public interface FirewallPolicyRuleCollectionGroup { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Rule Group type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the priority property: Priority of the Firewall Policy Rule Collection Group resource. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the ruleCollections property: Group of Firewall Policy rule collections. + * + * @return the ruleCollections value. + */ + List ruleCollections(); + + /** + * Gets the provisioningState property: The provisioning state of the firewall policy rule collection group + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner + * object. + * + * @return the inner object. + */ + FirewallPolicyRuleCollectionGroupInner innerModel(); + + /** The entirety of the FirewallPolicyRuleCollectionGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The FirewallPolicyRuleCollectionGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the FirewallPolicyRuleCollectionGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the FirewallPolicyRuleCollectionGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, firewallPolicyName. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @return the next definition stage. + */ + WithCreate withExistingFirewallPolicy(String resourceGroupName, String firewallPolicyName); + } + /** + * The stage of the FirewallPolicyRuleCollectionGroup 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.WithName, DefinitionStages.WithPriority, DefinitionStages.WithRuleCollections { + /** + * Executes the create request. + * + * @return the created resource. + */ + FirewallPolicyRuleCollectionGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FirewallPolicyRuleCollectionGroup create(Context context); + } + /** The stage of the FirewallPolicyRuleCollectionGroup definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the FirewallPolicyRuleCollectionGroup definition allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of the Firewall Policy Rule Collection Group resource.. + * + * @param priority Priority of the Firewall Policy Rule Collection Group resource. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + /** The stage of the FirewallPolicyRuleCollectionGroup definition allowing to specify ruleCollections. */ + interface WithRuleCollections { + /** + * Specifies the ruleCollections property: Group of Firewall Policy rule collections.. + * + * @param ruleCollections Group of Firewall Policy rule collections. + * @return the next definition stage. + */ + WithCreate withRuleCollections(List ruleCollections); + } + } + /** + * Begins update for the FirewallPolicyRuleCollectionGroup resource. + * + * @return the stage of resource update. + */ + FirewallPolicyRuleCollectionGroup.Update update(); + + /** The template for FirewallPolicyRuleCollectionGroup update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithPriority, UpdateStages.WithRuleCollections { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FirewallPolicyRuleCollectionGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FirewallPolicyRuleCollectionGroup apply(Context context); + } + /** The FirewallPolicyRuleCollectionGroup update stages. */ + interface UpdateStages { + /** The stage of the FirewallPolicyRuleCollectionGroup update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the FirewallPolicyRuleCollectionGroup update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of the Firewall Policy Rule Collection Group resource.. + * + * @param priority Priority of the Firewall Policy Rule Collection Group resource. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + /** The stage of the FirewallPolicyRuleCollectionGroup update allowing to specify ruleCollections. */ + interface WithRuleCollections { + /** + * Specifies the ruleCollections property: Group of Firewall Policy rule collections.. + * + * @param ruleCollections Group of Firewall Policy rule collections. + * @return the next definition stage. + */ + Update withRuleCollections(List ruleCollections); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FirewallPolicyRuleCollectionGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FirewallPolicyRuleCollectionGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.java new file mode 100644 index 0000000000000..f26033609d79d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListFirewallPolicyRuleCollectionGroups API service call. */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollectionGroupListResult.class); + + /* + * List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + * + * @param value the value value to set. + * @return the FirewallPolicyRuleCollectionGroupListResult object itself. + */ + public FirewallPolicyRuleCollectionGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the FirewallPolicyRuleCollectionGroupListResult object itself. + */ + public FirewallPolicyRuleCollectionGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.java new file mode 100644 index 0000000000000..1018efebd8409 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 FirewallPolicyRuleCollectionGroups. */ +public interface FirewallPolicyRuleCollectionGroups { + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 firewallPolicyName, String ruleCollectionGroupName); + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + FirewallPolicyRuleCollectionGroup get( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + Response getWithResponse( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + PagedIterable list(String resourceGroupName, String firewallPolicyName); + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + PagedIterable list( + String resourceGroupName, String firewallPolicyName, Context context); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @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 the specified FirewallPolicyRuleCollectionGroup. + */ + FirewallPolicyRuleCollectionGroup getById(String id); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @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 specified FirewallPolicyRuleCollectionGroup. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @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 FirewallPolicyRuleCollectionGroup resource. + * + * @param name resource name. + * @return the first stage of the new FirewallPolicyRuleCollectionGroup definition. + */ + FirewallPolicyRuleCollectionGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionType.java new file mode 100644 index 0000000000000..b2c81ee4337c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyRuleCollectionType. */ +public final class FirewallPolicyRuleCollectionType extends ExpandableStringEnum { + /** Static value FirewallPolicyNatRuleCollection for FirewallPolicyRuleCollectionType. */ + public static final FirewallPolicyRuleCollectionType FIREWALL_POLICY_NAT_RULE_COLLECTION = + fromString("FirewallPolicyNatRuleCollection"); + + /** Static value FirewallPolicyFilterRuleCollection for FirewallPolicyRuleCollectionType. */ + public static final FirewallPolicyRuleCollectionType FIREWALL_POLICY_FILTER_RULE_COLLECTION = + fromString("FirewallPolicyFilterRuleCollection"); + + /** + * Creates or finds a FirewallPolicyRuleCollectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleCollectionType. + */ + @JsonCreator + public static FirewallPolicyRuleCollectionType fromString(String name) { + return fromString(name, FirewallPolicyRuleCollectionType.class); + } + + /** @return known FirewallPolicyRuleCollectionType values. */ + public static Collection values() { + return values(FirewallPolicyRuleCollectionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.java new file mode 100644 index 0000000000000..dbdaaf92e7b51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyRuleNetworkProtocol. */ +public final class FirewallPolicyRuleNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for FirewallPolicyRuleNetworkProtocol. */ + public static final FirewallPolicyRuleNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for FirewallPolicyRuleNetworkProtocol. */ + public static final FirewallPolicyRuleNetworkProtocol UDP = fromString("UDP"); + + /** Static value Any for FirewallPolicyRuleNetworkProtocol. */ + public static final FirewallPolicyRuleNetworkProtocol ANY = fromString("Any"); + + /** Static value ICMP for FirewallPolicyRuleNetworkProtocol. */ + public static final FirewallPolicyRuleNetworkProtocol ICMP = fromString("ICMP"); + + /** + * Creates or finds a FirewallPolicyRuleNetworkProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleNetworkProtocol. + */ + @JsonCreator + public static FirewallPolicyRuleNetworkProtocol fromString(String name) { + return fromString(name, FirewallPolicyRuleNetworkProtocol.class); + } + + /** @return known FirewallPolicyRuleNetworkProtocol values. */ + public static Collection values() { + return values(FirewallPolicyRuleNetworkProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.java new file mode 100644 index 0000000000000..fb37236dd31af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyRuleType. */ +public final class FirewallPolicyRuleType extends ExpandableStringEnum { + /** Static value ApplicationRule for FirewallPolicyRuleType. */ + public static final FirewallPolicyRuleType APPLICATION_RULE = fromString("ApplicationRule"); + + /** Static value NetworkRule for FirewallPolicyRuleType. */ + public static final FirewallPolicyRuleType NETWORK_RULE = fromString("NetworkRule"); + + /** Static value NatRule for FirewallPolicyRuleType. */ + public static final FirewallPolicyRuleType NAT_RULE = fromString("NatRule"); + + /** + * Creates or finds a FirewallPolicyRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleType. + */ + @JsonCreator + public static FirewallPolicyRuleType fromString(String name) { + return fromString(name, FirewallPolicyRuleType.class); + } + + /** @return known FirewallPolicyRuleType values. */ + public static Collection values() { + return values(FirewallPolicyRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.java new file mode 100644 index 0000000000000..ca143cb52d5b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.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.network.generated.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; + +/** SKU of Firewall policy. */ +@Fluent +public final class FirewallPolicySku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicySku.class); + + /* + * Tier of Firewall Policy. + */ + @JsonProperty(value = "tier") + private FirewallPolicySkuTier tier; + + /** + * Get the tier property: Tier of Firewall Policy. + * + * @return the tier value. + */ + public FirewallPolicySkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of Firewall Policy. + * + * @param tier the tier value to set. + * @return the FirewallPolicySku object itself. + */ + public FirewallPolicySku withTier(FirewallPolicySkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.java new file mode 100644 index 0000000000000..36f0c02ad171a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicySkuTier. */ +public final class FirewallPolicySkuTier extends ExpandableStringEnum { + /** Static value Standard for FirewallPolicySkuTier. */ + public static final FirewallPolicySkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for FirewallPolicySkuTier. */ + public static final FirewallPolicySkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a FirewallPolicySkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicySkuTier. + */ + @JsonCreator + public static FirewallPolicySkuTier fromString(String name) { + return fromString(name, FirewallPolicySkuTier.class); + } + + /** @return known FirewallPolicySkuTier values. */ + public static Collection values() { + return values(FirewallPolicySkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.java new file mode 100644 index 0000000000000..4a5b9f7ecf370 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 private IP addresses/IP ranges to which traffic will not be SNAT. */ +@Fluent +public final class FirewallPolicySnat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicySnat.class); + + /* + * List of private IP addresses/IP address ranges to not be SNAT. + */ + @JsonProperty(value = "privateRanges") + private List privateRanges; + + /** + * Get the privateRanges property: List of private IP addresses/IP address ranges to not be SNAT. + * + * @return the privateRanges value. + */ + public List privateRanges() { + return this.privateRanges; + } + + /** + * Set the privateRanges property: List of private IP addresses/IP address ranges to not be SNAT. + * + * @param privateRanges the privateRanges value to set. + * @return the FirewallPolicySnat object itself. + */ + public FirewallPolicySnat withPrivateRanges(List privateRanges) { + this.privateRanges = privateRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyThreatIntelWhitelist.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyThreatIntelWhitelist.java new file mode 100644 index 0000000000000..7bec9e06250a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyThreatIntelWhitelist.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.network.generated.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; + +/** ThreatIntel Whitelist for Firewall Policy. */ +@Fluent +public final class FirewallPolicyThreatIntelWhitelist { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyThreatIntelWhitelist.class); + + /* + * List of IP addresses for the ThreatIntel Whitelist. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /* + * List of FQDNs for the ThreatIntel Whitelist. + */ + @JsonProperty(value = "fqdns") + private List fqdns; + + /** + * Get the ipAddresses property: List of IP addresses for the ThreatIntel Whitelist. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set the ipAddresses property: List of IP addresses for the ThreatIntel Whitelist. + * + * @param ipAddresses the ipAddresses value to set. + * @return the FirewallPolicyThreatIntelWhitelist object itself. + */ + public FirewallPolicyThreatIntelWhitelist withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Get the fqdns property: List of FQDNs for the ThreatIntel Whitelist. + * + * @return the fqdns value. + */ + public List fqdns() { + return this.fqdns; + } + + /** + * Set the fqdns property: List of FQDNs for the ThreatIntel Whitelist. + * + * @param fqdns the fqdns value to set. + * @return the FirewallPolicyThreatIntelWhitelist object itself. + */ + public FirewallPolicyThreatIntelWhitelist withFqdns(List fqdns) { + this.fqdns = fqdns; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyTransportSecurity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyTransportSecurity.java new file mode 100644 index 0000000000000..1bb383f4ea914 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyTransportSecurity.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.network.generated.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; + +/** Configuration needed to perform TLS termination & initiation. */ +@Fluent +public final class FirewallPolicyTransportSecurity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyTransportSecurity.class); + + /* + * The CA used for intermediate CA generation. + */ + @JsonProperty(value = "certificateAuthority") + private FirewallPolicyCertificateAuthority certificateAuthority; + + /** + * Get the certificateAuthority property: The CA used for intermediate CA generation. + * + * @return the certificateAuthority value. + */ + public FirewallPolicyCertificateAuthority certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Set the certificateAuthority property: The CA used for intermediate CA generation. + * + * @param certificateAuthority the certificateAuthority value to set. + * @return the FirewallPolicyTransportSecurity object itself. + */ + public FirewallPolicyTransportSecurity withCertificateAuthority( + FirewallPolicyCertificateAuthority certificateAuthority) { + this.certificateAuthority = certificateAuthority; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateAuthority() != null) { + certificateAuthority().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLog.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLog.java new file mode 100644 index 0000000000000..ed382042ae292 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLog.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.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import java.util.Map; + +/** An immutable client-side representation of FlowLog. */ +public interface FlowLog { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the targetResourceId property: ID of network security group to which flow log will be applied. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the targetResourceGuid property: Guid of network security group to which flow log will be applied. + * + * @return the targetResourceGuid value. + */ + String targetResourceGuid(); + + /** + * Gets the storageId property: ID of the storage account which is used to store the flow log. + * + * @return the storageId value. + */ + String storageId(); + + /** + * Gets the enabled property: Flag to enable/disable flow logging. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the retentionPolicy property: Parameters that define the retention policy for flow log. + * + * @return the retentionPolicy value. + */ + RetentionPolicyParameters retentionPolicy(); + + /** + * Gets the format property: Parameters that define the flow log format. + * + * @return the format value. + */ + FlowLogFormatParameters format(); + + /** + * Gets the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. + * + * @return the flowAnalyticsConfiguration value. + */ + TrafficAnalyticsProperties flowAnalyticsConfiguration(); + + /** + * Gets the provisioningState property: The provisioning state of the flow log. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.FlowLogInner object. + * + * @return the inner object. + */ + FlowLogInner innerModel(); + + /** The entirety of the FlowLog definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The FlowLog definition stages. */ + interface DefinitionStages { + /** The first stage of the FlowLog definition. */ + interface Blank extends WithLocation { + } + /** The stage of the FlowLog 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the FlowLog definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkWatcherName. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @return the next definition stage. + */ + WithCreate withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + /** + * The stage of the FlowLog 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.WithTargetResourceId, + DefinitionStages.WithStorageId, + DefinitionStages.WithEnabled, + DefinitionStages.WithRetentionPolicy, + DefinitionStages.WithFormat, + DefinitionStages.WithFlowAnalyticsConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + FlowLog create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FlowLog create(Context context); + } + /** The stage of the FlowLog 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 FlowLog definition allowing to specify targetResourceId. */ + interface WithTargetResourceId { + /** + * Specifies the targetResourceId property: ID of network security group to which flow log will be applied.. + * + * @param targetResourceId ID of network security group to which flow log will be applied. + * @return the next definition stage. + */ + WithCreate withTargetResourceId(String targetResourceId); + } + /** The stage of the FlowLog definition allowing to specify storageId. */ + interface WithStorageId { + /** + * Specifies the storageId property: ID of the storage account which is used to store the flow log.. + * + * @param storageId ID of the storage account which is used to store the flow log. + * @return the next definition stage. + */ + WithCreate withStorageId(String storageId); + } + /** The stage of the FlowLog definition allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: Flag to enable/disable flow logging.. + * + * @param enabled Flag to enable/disable flow logging. + * @return the next definition stage. + */ + WithCreate withEnabled(Boolean enabled); + } + /** The stage of the FlowLog definition allowing to specify retentionPolicy. */ + interface WithRetentionPolicy { + /** + * Specifies the retentionPolicy property: Parameters that define the retention policy for flow log.. + * + * @param retentionPolicy Parameters that define the retention policy for flow log. + * @return the next definition stage. + */ + WithCreate withRetentionPolicy(RetentionPolicyParameters retentionPolicy); + } + /** The stage of the FlowLog definition allowing to specify format. */ + interface WithFormat { + /** + * Specifies the format property: Parameters that define the flow log format.. + * + * @param format Parameters that define the flow log format. + * @return the next definition stage. + */ + WithCreate withFormat(FlowLogFormatParameters format); + } + /** The stage of the FlowLog definition allowing to specify flowAnalyticsConfiguration. */ + interface WithFlowAnalyticsConfiguration { + /** + * Specifies the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic + * analytics.. + * + * @param flowAnalyticsConfiguration Parameters that define the configuration of traffic analytics. + * @return the next definition stage. + */ + WithCreate withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration); + } + } + /** + * Begins update for the FlowLog resource. + * + * @return the stage of resource update. + */ + FlowLog.Update update(); + + /** The template for FlowLog update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FlowLog apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FlowLog apply(Context context); + } + /** The FlowLog update stages. */ + interface UpdateStages { + /** The stage of the FlowLog 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FlowLog refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FlowLog refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.java new file mode 100644 index 0000000000000..54fbc9f528cf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.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.network.generated.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; + +/** Parameters that define the flow log format. */ +@Fluent +public final class FlowLogFormatParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogFormatParameters.class); + + /* + * The file type of flow log. + */ + @JsonProperty(value = "type") + private FlowLogFormatType type; + + /* + * The version (revision) of the flow log. + */ + @JsonProperty(value = "version") + private Integer version; + + /** + * Get the type property: The file type of flow log. + * + * @return the type value. + */ + public FlowLogFormatType type() { + return this.type; + } + + /** + * Set the type property: The file type of flow log. + * + * @param type the type value to set. + * @return the FlowLogFormatParameters object itself. + */ + public FlowLogFormatParameters withType(FlowLogFormatType type) { + this.type = type; + return this; + } + + /** + * Get the version property: The version (revision) of the flow log. + * + * @return the version value. + */ + public Integer version() { + return this.version; + } + + /** + * Set the version property: The version (revision) of the flow log. + * + * @param version the version value to set. + * @return the FlowLogFormatParameters object itself. + */ + public FlowLogFormatParameters withVersion(Integer version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatType.java new file mode 100644 index 0000000000000..1818ba4200b38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FlowLogFormatType. */ +public final class FlowLogFormatType extends ExpandableStringEnum { + /** Static value JSON for FlowLogFormatType. */ + public static final FlowLogFormatType JSON = fromString("JSON"); + + /** + * Creates or finds a FlowLogFormatType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FlowLogFormatType. + */ + @JsonCreator + public static FlowLogFormatType fromString(String name) { + return fromString(name, FlowLogFormatType.class); + } + + /** @return known FlowLogFormatType values. */ + public static Collection values() { + return values(FlowLogFormatType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogInformation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogInformation.java new file mode 100644 index 0000000000000..7e1c0492935c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogInformation.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; + +/** An immutable client-side representation of FlowLogInformation. */ +public interface FlowLogInformation { + /** + * Gets the targetResourceId property: The ID of the resource to configure for flow log and traffic analytics + * (optional) . + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. + * + * @return the flowAnalyticsConfiguration value. + */ + TrafficAnalyticsProperties flowAnalyticsConfiguration(); + + /** + * Gets the storageId property: ID of the storage account which is used to store the flow log. + * + * @return the storageId value. + */ + String storageId(); + + /** + * Gets the enabled property: Flag to enable/disable flow logging. + * + * @return the enabled value. + */ + boolean enabled(); + + /** + * Gets the retentionPolicy property: Parameters that define the retention policy for flow log. + * + * @return the retentionPolicy value. + */ + RetentionPolicyParameters retentionPolicy(); + + /** + * Gets the format property: Parameters that define the flow log format. + * + * @return the format value. + */ + FlowLogFormatParameters format(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner object. + * + * @return the inner object. + */ + FlowLogInformationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java new file mode 100644 index 0000000000000..f8d66564b371e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of flow logs. */ +@Fluent +public final class FlowLogListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogListResult.class); + + /* + * Information about flow log resource. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Information about flow log resource. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about flow log resource. + * + * @param value the value value to set. + * @return the FlowLogListResult object itself. + */ + public FlowLogListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogStatusParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogStatusParameters.java new file mode 100644 index 0000000000000..22762778cafe9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogStatusParameters.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.network.generated.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; + +/** Parameters that define a resource to query flow log and traffic analytics (optional) status. */ +@Fluent +public final class FlowLogStatusParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogStatusParameters.class); + + /* + * The target resource where getting the flow log and traffic analytics + * (optional) status. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the targetResourceId property: The target resource where getting the flow log and traffic analytics + * (optional) status. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The target resource where getting the flow log and traffic analytics + * (optional) status. + * + * @param targetResourceId the targetResourceId value to set. + * @return the FlowLogStatusParameters object itself. + */ + public FlowLogStatusParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model FlowLogStatusParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogs.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogs.java new file mode 100644 index 0000000000000..1150b6f699837 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogs.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.network.generated.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 FlowLogs. */ +public interface FlowLogs { + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + FlowLog get(String resourceGroupName, String networkWatcherName, String flowLogName); + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context); + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String flowLogName); + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String flowLogName, Context context); + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); + + /** + * Gets a flow log resource by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + FlowLog getById(String id); + + /** + * Gets a flow log resource by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified flow log resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified flow log resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FlowLog resource. + * + * @param name resource name. + * @return the first stage of the new FlowLog definition. + */ + FlowLog.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FrontendIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FrontendIpConfiguration.java new file mode 100644 index 0000000000000..ea9876557a9fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FrontendIpConfiguration.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.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import java.util.List; + +/** An immutable client-side representation of FrontendIpConfiguration. */ +public interface FrontendIpConfiguration { + /** + * 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 that is unique within the set of frontend IP configurations used + * by the load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the inboundNatRules property: An array of references to inbound rules that use this frontend IP. + * + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * Gets the inboundNatPools property: An array of references to inbound pools that use this frontend IP. + * + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * Gets the outboundRules property: An array of references to outbound rules that use this frontend IP. + * + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * Gets the loadBalancingRules property: An array of references to load balancing rules that use this frontend IP. + * + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * Gets the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The Private IP allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the privateIpAddressVersion property: Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken + * as IPv4. + * + * @return the privateIpAddressVersion value. + */ + IpVersion privateIpAddressVersion(); + + /** + * Gets the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the publicIpAddress property: The reference to the Public IP resource. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the publicIpPrefix property: The reference to the Public IP Prefix resource. + * + * @return the publicIpPrefix value. + */ + SubResource publicIpPrefix(); + + /** + * Gets the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @return the gatewayLoadBalancer value. + */ + SubResource gatewayLoadBalancer(); + + /** + * Gets the provisioningState property: The provisioning state of the frontend IP configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner object. + * + * @return the inner object. + */ + FrontendIpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterface.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterface.java new file mode 100644 index 0000000000000..cfa30e7d20512 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterface.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Gateway load balancer tunnel interface of a load balancer backend address pool. */ +@Fluent +public final class GatewayLoadBalancerTunnelInterface { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayLoadBalancerTunnelInterface.class); + + /* + * Port of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Identifier of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "identifier") + private Integer identifier; + + /* + * Protocol of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "protocol") + private GatewayLoadBalancerTunnelProtocol protocol; + + /* + * Traffic type of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "type") + private GatewayLoadBalancerTunnelInterfaceType type; + + /** + * Get the port property: Port of gateway load balancer tunnel interface. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port of gateway load balancer tunnel interface. + * + * @param port the port value to set. + * @return the GatewayLoadBalancerTunnelInterface object itself. + */ + public GatewayLoadBalancerTunnelInterface withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the identifier property: Identifier of gateway load balancer tunnel interface. + * + * @return the identifier value. + */ + public Integer identifier() { + return this.identifier; + } + + /** + * Set the identifier property: Identifier of gateway load balancer tunnel interface. + * + * @param identifier the identifier value to set. + * @return the GatewayLoadBalancerTunnelInterface object itself. + */ + public GatewayLoadBalancerTunnelInterface withIdentifier(Integer identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the protocol property: Protocol of gateway load balancer tunnel interface. + * + * @return the protocol value. + */ + public GatewayLoadBalancerTunnelProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol of gateway load balancer tunnel interface. + * + * @param protocol the protocol value to set. + * @return the GatewayLoadBalancerTunnelInterface object itself. + */ + public GatewayLoadBalancerTunnelInterface withProtocol(GatewayLoadBalancerTunnelProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the type property: Traffic type of gateway load balancer tunnel interface. + * + * @return the type value. + */ + public GatewayLoadBalancerTunnelInterfaceType type() { + return this.type; + } + + /** + * Set the type property: Traffic type of gateway load balancer tunnel interface. + * + * @param type the type value to set. + * @return the GatewayLoadBalancerTunnelInterface object itself. + */ + public GatewayLoadBalancerTunnelInterface withType(GatewayLoadBalancerTunnelInterfaceType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterfaceType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterfaceType.java new file mode 100644 index 0000000000000..6f6ad0d682d51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterfaceType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GatewayLoadBalancerTunnelInterfaceType. */ +public final class GatewayLoadBalancerTunnelInterfaceType + extends ExpandableStringEnum { + /** Static value None for GatewayLoadBalancerTunnelInterfaceType. */ + public static final GatewayLoadBalancerTunnelInterfaceType NONE = fromString("None"); + + /** Static value Internal for GatewayLoadBalancerTunnelInterfaceType. */ + public static final GatewayLoadBalancerTunnelInterfaceType INTERNAL = fromString("Internal"); + + /** Static value External for GatewayLoadBalancerTunnelInterfaceType. */ + public static final GatewayLoadBalancerTunnelInterfaceType EXTERNAL = fromString("External"); + + /** + * Creates or finds a GatewayLoadBalancerTunnelInterfaceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayLoadBalancerTunnelInterfaceType. + */ + @JsonCreator + public static GatewayLoadBalancerTunnelInterfaceType fromString(String name) { + return fromString(name, GatewayLoadBalancerTunnelInterfaceType.class); + } + + /** @return known GatewayLoadBalancerTunnelInterfaceType values. */ + public static Collection values() { + return values(GatewayLoadBalancerTunnelInterfaceType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelProtocol.java new file mode 100644 index 0000000000000..1b549952429a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GatewayLoadBalancerTunnelProtocol. */ +public final class GatewayLoadBalancerTunnelProtocol extends ExpandableStringEnum { + /** Static value None for GatewayLoadBalancerTunnelProtocol. */ + public static final GatewayLoadBalancerTunnelProtocol NONE = fromString("None"); + + /** Static value Native for GatewayLoadBalancerTunnelProtocol. */ + public static final GatewayLoadBalancerTunnelProtocol NATIVE = fromString("Native"); + + /** Static value VXLAN for GatewayLoadBalancerTunnelProtocol. */ + public static final GatewayLoadBalancerTunnelProtocol VXLAN = fromString("VXLAN"); + + /** + * Creates or finds a GatewayLoadBalancerTunnelProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayLoadBalancerTunnelProtocol. + */ + @JsonCreator + public static GatewayLoadBalancerTunnelProtocol fromString(String name) { + return fromString(name, GatewayLoadBalancerTunnelProtocol.class); + } + + /** @return known GatewayLoadBalancerTunnelProtocol values. */ + public static Collection values() { + return values(GatewayLoadBalancerTunnelProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRoute.java new file mode 100644 index 0000000000000..eadfff33ae5ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRoute.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Gateway routing details. */ +@Immutable +public final class GatewayRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayRoute.class); + + /* + * The gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /* + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /* + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /* + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /* + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /* + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** + * Get the localAddress property: The gateway's local address. + * + * @return the localAddress value. + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the network property: The route's network prefix. + * + * @return the network value. + */ + public String network() { + return this.network; + } + + /** + * Get the nextHop property: The route's next hop. + * + * @return the nextHop value. + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Get the sourcePeer property: The peer this route was learned from. + * + * @return the sourcePeer value. + */ + public String sourcePeer() { + return this.sourcePeer; + } + + /** + * Get the origin property: The source this route was learned from. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the asPath property: The route's AS path sequence. + * + * @return the asPath value. + */ + public String asPath() { + return this.asPath; + } + + /** + * Get the weight property: The route's weight. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java new file mode 100644 index 0000000000000..d18816f72f7ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import java.util.List; + +/** An immutable client-side representation of GatewayRouteListResult. */ +public interface GatewayRouteListResult { + /** + * Gets the value property: List of gateway routes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner object. + * + * @return the inner object. + */ + GatewayRouteListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.java new file mode 100644 index 0000000000000..1126adf19b822 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.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.network.generated.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 customer name to be printed on a letter of authorization. */ +@Fluent +public final class GenerateExpressRoutePortsLoaRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenerateExpressRoutePortsLoaRequest.class); + + /* + * The customer name. + */ + @JsonProperty(value = "customerName", required = true) + private String customerName; + + /** + * Get the customerName property: The customer name. + * + * @return the customerName value. + */ + public String customerName() { + return this.customerName; + } + + /** + * Set the customerName property: The customer name. + * + * @param customerName the customerName value to set. + * @return the GenerateExpressRoutePortsLoaRequest object itself. + */ + public GenerateExpressRoutePortsLoaRequest withCustomerName(String customerName) { + this.customerName = customerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customerName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customerName in model GenerateExpressRoutePortsLoaRequest")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java new file mode 100644 index 0000000000000..c18a19619aa59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; + +/** An immutable client-side representation of GenerateExpressRoutePortsLoaResult. */ +public interface GenerateExpressRoutePortsLoaResult { + /** + * Gets the encodedContent property: The content as a base64 encoded string. + * + * @return the encodedContent value. + */ + String encodedContent(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner + * object. + * + * @return the inner object. + */ + GenerateExpressRoutePortsLoaResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetVpnSitesConfigurationRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetVpnSitesConfigurationRequest.java new file mode 100644 index 0000000000000..64ada3b7428f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetVpnSitesConfigurationRequest.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.network.generated.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; + +/** List of Vpn-Sites. */ +@Fluent +public final class GetVpnSitesConfigurationRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetVpnSitesConfigurationRequest.class); + + /* + * List of resource-ids of the vpn-sites for which config is to be + * downloaded. + */ + @JsonProperty(value = "vpnSites") + private List vpnSites; + + /* + * The sas-url to download the configurations for vpn-sites. + */ + @JsonProperty(value = "outputBlobSasUrl", required = true) + private String outputBlobSasUrl; + + /** + * Get the vpnSites property: List of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @return the vpnSites value. + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Set the vpnSites property: List of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @param vpnSites the vpnSites value to set. + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withVpnSites(List vpnSites) { + this.vpnSites = vpnSites; + return this; + } + + /** + * Get the outputBlobSasUrl property: The sas-url to download the configurations for vpn-sites. + * + * @return the outputBlobSasUrl value. + */ + public String outputBlobSasUrl() { + return this.outputBlobSasUrl; + } + + /** + * Set the outputBlobSasUrl property: The sas-url to download the configurations for vpn-sites. + * + * @param outputBlobSasUrl the outputBlobSasUrl value to set. + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withOutputBlobSasUrl(String outputBlobSasUrl) { + this.outputBlobSasUrl = outputBlobSasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (outputBlobSasUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property outputBlobSasUrl in model GetVpnSitesConfigurationRequest")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HopLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HopLink.java new file mode 100644 index 0000000000000..9359bed3e4ac1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HopLink.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +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; + +/** Hop link. */ +@JsonFlatten +@Immutable +public class HopLink { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HopLink.class); + + /* + * The ID of the next hop. + */ + @JsonProperty(value = "nextHopId", access = JsonProperty.Access.WRITE_ONLY) + private String nextHopId; + + /* + * Link type. + */ + @JsonProperty(value = "linkType", access = JsonProperty.Access.WRITE_ONLY) + private String linkType; + + /* + * List of issues. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /* + * Provides additional context on links. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + private Map context; + + /* + * Resource ID. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * Minimum roundtrip time in milliseconds. + */ + @JsonProperty(value = "properties.roundTripTimeMin", access = JsonProperty.Access.WRITE_ONLY) + private Long roundTripTimeMin; + + /* + * Average roundtrip time in milliseconds. + */ + @JsonProperty(value = "properties.roundTripTimeAvg", access = JsonProperty.Access.WRITE_ONLY) + private Long roundTripTimeAvg; + + /* + * Maximum roundtrip time in milliseconds. + */ + @JsonProperty(value = "properties.roundTripTimeMax", access = JsonProperty.Access.WRITE_ONLY) + private Long roundTripTimeMax; + + /** + * Get the nextHopId property: The ID of the next hop. + * + * @return the nextHopId value. + */ + public String nextHopId() { + return this.nextHopId; + } + + /** + * Get the linkType property: Link type. + * + * @return the linkType value. + */ + public String linkType() { + return this.linkType; + } + + /** + * Get the issues property: List of issues. + * + * @return the issues value. + */ + public List issues() { + return this.issues; + } + + /** + * Get the context property: Provides additional context on links. + * + * @return the context value. + */ + public Map context() { + return this.context; + } + + /** + * Get the resourceId property: Resource ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the roundTripTimeMin property: Minimum roundtrip time in milliseconds. + * + * @return the roundTripTimeMin value. + */ + public Long roundTripTimeMin() { + return this.roundTripTimeMin; + } + + /** + * Get the roundTripTimeAvg property: Average roundtrip time in milliseconds. + * + * @return the roundTripTimeAvg value. + */ + public Long roundTripTimeAvg() { + return this.roundTripTimeAvg; + } + + /** + * Get the roundTripTimeMax property: Maximum roundtrip time in milliseconds. + * + * @return the roundTripTimeMax value. + */ + public Long roundTripTimeMax() { + return this.roundTripTimeMax; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (issues() != null) { + issues().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfiguration.java new file mode 100644 index 0000000000000..4712cc35ca41c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfiguration.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** HTTP configuration of the connectivity check. */ +@Fluent +public final class HttpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpConfiguration.class); + + /* + * HTTP method. + */ + @JsonProperty(value = "method") + private HttpMethod method; + + /* + * List of HTTP headers. + */ + @JsonProperty(value = "headers") + private List headers; + + /* + * Valid status codes. + */ + @JsonProperty(value = "validStatusCodes") + private List validStatusCodes; + + /** + * Get the method property: HTTP method. + * + * @return the method value. + */ + public HttpMethod method() { + return this.method; + } + + /** + * Set the method property: HTTP method. + * + * @param method the method value to set. + * @return the HttpConfiguration object itself. + */ + public HttpConfiguration withMethod(HttpMethod method) { + this.method = method; + return this; + } + + /** + * Get the headers property: List of HTTP headers. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: List of HTTP headers. + * + * @param headers the headers value to set. + * @return the HttpConfiguration object itself. + */ + public HttpConfiguration withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get the validStatusCodes property: Valid status codes. + * + * @return the validStatusCodes value. + */ + public List validStatusCodes() { + return this.validStatusCodes; + } + + /** + * Set the validStatusCodes property: Valid status codes. + * + * @param validStatusCodes the validStatusCodes value to set. + * @return the HttpConfiguration object itself. + */ + public HttpConfiguration withValidStatusCodes(List validStatusCodes) { + this.validStatusCodes = validStatusCodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (headers() != null) { + headers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfigurationMethod.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfigurationMethod.java new file mode 100644 index 0000000000000..4bbd77f473792 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfigurationMethod.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HttpConfigurationMethod. */ +public final class HttpConfigurationMethod extends ExpandableStringEnum { + /** Static value Get for HttpConfigurationMethod. */ + public static final HttpConfigurationMethod GET = fromString("Get"); + + /** Static value Post for HttpConfigurationMethod. */ + public static final HttpConfigurationMethod POST = fromString("Post"); + + /** + * Creates or finds a HttpConfigurationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpConfigurationMethod. + */ + @JsonCreator + public static HttpConfigurationMethod fromString(String name) { + return fromString(name, HttpConfigurationMethod.class); + } + + /** @return known HttpConfigurationMethod values. */ + public static Collection values() { + return values(HttpConfigurationMethod.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpHeader.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpHeader.java new file mode 100644 index 0000000000000..bedc89ab15896 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpHeader.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.network.generated.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 HTTP header. */ +@Fluent +public final class HttpHeader { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpHeader.class); + + /* + * The name in HTTP header. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value in HTTP header. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: The name in HTTP header. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name in HTTP header. + * + * @param name the name value to set. + * @return the HttpHeader object itself. + */ + public HttpHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value in HTTP header. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value in HTTP header. + * + * @param value the value value to set. + * @return the HttpHeader object itself. + */ + public HttpHeader withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpMethod.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpMethod.java new file mode 100644 index 0000000000000..bdd6c27483913 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpMethod.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HttpMethod. */ +public final class HttpMethod extends ExpandableStringEnum { + /** Static value Get for HttpMethod. */ + public static final HttpMethod GET = fromString("Get"); + + /** + * Creates or finds a HttpMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpMethod. + */ + @JsonCreator + public static HttpMethod fromString(String name) { + return fromString(name, HttpMethod.class); + } + + /** @return known HttpMethod values. */ + public static Collection values() { + return values(HttpMethod.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubBgpConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubBgpConnectionStatus.java new file mode 100644 index 0000000000000..ec6c4cdaa593d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubBgpConnectionStatus.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HubBgpConnectionStatus. */ +public final class HubBgpConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for HubBgpConnectionStatus. */ + public static final HubBgpConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for HubBgpConnectionStatus. */ + public static final HubBgpConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for HubBgpConnectionStatus. */ + public static final HubBgpConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for HubBgpConnectionStatus. */ + public static final HubBgpConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a HubBgpConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HubBgpConnectionStatus. + */ + @JsonCreator + public static HubBgpConnectionStatus fromString(String name) { + return fromString(name, HubBgpConnectionStatus.class); + } + + /** @return known HubBgpConnectionStatus values. */ + public static Collection values() { + return values(HubBgpConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpAddresses.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpAddresses.java new file mode 100644 index 0000000000000..7285c85dce0df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpAddresses.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** IP addresses associated with azure firewall. */ +@Fluent +public final class HubIpAddresses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubIpAddresses.class); + + /* + * Public IP addresses associated with azure firewall. + */ + @JsonProperty(value = "publicIPs") + private HubPublicIpAddresses publicIPs; + + /* + * Private IP Address associated with azure firewall. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /** + * Get the publicIPs property: Public IP addresses associated with azure firewall. + * + * @return the publicIPs value. + */ + public HubPublicIpAddresses publicIPs() { + return this.publicIPs; + } + + /** + * Set the publicIPs property: Public IP addresses associated with azure firewall. + * + * @param publicIPs the publicIPs value to set. + * @return the HubIpAddresses object itself. + */ + public HubIpAddresses withPublicIPs(HubPublicIpAddresses publicIPs) { + this.publicIPs = publicIPs; + return this; + } + + /** + * Get the privateIpAddress property: Private IP Address associated with azure firewall. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Private IP Address associated with azure firewall. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the HubIpAddresses object itself. + */ + public HubIpAddresses withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicIPs() != null) { + publicIPs().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfiguration.java new file mode 100644 index 0000000000000..16aa3620fabfe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfiguration.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; + +/** An immutable client-side representation of HubIpConfiguration. */ +public interface HubIpConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the Ip Configuration. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Ipconfiguration type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the IP configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner object. + * + * @return the inner object. + */ + HubIpConfigurationInner innerModel(); + + /** The entirety of the HubIpConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The HubIpConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the HubIpConfiguration definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the HubIpConfiguration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualHubName. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @return the next definition stage. + */ + WithCreate withExistingVirtualHub(String resourceGroupName, String virtualHubName); + } + /** + * The stage of the HubIpConfiguration 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.WithName, + DefinitionStages.WithPrivateIpAddress, + DefinitionStages.WithPrivateIpAllocationMethod, + DefinitionStages.WithSubnet, + DefinitionStages.WithPublicIpAddress { + /** + * Executes the create request. + * + * @return the created resource. + */ + HubIpConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HubIpConfiguration create(Context context); + } + /** The stage of the HubIpConfiguration definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the Ip Configuration.. + * + * @param name Name of the Ip Configuration. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the HubIpConfiguration definition allowing to specify privateIpAddress. */ + interface WithPrivateIpAddress { + /** + * Specifies the privateIpAddress property: The private IP address of the IP configuration.. + * + * @param privateIpAddress The private IP address of the IP configuration. + * @return the next definition stage. + */ + WithCreate withPrivateIpAddress(String privateIpAddress); + } + /** The stage of the HubIpConfiguration definition allowing to specify privateIpAllocationMethod. */ + interface WithPrivateIpAllocationMethod { + /** + * Specifies the privateIpAllocationMethod property: The private IP address allocation method.. + * + * @param privateIpAllocationMethod The private IP address allocation method. + * @return the next definition stage. + */ + WithCreate withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod); + } + /** The stage of the HubIpConfiguration definition allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: The reference to the subnet resource.. + * + * @param subnet The reference to the subnet resource. + * @return the next definition stage. + */ + WithCreate withSubnet(SubnetInner subnet); + } + /** The stage of the HubIpConfiguration definition allowing to specify publicIpAddress. */ + interface WithPublicIpAddress { + /** + * Specifies the publicIpAddress property: The reference to the public IP resource.. + * + * @param publicIpAddress The reference to the public IP resource. + * @return the next definition stage. + */ + WithCreate withPublicIpAddress(PublicIpAddressInner publicIpAddress); + } + } + /** + * Begins update for the HubIpConfiguration resource. + * + * @return the stage of resource update. + */ + HubIpConfiguration.Update update(); + + /** The template for HubIpConfiguration update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithPrivateIpAddress, + UpdateStages.WithPrivateIpAllocationMethod, + UpdateStages.WithSubnet, + UpdateStages.WithPublicIpAddress { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HubIpConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HubIpConfiguration apply(Context context); + } + /** The HubIpConfiguration update stages. */ + interface UpdateStages { + /** The stage of the HubIpConfiguration update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the Ip Configuration.. + * + * @param name Name of the Ip Configuration. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the HubIpConfiguration update allowing to specify privateIpAddress. */ + interface WithPrivateIpAddress { + /** + * Specifies the privateIpAddress property: The private IP address of the IP configuration.. + * + * @param privateIpAddress The private IP address of the IP configuration. + * @return the next definition stage. + */ + Update withPrivateIpAddress(String privateIpAddress); + } + /** The stage of the HubIpConfiguration update allowing to specify privateIpAllocationMethod. */ + interface WithPrivateIpAllocationMethod { + /** + * Specifies the privateIpAllocationMethod property: The private IP address allocation method.. + * + * @param privateIpAllocationMethod The private IP address allocation method. + * @return the next definition stage. + */ + Update withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod); + } + /** The stage of the HubIpConfiguration update allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: The reference to the subnet resource.. + * + * @param subnet The reference to the subnet resource. + * @return the next definition stage. + */ + Update withSubnet(SubnetInner subnet); + } + /** The stage of the HubIpConfiguration update allowing to specify publicIpAddress. */ + interface WithPublicIpAddress { + /** + * Specifies the publicIpAddress property: The reference to the public IP resource.. + * + * @param publicIpAddress The reference to the public IP resource. + * @return the next definition stage. + */ + Update withPublicIpAddress(PublicIpAddressInner publicIpAddress); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HubIpConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HubIpConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubPublicIpAddresses.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubPublicIpAddresses.java new file mode 100644 index 0000000000000..43509a5d047a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubPublicIpAddresses.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.network.generated.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; + +/** Public IP addresses associated with azure firewall. */ +@Fluent +public final class HubPublicIpAddresses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubPublicIpAddresses.class); + + /* + * The list of Public IP addresses associated with azure firewall or IP + * addresses to be retained. + */ + @JsonProperty(value = "addresses") + private List addresses; + + /* + * The number of Public IP addresses associated with azure firewall. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Get the addresses property: The list of Public IP addresses associated with azure firewall or IP addresses to be + * retained. + * + * @return the addresses value. + */ + public List addresses() { + return this.addresses; + } + + /** + * Set the addresses property: The list of Public IP addresses associated with azure firewall or IP addresses to be + * retained. + * + * @param addresses the addresses value to set. + * @return the HubPublicIpAddresses object itself. + */ + public HubPublicIpAddresses withAddresses(List addresses) { + this.addresses = addresses; + return this; + } + + /** + * Get the count property: The number of Public IP addresses associated with azure firewall. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The number of Public IP addresses associated with azure firewall. + * + * @param count the count value to set. + * @return the HubPublicIpAddresses object itself. + */ + public HubPublicIpAddresses withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (addresses() != null) { + addresses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoute.java new file mode 100644 index 0000000000000..3ef41ee4f9692 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoute.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.network.generated.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; + +/** RouteTable route. */ +@Fluent +public final class HubRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubRoute.class); + + /* + * The name of the Route that is unique within a RouteTable. This name can + * be used to access this route. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of destinations (eg: CIDR, ResourceId, Service). + */ + @JsonProperty(value = "destinationType", required = true) + private String destinationType; + + /* + * List of all destinations. + */ + @JsonProperty(value = "destinations", required = true) + private List destinations; + + /* + * The type of next hop (eg: ResourceId). + */ + @JsonProperty(value = "nextHopType", required = true) + private String nextHopType; + + /* + * NextHop resource ID. + */ + @JsonProperty(value = "nextHop", required = true) + private String nextHop; + + /** + * Get the name property: The name of the Route that is unique within a RouteTable. This name can be used to access + * this route. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the Route that is unique within a RouteTable. This name can be used to access + * this route. + * + * @param name the name value to set. + * @return the HubRoute object itself. + */ + public HubRoute withName(String name) { + this.name = name; + return this; + } + + /** + * Get the destinationType property: The type of destinations (eg: CIDR, ResourceId, Service). + * + * @return the destinationType value. + */ + public String destinationType() { + return this.destinationType; + } + + /** + * Set the destinationType property: The type of destinations (eg: CIDR, ResourceId, Service). + * + * @param destinationType the destinationType value to set. + * @return the HubRoute object itself. + */ + public HubRoute withDestinationType(String destinationType) { + this.destinationType = destinationType; + return this; + } + + /** + * Get the destinations property: List of all destinations. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: List of all destinations. + * + * @param destinations the destinations value to set. + * @return the HubRoute object itself. + */ + public HubRoute withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Get the nextHopType property: The type of next hop (eg: ResourceId). + * + * @return the nextHopType value. + */ + public String nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: The type of next hop (eg: ResourceId). + * + * @param nextHopType the nextHopType value to set. + * @return the HubRoute object itself. + */ + public HubRoute withNextHopType(String nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the nextHop property: NextHop resource ID. + * + * @return the nextHop value. + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Set the nextHop property: NextHop resource ID. + * + * @param nextHop the nextHop value to set. + * @return the HubRoute object itself. + */ + public HubRoute withNextHop(String nextHop) { + this.nextHop = nextHop; + 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 HubRoute")); + } + if (destinationType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property destinationType in model HubRoute")); + } + if (destinations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property destinations in model HubRoute")); + } + if (nextHopType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextHopType in model HubRoute")); + } + if (nextHop() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextHop in model HubRoute")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTable.java new file mode 100644 index 0000000000000..2a1367d7e2ffc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTable.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import java.util.List; + +/** An immutable client-side representation of HubRouteTable. */ +public interface HubRouteTable { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the routes property: List of all routes. + * + * @return the routes value. + */ + List routes(); + + /** + * Gets the labels property: List of labels associated with this route table. + * + * @return the labels value. + */ + List labels(); + + /** + * Gets the associatedConnections property: List of all connections associated with this route table. + * + * @return the associatedConnections value. + */ + List associatedConnections(); + + /** + * Gets the propagatingConnections property: List of all connections that advertise to this route table. + * + * @return the propagatingConnections value. + */ + List propagatingConnections(); + + /** + * Gets the provisioningState property: The provisioning state of the RouteTable resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner object. + * + * @return the inner object. + */ + HubRouteTableInner innerModel(); + + /** The entirety of the HubRouteTable definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The HubRouteTable definition stages. */ + interface DefinitionStages { + /** The first stage of the HubRouteTable definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the HubRouteTable definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualHubName. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @return the next definition stage. + */ + WithCreate withExistingVirtualHub(String resourceGroupName, String virtualHubName); + } + /** + * The stage of the HubRouteTable 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.WithName, DefinitionStages.WithRoutes, DefinitionStages.WithLabels { + /** + * Executes the create request. + * + * @return the created resource. + */ + HubRouteTable create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HubRouteTable create(Context context); + } + /** The stage of the HubRouteTable definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the HubRouteTable definition allowing to specify routes. */ + interface WithRoutes { + /** + * Specifies the routes property: List of all routes.. + * + * @param routes List of all routes. + * @return the next definition stage. + */ + WithCreate withRoutes(List routes); + } + /** The stage of the HubRouteTable definition allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels associated with this route table.. + * + * @param labels List of labels associated with this route table. + * @return the next definition stage. + */ + WithCreate withLabels(List labels); + } + } + /** + * Begins update for the HubRouteTable resource. + * + * @return the stage of resource update. + */ + HubRouteTable.Update update(); + + /** The template for HubRouteTable update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithRoutes, UpdateStages.WithLabels { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HubRouteTable apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HubRouteTable apply(Context context); + } + /** The HubRouteTable update stages. */ + interface UpdateStages { + /** The stage of the HubRouteTable update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the HubRouteTable update allowing to specify routes. */ + interface WithRoutes { + /** + * Specifies the routes property: List of all routes.. + * + * @param routes List of all routes. + * @return the next definition stage. + */ + Update withRoutes(List routes); + } + /** The stage of the HubRouteTable update allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels associated with this route table.. + * + * @param labels List of labels associated with this route table. + * @return the next definition stage. + */ + Update withLabels(List labels); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HubRouteTable refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HubRouteTable refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTables.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTables.java new file mode 100644 index 0000000000000..92a3fc2d2bc1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTables.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.network.generated.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 HubRouteTables. */ +public interface HubRouteTables { + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + HubRouteTable get(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String routeTableName); + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String routeTableName, Context context); + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves the details of a RouteTable. + * + * @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 routeTable resource in a virtual hub. + */ + HubRouteTable getById(String id); + + /** + * Retrieves the details of a RouteTable. + * + * @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 routeTable resource in a virtual hub. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a RouteTable. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a RouteTable. + * + * @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 HubRouteTable resource. + * + * @param name resource name. + * @return the first stage of the new HubRouteTable definition. + */ + HubRouteTable.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnection.java new file mode 100644 index 0000000000000..082b8fecaff92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnection.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.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; + +/** An immutable client-side representation of HubVirtualNetworkConnection. */ +public interface HubVirtualNetworkConnection { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the remoteVirtualNetwork property: Reference to the remote virtual network. + * + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * Gets the allowHubToRemoteVnetTransit property: Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + * + * @return the allowHubToRemoteVnetTransit value. + */ + Boolean allowHubToRemoteVnetTransit(); + + /** + * Gets the allowRemoteVnetToUseHubVnetGateways property: Deprecated: Allow RemoteVnet to use Virtual Hub's + * gateways. + * + * @return the allowRemoteVnetToUseHubVnetGateways value. + */ + Boolean allowRemoteVnetToUseHubVnetGateways(); + + /** + * Gets the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * Gets the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + RoutingConfiguration routingConfiguration(); + + /** + * Gets the provisioningState property: The provisioning state of the hub virtual network connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner object. + * + * @return the inner object. + */ + HubVirtualNetworkConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnections.java new file mode 100644 index 0000000000000..9460c6dcb5646 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnections.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; + +/** Resource collection API of HubVirtualNetworkConnections. */ +public interface HubVirtualNetworkConnections { + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + HubVirtualNetworkConnection createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters); + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + HubVirtualNetworkConnection createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context); + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String connectionName); + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + HubVirtualNetworkConnection get(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeEncryption.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeEncryption.java new file mode 100644 index 0000000000000..19fb20f30e789 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeEncryption.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IkeEncryption. */ +public final class IkeEncryption extends ExpandableStringEnum { + /** Static value DES for IkeEncryption. */ + public static final IkeEncryption DES = fromString("DES"); + + /** Static value DES3 for IkeEncryption. */ + public static final IkeEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IkeEncryption. */ + public static final IkeEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IkeEncryption. */ + public static final IkeEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IkeEncryption. */ + public static final IkeEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES256 for IkeEncryption. */ + public static final IkeEncryption GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeEncryption. */ + public static final IkeEncryption GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeEncryption from its string representation. + * + * @param name a name to look for. + * @return the corresponding IkeEncryption. + */ + @JsonCreator + public static IkeEncryption fromString(String name) { + return fromString(name, IkeEncryption.class); + } + + /** @return known IkeEncryption values. */ + public static Collection values() { + return values(IkeEncryption.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeIntegrity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeIntegrity.java new file mode 100644 index 0000000000000..a39f6581bda74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeIntegrity.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IkeIntegrity. */ +public final class IkeIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IkeIntegrity. */ + public static final IkeIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IkeIntegrity. */ + public static final IkeIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IkeIntegrity. */ + public static final IkeIntegrity SHA256 = fromString("SHA256"); + + /** Static value SHA384 for IkeIntegrity. */ + public static final IkeIntegrity SHA384 = fromString("SHA384"); + + /** Static value GCMAES256 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeIntegrity from its string representation. + * + * @param name a name to look for. + * @return the corresponding IkeIntegrity. + */ + @JsonCreator + public static IkeIntegrity fromString(String name) { + return fromString(name, IkeIntegrity.class); + } + + /** @return known IkeIntegrity values. */ + public static Collection values() { + return values(IkeIntegrity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatPool.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatPool.java new file mode 100644 index 0000000000000..10dcb2c80cbc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatPool.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Inbound NAT pool of the load balancer. */ +@JsonFlatten +@Fluent +public class InboundNatPool extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatPool.class); + + /* + * The name of the resource that is unique within the set of inbound NAT + * pools used by the load balancer. This name can be used to access the + * resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIpConfiguration; + + /* + * The reference to the transport protocol used by the inbound NAT pool. + */ + @JsonProperty(value = "properties.protocol") + private TransportProtocol protocol; + + /* + * The first port number in the range of external ports that will be used + * to provide Inbound Nat to NICs associated with a load balancer. + * Acceptable values range between 1 and 65534. + */ + @JsonProperty(value = "properties.frontendPortRangeStart") + private Integer frontendPortRangeStart; + + /* + * The last port number in the range of external ports that will be used to + * provide Inbound Nat to NICs associated with a load balancer. Acceptable + * values range between 1 and 65535. + */ + @JsonProperty(value = "properties.frontendPortRangeEnd") + private Integer frontendPortRangeEnd; + + /* + * The port used for internal connections on the endpoint. Acceptable + * values are between 1 and 65535. + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /* + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIp; + + /* + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /* + * The provisioning state of the inbound NAT pool resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within the set of inbound NAT pools used by the + * load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the set of inbound NAT pools used by the + * load balancer. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the InboundNatPool object itself. + */ + public InboundNatPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @return the frontendIpConfiguration value. + */ + public SubResource frontendIpConfiguration() { + return this.frontendIpConfiguration; + } + + /** + * Set the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @param frontendIpConfiguration the frontendIpConfiguration value to set. + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendIpConfiguration(SubResource frontendIpConfiguration) { + this.frontendIpConfiguration = frontendIpConfiguration; + return this; + } + + /** + * Get the protocol property: The reference to the transport protocol used by the inbound NAT pool. + * + * @return the protocol value. + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The reference to the transport protocol used by the inbound NAT pool. + * + * @param protocol the protocol value to set. + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the frontendPortRangeStart property: The first port number in the range of external ports that will be used + * to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + * + * @return the frontendPortRangeStart value. + */ + public Integer frontendPortRangeStart() { + return this.frontendPortRangeStart; + } + + /** + * Set the frontendPortRangeStart property: The first port number in the range of external ports that will be used + * to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + * + * @param frontendPortRangeStart the frontendPortRangeStart value to set. + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeStart(Integer frontendPortRangeStart) { + this.frontendPortRangeStart = frontendPortRangeStart; + return this; + } + + /** + * Get the frontendPortRangeEnd property: The last port number in the range of external ports that will be used to + * provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + * + * @return the frontendPortRangeEnd value. + */ + public Integer frontendPortRangeEnd() { + return this.frontendPortRangeEnd; + } + + /** + * Set the frontendPortRangeEnd property: The last port number in the range of external ports that will be used to + * provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + * + * @param frontendPortRangeEnd the frontendPortRangeEnd value to set. + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeEnd(Integer frontendPortRangeEnd) { + this.frontendPortRangeEnd = frontendPortRangeEnd; + return this; + } + + /** + * Get the backendPort property: The port used for internal connections on the endpoint. Acceptable values are + * between 1 and 65535. + * + * @return the backendPort value. + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the backendPort property: The port used for internal connections on the endpoint. Acceptable values are + * between 1 and 65535. + * + * @param backendPort the backendPort value to set. + * @return the InboundNatPool object itself. + */ + public InboundNatPool withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the InboundNatPool object itself. + */ + public InboundNatPool withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIp value. + */ + public Boolean enableFloatingIp() { + return this.enableFloatingIp; + } + + /** + * Set the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIp the enableFloatingIp value to set. + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEnableFloatingIp(Boolean enableFloatingIp) { + this.enableFloatingIp = enableFloatingIp; + return this; + } + + /** + * Get the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value. + */ + public Boolean enableTcpReset() { + return this.enableTcpReset; + } + + /** + * Set the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set. + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the inbound NAT pool resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public InboundNatPool withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRule.java new file mode 100644 index 0000000000000..5efa80a56193f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRule.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; + +/** An immutable client-side representation of InboundNatRule. */ +public interface InboundNatRule { + /** + * 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 that is unique within the set of inbound NAT rules used by the + * load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @return the frontendIpConfiguration value. + */ + SubResource frontendIpConfiguration(); + + /** + * Gets the backendIpConfiguration property: A reference to a private IP address defined on a network interface of a + * VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. + * + * @return the backendIpConfiguration value. + */ + NetworkInterfaceIpConfiguration backendIpConfiguration(); + + /** + * Gets the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * Gets the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @return the frontendPort value. + */ + Integer frontendPort(); + + /** + * Gets the backendPort property: The port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * Gets the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * Gets the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIp value. + */ + Boolean enableFloatingIp(); + + /** + * Gets the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * Gets the provisioningState property: The provisioning state of the inbound NAT rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner object. + * + * @return the inner object. + */ + InboundNatRuleInner innerModel(); + + /** The entirety of the InboundNatRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The InboundNatRule definition stages. */ + interface DefinitionStages { + /** The first stage of the InboundNatRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the InboundNatRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, loadBalancerName. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @return the next definition stage. + */ + WithCreate withExistingLoadBalancer(String resourceGroupName, String loadBalancerName); + } + /** + * The stage of the InboundNatRule 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.WithName, + DefinitionStages.WithFrontendIpConfiguration, + DefinitionStages.WithProtocol, + DefinitionStages.WithFrontendPort, + DefinitionStages.WithBackendPort, + DefinitionStages.WithIdleTimeoutInMinutes, + DefinitionStages.WithEnableFloatingIp, + DefinitionStages.WithEnableTcpReset { + /** + * Executes the create request. + * + * @return the created resource. + */ + InboundNatRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + InboundNatRule create(Context context); + } + /** The stage of the InboundNatRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within the set of inbound NAT rules + * used by the load balancer. This name can be used to access the resource.. + * + * @param name The name of the resource that is unique within the set of inbound NAT rules used by the load + * balancer. This name can be used to access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the InboundNatRule definition allowing to specify frontendIpConfiguration. */ + interface WithFrontendIpConfiguration { + /** + * Specifies the frontendIpConfiguration property: A reference to frontend IP addresses.. + * + * @param frontendIpConfiguration A reference to frontend IP addresses. + * @return the next definition stage. + */ + WithCreate withFrontendIpConfiguration(SubResource frontendIpConfiguration); + } + /** The stage of the InboundNatRule definition allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: The reference to the transport protocol used by the load balancing + * rule.. + * + * @param protocol The reference to the transport protocol used by the load balancing rule. + * @return the next definition stage. + */ + WithCreate withProtocol(TransportProtocol protocol); + } + /** The stage of the InboundNatRule definition allowing to specify frontendPort. */ + interface WithFrontendPort { + /** + * Specifies the frontendPort property: The port for the external endpoint. Port numbers for each rule must + * be unique within the Load Balancer. Acceptable values range from 1 to 65534.. + * + * @param frontendPort The port for the external endpoint. Port numbers for each rule must be unique within + * the Load Balancer. Acceptable values range from 1 to 65534. + * @return the next definition stage. + */ + WithCreate withFrontendPort(Integer frontendPort); + } + /** The stage of the InboundNatRule definition allowing to specify backendPort. */ + interface WithBackendPort { + /** + * Specifies the backendPort property: The port used for the internal endpoint. Acceptable values range from + * 1 to 65535.. + * + * @param backendPort The port used for the internal endpoint. Acceptable values range from 1 to 65535. + * @return the next definition stage. + */ + WithCreate withBackendPort(Integer backendPort); + } + /** The stage of the InboundNatRule definition allowing to specify idleTimeoutInMinutes. */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be + * set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol + * is set to TCP.. + * + * @param idleTimeoutInMinutes The timeout for the TCP idle connection. The value can be set between 4 and + * 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to + * TCP. + * @return the next definition stage. + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + /** The stage of the InboundNatRule definition allowing to specify enableFloatingIp. */ + interface WithEnableFloatingIp { + /** + * Specifies the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP + * capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using + * the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the + * endpoint.. + * + * @param enableFloatingIp Configures a virtual machine's endpoint for the floating IP capability required + * to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * @return the next definition stage. + */ + WithCreate withEnableFloatingIp(Boolean enableFloatingIp); + } + /** The stage of the InboundNatRule definition allowing to specify enableTcpReset. */ + interface WithEnableTcpReset { + /** + * Specifies the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or + * unexpected connection termination. This element is only used when the protocol is set to TCP.. + * + * @param enableTcpReset Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection + * termination. This element is only used when the protocol is set to TCP. + * @return the next definition stage. + */ + WithCreate withEnableTcpReset(Boolean enableTcpReset); + } + } + /** + * Begins update for the InboundNatRule resource. + * + * @return the stage of resource update. + */ + InboundNatRule.Update update(); + + /** The template for InboundNatRule update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithFrontendIpConfiguration, + UpdateStages.WithProtocol, + UpdateStages.WithFrontendPort, + UpdateStages.WithBackendPort, + UpdateStages.WithIdleTimeoutInMinutes, + UpdateStages.WithEnableFloatingIp, + UpdateStages.WithEnableTcpReset { + /** + * Executes the update request. + * + * @return the updated resource. + */ + InboundNatRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + InboundNatRule apply(Context context); + } + /** The InboundNatRule update stages. */ + interface UpdateStages { + /** The stage of the InboundNatRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within the set of inbound NAT rules + * used by the load balancer. This name can be used to access the resource.. + * + * @param name The name of the resource that is unique within the set of inbound NAT rules used by the load + * balancer. This name can be used to access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the InboundNatRule update allowing to specify frontendIpConfiguration. */ + interface WithFrontendIpConfiguration { + /** + * Specifies the frontendIpConfiguration property: A reference to frontend IP addresses.. + * + * @param frontendIpConfiguration A reference to frontend IP addresses. + * @return the next definition stage. + */ + Update withFrontendIpConfiguration(SubResource frontendIpConfiguration); + } + /** The stage of the InboundNatRule update allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: The reference to the transport protocol used by the load balancing + * rule.. + * + * @param protocol The reference to the transport protocol used by the load balancing rule. + * @return the next definition stage. + */ + Update withProtocol(TransportProtocol protocol); + } + /** The stage of the InboundNatRule update allowing to specify frontendPort. */ + interface WithFrontendPort { + /** + * Specifies the frontendPort property: The port for the external endpoint. Port numbers for each rule must + * be unique within the Load Balancer. Acceptable values range from 1 to 65534.. + * + * @param frontendPort The port for the external endpoint. Port numbers for each rule must be unique within + * the Load Balancer. Acceptable values range from 1 to 65534. + * @return the next definition stage. + */ + Update withFrontendPort(Integer frontendPort); + } + /** The stage of the InboundNatRule update allowing to specify backendPort. */ + interface WithBackendPort { + /** + * Specifies the backendPort property: The port used for the internal endpoint. Acceptable values range from + * 1 to 65535.. + * + * @param backendPort The port used for the internal endpoint. Acceptable values range from 1 to 65535. + * @return the next definition stage. + */ + Update withBackendPort(Integer backendPort); + } + /** The stage of the InboundNatRule update allowing to specify idleTimeoutInMinutes. */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be + * set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol + * is set to TCP.. + * + * @param idleTimeoutInMinutes The timeout for the TCP idle connection. The value can be set between 4 and + * 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to + * TCP. + * @return the next definition stage. + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + /** The stage of the InboundNatRule update allowing to specify enableFloatingIp. */ + interface WithEnableFloatingIp { + /** + * Specifies the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP + * capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using + * the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the + * endpoint.. + * + * @param enableFloatingIp Configures a virtual machine's endpoint for the floating IP capability required + * to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * @return the next definition stage. + */ + Update withEnableFloatingIp(Boolean enableFloatingIp); + } + /** The stage of the InboundNatRule update allowing to specify enableTcpReset. */ + interface WithEnableTcpReset { + /** + * Specifies the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or + * unexpected connection termination. This element is only used when the protocol is set to TCP.. + * + * @param enableTcpReset Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection + * termination. This element is only used when the protocol is set to TCP. + * @return the next definition stage. + */ + Update withEnableTcpReset(Boolean enableTcpReset); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + InboundNatRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + InboundNatRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRuleListResult.java new file mode 100644 index 0000000000000..1c4b427b0c819 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListInboundNatRule API service call. */ +@Fluent +public final class InboundNatRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRuleListResult.class); + + /* + * A list of inbound nat rules in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of inbound nat rules in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of inbound nat rules in a load balancer. + * + * @param value the value value to set. + * @return the InboundNatRuleListResult object itself. + */ + public InboundNatRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRules.java new file mode 100644 index 0000000000000..51c06a80850e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRules.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 InboundNatRules. */ +public interface InboundNatRules { + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound nat rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, String inboundNatRuleName); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, String inboundNatRuleName, Context context); + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + InboundNatRule get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context); + + /** + * Gets the specified load balancer inbound nat rule. + * + * @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 the specified load balancer inbound nat rule. + */ + InboundNatRule getById(String id); + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound nat rule. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @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 InboundNatRule resource. + * + * @param name resource name. + * @return the first stage of the new InboundNatRule definition. + */ + InboundNatRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRule.java new file mode 100644 index 0000000000000..d5790205b2c50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRule.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; +import java.util.List; + +/** An immutable client-side representation of InboundSecurityRule. */ +public interface InboundSecurityRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of security rule collection. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: NVA inbound security rule type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the rules property: List of allowed rules. + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner object. + * + * @return the inner object. + */ + InboundSecurityRuleInner innerModel(); + + /** The entirety of the InboundSecurityRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The InboundSecurityRule definition stages. */ + interface DefinitionStages { + /** The first stage of the InboundSecurityRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the InboundSecurityRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkVirtualApplianceName. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @return the next definition stage. + */ + WithCreate withExistingNetworkVirtualAppliance( + String resourceGroupName, String networkVirtualApplianceName); + } + /** + * The stage of the InboundSecurityRule 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.WithName, DefinitionStages.WithRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + InboundSecurityRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + InboundSecurityRule create(Context context); + } + /** The stage of the InboundSecurityRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of security rule collection.. + * + * @param name Name of security rule collection. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the InboundSecurityRule definition allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: List of allowed rules.. + * + * @param rules List of allowed rules. + * @return the next definition stage. + */ + WithCreate withRules(List rules); + } + } + /** + * Begins update for the InboundSecurityRule resource. + * + * @return the stage of resource update. + */ + InboundSecurityRule.Update update(); + + /** The template for InboundSecurityRule update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + InboundSecurityRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + InboundSecurityRule apply(Context context); + } + /** The InboundSecurityRule update stages. */ + interface UpdateStages { + /** The stage of the InboundSecurityRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of security rule collection.. + * + * @param name Name of security rule collection. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the InboundSecurityRule update allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: List of allowed rules.. + * + * @param rules List of allowed rules. + * @return the next definition stage. + */ + Update withRules(List rules); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java new file mode 100644 index 0000000000000..e1477f1385f72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +/** Resource collection API of InboundSecurityRuleOperations. */ +public interface InboundSecurityRuleOperations { + /** + * Begins definition for a new InboundSecurityRule resource. + * + * @param name resource name. + * @return the first stage of the new InboundSecurityRule definition. + */ + InboundSecurityRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.java new file mode 100644 index 0000000000000..bb1b4e44a6f32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.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.network.generated.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; + +/** Properties of the Inbound Security Rules resource. */ +@Fluent +public final class InboundSecurityRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundSecurityRules.class); + + /* + * Protocol. This should be either TCP or UDP. + */ + @JsonProperty(value = "protocol") + private InboundSecurityRulesProtocol protocol; + + /* + * The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are + * allowed. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /* + * NVA port ranges to be opened up. One needs to provide specific ports. + */ + @JsonProperty(value = "destinationPortRange") + private Integer destinationPortRange; + + /** + * Get the protocol property: Protocol. This should be either TCP or UDP. + * + * @return the protocol value. + */ + public InboundSecurityRulesProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol. This should be either TCP or UDP. + * + * @param protocol the protocol value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withProtocol(InboundSecurityRulesProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourceAddressPrefix property: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. + * + * @return the sourceAddressPrefix value. + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the sourceAddressPrefix property: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the destinationPortRange property: NVA port ranges to be opened up. One needs to provide specific ports. + * + * @return the destinationPortRange value. + */ + public Integer destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destinationPortRange property: NVA port ranges to be opened up. One needs to provide specific ports. + * + * @param destinationPortRange the destinationPortRange value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withDestinationPortRange(Integer destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java new file mode 100644 index 0000000000000..456e6cba69325 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InboundSecurityRulesProtocol. */ +public final class InboundSecurityRulesProtocol extends ExpandableStringEnum { + /** Static value TCP for InboundSecurityRulesProtocol. */ + public static final InboundSecurityRulesProtocol TCP = fromString("TCP"); + + /** Static value UDP for InboundSecurityRulesProtocol. */ + public static final InboundSecurityRulesProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a InboundSecurityRulesProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding InboundSecurityRulesProtocol. + */ + @JsonCreator + public static InboundSecurityRulesProtocol fromString(String name) { + return fromString(name, InboundSecurityRulesProtocol.class); + } + + /** @return known InboundSecurityRulesProtocol values. */ + public static Collection values() { + return values(InboundSecurityRulesProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.java new file mode 100644 index 0000000000000..606a45cde6697 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import java.util.List; + +/** An immutable client-side representation of IpAddressAvailabilityResult. */ +public interface IpAddressAvailabilityResult { + /** + * Gets the available property: Private IP address availability. + * + * @return the available value. + */ + Boolean available(); + + /** + * Gets the availableIpAddresses property: Contains other available private IP addresses if the asked for address is + * taken. + * + * @return the availableIpAddresses value. + */ + List availableIpAddresses(); + + /** + * Gets the isPlatformReserved property: Private IP address platform reserved. + * + * @return the isPlatformReserved value. + */ + Boolean isPlatformReserved(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner object. + * + * @return the inner object. + */ + IpAddressAvailabilityResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java new file mode 100644 index 0000000000000..093ece50fcb0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import java.util.Map; + +/** An immutable client-side representation of IpAllocation. */ +public interface IpAllocation { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the subnet property: The Subnet that using the prefix of this IpAllocation resource. + * + * @return the subnet value. + */ + SubResource subnet(); + + /** + * Gets the virtualNetwork property: The VirtualNetwork that using the prefix of this IpAllocation resource. + * + * @return the virtualNetwork value. + */ + SubResource virtualNetwork(); + + /** + * Gets the typePropertiesType property: The type for the IpAllocation. + * + * @return the typePropertiesType value. + */ + IpAllocationType typePropertiesType(); + + /** + * Gets the prefix property: The address prefix for the IpAllocation. + * + * @return the prefix value. + */ + String prefix(); + + /** + * Gets the prefixLength property: The address prefix length for the IpAllocation. + * + * @return the prefixLength value. + */ + Integer prefixLength(); + + /** + * Gets the prefixType property: The address prefix Type for the IpAllocation. + * + * @return the prefixType value. + */ + IpVersion prefixType(); + + /** + * Gets the ipamAllocationId property: The IPAM allocation ID. + * + * @return the ipamAllocationId value. + */ + String ipamAllocationId(); + + /** + * Gets the allocationTags property: IpAllocation tags. + * + * @return the allocationTags value. + */ + Map allocationTags(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.IpAllocationInner object. + * + * @return the inner object. + */ + IpAllocationInner innerModel(); + + /** The entirety of the IpAllocation definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The IpAllocation definition stages. */ + interface DefinitionStages { + /** The first stage of the IpAllocation definition. */ + interface Blank extends WithLocation { + } + /** The stage of the IpAllocation 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 IpAllocation definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the IpAllocation 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.WithTypePropertiesType, + DefinitionStages.WithPrefix, + DefinitionStages.WithPrefixLength, + DefinitionStages.WithPrefixType, + DefinitionStages.WithIpamAllocationId, + DefinitionStages.WithAllocationTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpAllocation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpAllocation create(Context context); + } + /** The stage of the IpAllocation 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 IpAllocation definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type for the IpAllocation.. + * + * @param typePropertiesType The type for the IpAllocation. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(IpAllocationType typePropertiesType); + } + /** The stage of the IpAllocation definition allowing to specify prefix. */ + interface WithPrefix { + /** + * Specifies the prefix property: The address prefix for the IpAllocation.. + * + * @param prefix The address prefix for the IpAllocation. + * @return the next definition stage. + */ + WithCreate withPrefix(String prefix); + } + /** The stage of the IpAllocation definition allowing to specify prefixLength. */ + interface WithPrefixLength { + /** + * Specifies the prefixLength property: The address prefix length for the IpAllocation.. + * + * @param prefixLength The address prefix length for the IpAllocation. + * @return the next definition stage. + */ + WithCreate withPrefixLength(Integer prefixLength); + } + /** The stage of the IpAllocation definition allowing to specify prefixType. */ + interface WithPrefixType { + /** + * Specifies the prefixType property: The address prefix Type for the IpAllocation.. + * + * @param prefixType The address prefix Type for the IpAllocation. + * @return the next definition stage. + */ + WithCreate withPrefixType(IpVersion prefixType); + } + /** The stage of the IpAllocation definition allowing to specify ipamAllocationId. */ + interface WithIpamAllocationId { + /** + * Specifies the ipamAllocationId property: The IPAM allocation ID.. + * + * @param ipamAllocationId The IPAM allocation ID. + * @return the next definition stage. + */ + WithCreate withIpamAllocationId(String ipamAllocationId); + } + /** The stage of the IpAllocation definition allowing to specify allocationTags. */ + interface WithAllocationTags { + /** + * Specifies the allocationTags property: IpAllocation tags.. + * + * @param allocationTags IpAllocation tags. + * @return the next definition stage. + */ + WithCreate withAllocationTags(Map allocationTags); + } + } + /** + * Begins update for the IpAllocation resource. + * + * @return the stage of resource update. + */ + IpAllocation.Update update(); + + /** The template for IpAllocation update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpAllocation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpAllocation apply(Context context); + } + /** The IpAllocation update stages. */ + interface UpdateStages { + /** The stage of the IpAllocation 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpAllocation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpAllocation refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.java new file mode 100644 index 0000000000000..fd03b446b85c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListIpAllocations API service call. */ +@Fluent +public final class IpAllocationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAllocationListResult.class); + + /* + * A list of IpAllocation resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of IpAllocation resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of IpAllocation resources. + * + * @param value the value value to set. + * @return the IpAllocationListResult object itself. + */ + public IpAllocationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the IpAllocationListResult object itself. + */ + public IpAllocationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.java new file mode 100644 index 0000000000000..9ec4de11fa1aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpAllocationMethod. */ +public final class IpAllocationMethod extends ExpandableStringEnum { + /** Static value Static for IpAllocationMethod. */ + public static final IpAllocationMethod STATIC = fromString("Static"); + + /** Static value Dynamic for IpAllocationMethod. */ + public static final IpAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a IpAllocationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAllocationMethod. + */ + @JsonCreator + public static IpAllocationMethod fromString(String name) { + return fromString(name, IpAllocationMethod.class); + } + + /** @return known IpAllocationMethod values. */ + public static Collection values() { + return values(IpAllocationMethod.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.java new file mode 100644 index 0000000000000..5832c5c537b99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpAllocationType. */ +public final class IpAllocationType extends ExpandableStringEnum { + /** Static value Undefined for IpAllocationType. */ + public static final IpAllocationType UNDEFINED = fromString("Undefined"); + + /** Static value Hypernet for IpAllocationType. */ + public static final IpAllocationType HYPERNET = fromString("Hypernet"); + + /** + * Creates or finds a IpAllocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAllocationType. + */ + @JsonCreator + public static IpAllocationType fromString(String name) { + return fromString(name, IpAllocationType.class); + } + + /** @return known IpAllocationType values. */ + public static Collection values() { + return values(IpAllocationType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.java new file mode 100644 index 0000000000000..3baf9eec75446 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 IpAllocations. */ +public interface IpAllocations { + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipAllocationName); + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipAllocationName, Context context); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + IpAllocation getByResourceGroup(String resourceGroupName, String ipAllocationName); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipAllocationName, String expand, Context context); + + /** + * Gets all IpAllocations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + PagedIterable list(); + + /** + * Gets all IpAllocations 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 all IpAllocations in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource 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 all IpAllocations in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified IpAllocation by resource group. + * + * @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 the specified IpAllocation by resource group. + */ + IpAllocation getById(String id); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified IpAllocation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified IpAllocation. + * + * @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 IpAllocation resource. + * + * @param name resource name. + * @return the first stage of the new IpAllocation definition. + */ + IpAllocation.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfiguration.java new file mode 100644 index 0000000000000..46481096c0587 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfiguration.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; + +/** An immutable client-side representation of IpConfiguration. */ +public interface IpConfiguration { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the IP configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner object. + * + * @return the inner object. + */ + IpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.java new file mode 100644 index 0000000000000..6a5b16b39b8d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Properties of IPConfigurationBgpPeeringAddress. */ +@Fluent +public final class IpConfigurationBgpPeeringAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationBgpPeeringAddress.class); + + /* + * The ID of IP configuration which belongs to gateway. + */ + @JsonProperty(value = "ipconfigurationId") + private String ipconfigurationId; + + /* + * The list of default BGP peering addresses which belong to IP + * configuration. + */ + @JsonProperty(value = "defaultBgpIpAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List defaultBgpIpAddresses; + + /* + * The list of custom BGP peering addresses which belong to IP + * configuration. + */ + @JsonProperty(value = "customBgpIpAddresses") + private List customBgpIpAddresses; + + /* + * The list of tunnel public IP addresses which belong to IP configuration. + */ + @JsonProperty(value = "tunnelIpAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelIpAddresses; + + /** + * Get the ipconfigurationId property: The ID of IP configuration which belongs to gateway. + * + * @return the ipconfigurationId value. + */ + public String ipconfigurationId() { + return this.ipconfigurationId; + } + + /** + * Set the ipconfigurationId property: The ID of IP configuration which belongs to gateway. + * + * @param ipconfigurationId the ipconfigurationId value to set. + * @return the IpConfigurationBgpPeeringAddress object itself. + */ + public IpConfigurationBgpPeeringAddress withIpconfigurationId(String ipconfigurationId) { + this.ipconfigurationId = ipconfigurationId; + return this; + } + + /** + * Get the defaultBgpIpAddresses property: The list of default BGP peering addresses which belong to IP + * configuration. + * + * @return the defaultBgpIpAddresses value. + */ + public List defaultBgpIpAddresses() { + return this.defaultBgpIpAddresses; + } + + /** + * Get the customBgpIpAddresses property: The list of custom BGP peering addresses which belong to IP configuration. + * + * @return the customBgpIpAddresses value. + */ + public List customBgpIpAddresses() { + return this.customBgpIpAddresses; + } + + /** + * Set the customBgpIpAddresses property: The list of custom BGP peering addresses which belong to IP configuration. + * + * @param customBgpIpAddresses the customBgpIpAddresses value to set. + * @return the IpConfigurationBgpPeeringAddress object itself. + */ + public IpConfigurationBgpPeeringAddress withCustomBgpIpAddresses(List customBgpIpAddresses) { + this.customBgpIpAddresses = customBgpIpAddresses; + return this; + } + + /** + * Get the tunnelIpAddresses property: The list of tunnel public IP addresses which belong to IP configuration. + * + * @return the tunnelIpAddresses value. + */ + public List tunnelIpAddresses() { + return this.tunnelIpAddresses; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java new file mode 100644 index 0000000000000..89b3bf2909057 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; + +/** An immutable client-side representation of IpConfigurationProfile. */ +public interface IpConfigurationProfile { + /** + * 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. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Sub Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the subnet property: The reference to the subnet resource to create a container network interface ip + * configuration. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the provisioningState property: The provisioning state of the IP configuration profile resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner object. + * + * @return the inner object. + */ + IpConfigurationProfileInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpFlowProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpFlowProtocol.java new file mode 100644 index 0000000000000..67a3adb9f225d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpFlowProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpFlowProtocol. */ +public final class IpFlowProtocol extends ExpandableStringEnum { + /** Static value TCP for IpFlowProtocol. */ + public static final IpFlowProtocol TCP = fromString("TCP"); + + /** Static value UDP for IpFlowProtocol. */ + public static final IpFlowProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a IpFlowProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpFlowProtocol. + */ + @JsonCreator + public static IpFlowProtocol fromString(String name) { + return fromString(name, IpFlowProtocol.class); + } + + /** @return known IpFlowProtocol values. */ + public static Collection values() { + return values(IpFlowProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroup.java new file mode 100644 index 0000000000000..c08e969ec99e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroup.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of IpGroup. */ +public interface IpGroup { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the provisioningState property: The provisioning state of the IpGroups resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the ipAddresses property: IpAddresses/IpAddressPrefixes in the IpGroups resource. + * + * @return the ipAddresses value. + */ + List ipAddresses(); + + /** + * Gets the firewalls property: List of references to Firewall resources that this IpGroups is associated with. + * + * @return the firewalls value. + */ + List firewalls(); + + /** + * Gets the firewallPolicies property: List of references to Firewall Policies resources that this IpGroups is + * associated with. + * + * @return the firewallPolicies value. + */ + List firewallPolicies(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.IpGroupInner object. + * + * @return the inner object. + */ + IpGroupInner innerModel(); + + /** The entirety of the IpGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The IpGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the IpGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the IpGroup 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 IpGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the IpGroup 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.WithIpAddresses { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpGroup create(Context context); + } + /** The stage of the IpGroup 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 IpGroup definition allowing to specify ipAddresses. */ + interface WithIpAddresses { + /** + * Specifies the ipAddresses property: IpAddresses/IpAddressPrefixes in the IpGroups resource.. + * + * @param ipAddresses IpAddresses/IpAddressPrefixes in the IpGroups resource. + * @return the next definition stage. + */ + WithCreate withIpAddresses(List ipAddresses); + } + } + /** + * Begins update for the IpGroup resource. + * + * @return the stage of resource update. + */ + IpGroup.Update update(); + + /** The template for IpGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpGroup apply(Context context); + } + /** The IpGroup update stages. */ + interface UpdateStages { + /** The stage of the IpGroup 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroupListResult.java new file mode 100644 index 0000000000000..4203e04701192 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListIpGroups API service call. */ +@Fluent +public final class IpGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpGroupListResult.class); + + /* + * The list of IpGroups information resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of IpGroups information resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of IpGroups information resources. + * + * @param value the value value to set. + * @return the IpGroupListResult object itself. + */ + public IpGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the IpGroupListResult object itself. + */ + public IpGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroups.java new file mode 100644 index 0000000000000..fc49aaf8bf835 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroups.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 IpGroups. */ +public interface IpGroups { + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + IpGroup getByResourceGroup(String resourceGroupName, String ipGroupsName); + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipGroupsName, String expand, Context context); + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 ipGroupsName); + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 ipGroupsName, Context context); + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all IpGroups in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + PagedIterable list(); + + /** + * Gets all IpGroups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified ipGroups. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + IpGroup getById(String id); + + /** + * Gets the specified ipGroups. + * + * @param id the resource ID. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified ipGroups. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified ipGroups. + * + * @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.resourcemanager.network.generated.models.ErrorException 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 IpGroup resource. + * + * @param name resource name. + * @return the first stage of the new IpGroup definition. + */ + IpGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpTag.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpTag.java new file mode 100644 index 0000000000000..9f5e10dd0c283 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpTag.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.network.generated.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; + +/** Contains the IpTag associated with the object. */ +@Fluent +public final class IpTag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpTag.class); + + /* + * The IP tag type. Example: FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /* + * The value of the IP tag associated with the public IP. Example: SQL. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get the ipTagType property: The IP tag type. Example: FirstPartyUsage. + * + * @return the ipTagType value. + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set the ipTagType property: The IP tag type. Example: FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set. + * @return the IpTag object itself. + */ + public IpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get the tag property: The value of the IP tag associated with the public IP. Example: SQL. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: The value of the IP tag associated with the public IP. Example: SQL. + * + * @param tag the tag value to set. + * @return the IpTag object itself. + */ + public IpTag withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpVersion.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpVersion.java new file mode 100644 index 0000000000000..ca34aa351a4f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpVersion.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpVersion. */ +public final class IpVersion extends ExpandableStringEnum { + /** Static value IPv4 for IpVersion. */ + public static final IpVersion IPV4 = fromString("IPv4"); + + /** Static value IPv6 for IpVersion. */ + public static final IpVersion IPV6 = fromString("IPv6"); + + /** + * Creates or finds a IpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpVersion. + */ + @JsonCreator + public static IpVersion fromString(String name) { + return fromString(name, IpVersion.class); + } + + /** @return known IpVersion values. */ + public static Collection values() { + return values(IpVersion.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecEncryption.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecEncryption.java new file mode 100644 index 0000000000000..b31aef1ee7add --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecEncryption.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpsecEncryption. */ +public final class IpsecEncryption extends ExpandableStringEnum { + /** Static value None for IpsecEncryption. */ + public static final IpsecEncryption NONE = fromString("None"); + + /** Static value DES for IpsecEncryption. */ + public static final IpsecEncryption DES = fromString("DES"); + + /** Static value DES3 for IpsecEncryption. */ + public static final IpsecEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IpsecEncryption. */ + public static final IpsecEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IpsecEncryption. */ + public static final IpsecEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IpsecEncryption. */ + public static final IpsecEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES128 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecEncryption from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpsecEncryption. + */ + @JsonCreator + public static IpsecEncryption fromString(String name) { + return fromString(name, IpsecEncryption.class); + } + + /** @return known IpsecEncryption values. */ + public static Collection values() { + return values(IpsecEncryption.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecIntegrity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecIntegrity.java new file mode 100644 index 0000000000000..e75ff9eeb82f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecIntegrity.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpsecIntegrity. */ +public final class IpsecIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IpsecIntegrity. */ + public static final IpsecIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA256 = fromString("SHA256"); + + /** Static value GCMAES128 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecIntegrity from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpsecIntegrity. + */ + @JsonCreator + public static IpsecIntegrity fromString(String name) { + return fromString(name, IpsecIntegrity.class); + } + + /** @return known IpsecIntegrity values. */ + public static Collection values() { + return values(IpsecIntegrity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecPolicy.java new file mode 100644 index 0000000000000..02dcd65061698 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecPolicy.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 IPSec Policy configuration for a virtual network gateway connection. */ +@Fluent +public final class IpsecPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpsecPolicy.class); + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /* + * The IPSec encryption algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /* + * The IPSec integrity algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /* + * The IKE encryption algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /* + * The IKE integrity algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /* + * The DH Group used in IKE Phase 1 for initial SA. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /* + * The Pfs Group used in IKE Phase 2 for new child SA. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + * + * @return the saLifeTimeSeconds value. + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + * + * @return the saDataSizeKilobytes value. + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @return the ipsecEncryption value. + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @param ipsecEncryption the ipsecEncryption value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @return the ipsecIntegrity value. + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @param ipsecIntegrity the ipsecIntegrity value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @return the ikeEncryption value. + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @param ikeEncryption the ikeEncryption value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @return the ikeIntegrity value. + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @param ikeIntegrity the ikeIntegrity value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @return the dhGroup value. + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @param dhGroup the dhGroup value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @return the pfsGroup value. + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @param pfsGroup the pfsGroup value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipsecEncryption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipsecEncryption in model IpsecPolicy")); + } + if (ipsecIntegrity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipsecIntegrity in model IpsecPolicy")); + } + if (ikeEncryption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ikeEncryption in model IpsecPolicy")); + } + if (ikeIntegrity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ikeIntegrity in model IpsecPolicy")); + } + if (dhGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dhGroup in model IpsecPolicy")); + } + if (pfsGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property pfsGroup in model IpsecPolicy")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6CircuitConnectionConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6CircuitConnectionConfig.java new file mode 100644 index 0000000000000..fb38af6c7ac4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6CircuitConnectionConfig.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.network.generated.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; + +/** IPv6 Circuit Connection properties for global reach. */ +@Fluent +public final class Ipv6CircuitConnectionConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ipv6CircuitConnectionConfig.class); + + /* + * /125 IP address space to carve out customer addresses for global reach. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * Express Route Circuit connection state. + */ + @JsonProperty(value = "circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /** + * Get the addressPrefix property: /125 IP address space to carve out customer addresses for global reach. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: /125 IP address space to carve out customer addresses for global reach. + * + * @param addressPrefix the addressPrefix value to set. + * @return the Ipv6CircuitConnectionConfig object itself. + */ + public Ipv6CircuitConnectionConfig withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6ExpressRouteCircuitPeeringConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..c22a21b578fb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6ExpressRouteCircuitPeeringConfig.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains IPv6 peering config. */ +@Fluent +public final class Ipv6ExpressRouteCircuitPeeringConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ipv6ExpressRouteCircuitPeeringConfig.class); + + /* + * The primary address prefix. + */ + @JsonProperty(value = "primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + @JsonProperty(value = "secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /* + * The Microsoft peering configuration. + */ + @JsonProperty(value = "microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The reference to the RouteFilter resource. + */ + @JsonProperty(value = "routeFilter") + private SubResource routeFilter; + + /* + * The state of peering. + */ + @JsonProperty(value = "state") + private ExpressRouteCircuitPeeringState state; + + /** + * Get the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primaryPeerAddressPrefix property: The primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withMicrosoftPeeringConfig( + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get the routeFilter property: The reference to the RouteFilter resource. + * + * @return the routeFilter value. + */ + public SubResource routeFilter() { + return this.routeFilter; + } + + /** + * Set the routeFilter property: The reference to the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withRouteFilter(SubResource routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the state property: The state of peering. + * + * @return the state value. + */ + public ExpressRouteCircuitPeeringState state() { + return this.state; + } + + /** + * Set the state property: The state of peering. + * + * @param state the state value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withState(ExpressRouteCircuitPeeringState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (microsoftPeeringConfig() != null) { + microsoftPeeringConfig().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IssueType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IssueType.java new file mode 100644 index 0000000000000..6a4c745c8ab06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IssueType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IssueType. */ +public final class IssueType extends ExpandableStringEnum { + /** Static value Unknown for IssueType. */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** Static value AgentStopped for IssueType. */ + public static final IssueType AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value GuestFirewall for IssueType. */ + public static final IssueType GUEST_FIREWALL = fromString("GuestFirewall"); + + /** Static value DnsResolution for IssueType. */ + public static final IssueType DNS_RESOLUTION = fromString("DnsResolution"); + + /** Static value SocketBind for IssueType. */ + public static final IssueType SOCKET_BIND = fromString("SocketBind"); + + /** Static value NetworkSecurityRule for IssueType. */ + public static final IssueType NETWORK_SECURITY_RULE = fromString("NetworkSecurityRule"); + + /** Static value UserDefinedRoute for IssueType. */ + public static final IssueType USER_DEFINED_ROUTE = fromString("UserDefinedRoute"); + + /** Static value PortThrottled for IssueType. */ + public static final IssueType PORT_THROTTLED = fromString("PortThrottled"); + + /** Static value Platform for IssueType. */ + public static final IssueType PLATFORM = fromString("Platform"); + + /** + * Creates or finds a IssueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IssueType. + */ + @JsonCreator + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** @return known IssueType values. */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubRouteTablesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubRouteTablesResult.java new file mode 100644 index 0000000000000..e5793aae016ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubRouteTablesResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RouteTables and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListHubRouteTablesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListHubRouteTablesResult.class); + + /* + * List of RouteTables. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of RouteTables. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of RouteTables. + * + * @param value the value value to set. + * @return the ListHubRouteTablesResult object itself. + */ + public ListHubRouteTablesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListHubRouteTablesResult object itself. + */ + public ListHubRouteTablesResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubVirtualNetworkConnectionsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubVirtualNetworkConnectionsResult.java new file mode 100644 index 0000000000000..5bc246e389b30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubVirtualNetworkConnectionsResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListHubVirtualNetworkConnectionsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListHubVirtualNetworkConnectionsResult.class); + + /* + * List of HubVirtualNetworkConnections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of HubVirtualNetworkConnections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of HubVirtualNetworkConnections. + * + * @param value the value value to set. + * @return the ListHubVirtualNetworkConnectionsResult object itself. + */ + public ListHubVirtualNetworkConnectionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListHubVirtualNetworkConnectionsResult object itself. + */ + public ListHubVirtualNetworkConnectionsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListP2SVpnGatewaysResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListP2SVpnGatewaysResult.java new file mode 100644 index 0000000000000..f0c21000a9235 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListP2SVpnGatewaysResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL nextLink to get the next + * set of results. + */ +@Fluent +public final class ListP2SVpnGatewaysResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListP2SVpnGatewaysResult.class); + + /* + * List of P2SVpnGateways. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of P2SVpnGateways. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of P2SVpnGateways. + * + * @param value the value value to set. + * @return the ListP2SVpnGatewaysResult object itself. + */ + public ListP2SVpnGatewaysResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListP2SVpnGatewaysResult object itself. + */ + public ListP2SVpnGatewaysResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubBgpConnectionResults.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubBgpConnectionResults.java new file mode 100644 index 0000000000000..73349b5f1e673 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubBgpConnectionResults.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubBgpConnections list. */ +@Fluent +public final class ListVirtualHubBgpConnectionResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualHubBgpConnectionResults.class); + + /* + * The list of VirtualHubBgpConnections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of VirtualHubBgpConnections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of VirtualHubBgpConnections. + * + * @param value the value value to set. + * @return the ListVirtualHubBgpConnectionResults object itself. + */ + public ListVirtualHubBgpConnectionResults withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualHubBgpConnectionResults object itself. + */ + public ListVirtualHubBgpConnectionResults withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubIpConfigurationResults.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubIpConfigurationResults.java new file mode 100644 index 0000000000000..970b045f2b351 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubIpConfigurationResults.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubIpConfigurations list. */ +@Fluent +public final class ListVirtualHubIpConfigurationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualHubIpConfigurationResults.class); + + /* + * The list of VirtualHubIpConfigurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of VirtualHubIpConfigurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of VirtualHubIpConfigurations. + * + * @param value the value value to set. + * @return the ListVirtualHubIpConfigurationResults object itself. + */ + public ListVirtualHubIpConfigurationResults withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualHubIpConfigurationResults object itself. + */ + public ListVirtualHubIpConfigurationResults withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubRouteTableV2SResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubRouteTableV2SResult.java new file mode 100644 index 0000000000000..1d8acd3e026eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubRouteTableV2SResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListVirtualHubRouteTableV2SResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualHubRouteTableV2SResult.class); + + /* + * List of VirtualHubRouteTableV2s. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VirtualHubRouteTableV2s. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VirtualHubRouteTableV2s. + * + * @param value the value value to set. + * @return the ListVirtualHubRouteTableV2SResult object itself. + */ + public ListVirtualHubRouteTableV2SResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualHubRouteTableV2SResult object itself. + */ + public ListVirtualHubRouteTableV2SResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubsResult.java new file mode 100644 index 0000000000000..95576986059e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubsResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVirtualHubsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualHubsResult.class); + + /* + * List of VirtualHubs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VirtualHubs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VirtualHubs. + * + * @param value the value value to set. + * @return the ListVirtualHubsResult object itself. + */ + public ListVirtualHubsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualHubsResult object itself. + */ + public ListVirtualHubsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualNetworkGatewayNatRulesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualNetworkGatewayNatRulesResult.java new file mode 100644 index 0000000000000..ac3d8a934cf79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualNetworkGatewayNatRulesResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all nat rules to a virtual network gateway. It contains a list of Nat rules and a URL + * nextLink to get the next set of results. + */ +@Fluent +public final class ListVirtualNetworkGatewayNatRulesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualNetworkGatewayNatRulesResult.class); + + /* + * List of Nat Rules. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Nat Rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Nat Rules. + * + * @param value the value value to set. + * @return the ListVirtualNetworkGatewayNatRulesResult object itself. + */ + public ListVirtualNetworkGatewayNatRulesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualNetworkGatewayNatRulesResult object itself. + */ + public ListVirtualNetworkGatewayNatRulesResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualWansResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualWansResult.java new file mode 100644 index 0000000000000..d67d3b58da494 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualWansResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVirtualWansResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualWansResult.class); + + /* + * List of VirtualWANs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VirtualWANs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VirtualWANs. + * + * @param value the value value to set. + * @return the ListVirtualWansResult object itself. + */ + public ListVirtualWansResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualWansResult object itself. + */ + public ListVirtualWansResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnConnectionsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnConnectionsResult.java new file mode 100644 index 0000000000000..519630e9ccd4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnConnectionsResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections + * and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnConnectionsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnConnectionsResult.class); + + /* + * List of Vpn Connections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Vpn Connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Vpn Connections. + * + * @param value the value value to set. + * @return the ListVpnConnectionsResult object itself. + */ + public ListVpnConnectionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnConnectionsResult object itself. + */ + public ListVpnConnectionsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewayNatRulesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewayNatRulesResult.java new file mode 100644 index 0000000000000..904c00ef8727d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewayNatRulesResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all nat rules to a virtual wan vpn gateway. It contains a list of Nat rules and a URL + * nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnGatewayNatRulesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnGatewayNatRulesResult.class); + + /* + * List of Nat Rules. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Nat Rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Nat Rules. + * + * @param value the value value to set. + * @return the ListVpnGatewayNatRulesResult object itself. + */ + public ListVpnGatewayNatRulesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnGatewayNatRulesResult object itself. + */ + public ListVpnGatewayNatRulesResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewaysResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewaysResult.java new file mode 100644 index 0000000000000..0a1fa6fdef7b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewaysResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVpnGatewaysResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnGatewaysResult.class); + + /* + * List of VpnGateways. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnGateways. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnGateways. + * + * @param value the value value to set. + * @return the ListVpnGatewaysResult object itself. + */ + public ListVpnGatewaysResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnGatewaysResult object itself. + */ + public ListVpnGatewaysResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationsResult.java new file mode 100644 index 0000000000000..5eec1674c28e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationsResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all VpnServerConfigurations. It contains a list of VpnServerConfigurations and a URL + * nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnServerConfigurationsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnServerConfigurationsResult.class); + + /* + * List of VpnServerConfigurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnServerConfigurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnServerConfigurations. + * + * @param value the value value to set. + * @return the ListVpnServerConfigurationsResult object itself. + */ + public ListVpnServerConfigurationsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnServerConfigurationsResult object itself. + */ + public ListVpnServerConfigurationsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinkConnectionsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinkConnectionsResult.java new file mode 100644 index 0000000000000..b7e0dd120ae05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinkConnectionsResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections + * and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnSiteLinkConnectionsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnSiteLinkConnectionsResult.class); + + /* + * List of VpnSiteLinkConnections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnSiteLinkConnections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnSiteLinkConnections. + * + * @param value the value value to set. + * @return the ListVpnSiteLinkConnectionsResult object itself. + */ + public ListVpnSiteLinkConnectionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnSiteLinkConnectionsResult object itself. + */ + public ListVpnSiteLinkConnectionsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinksResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinksResult.java new file mode 100644 index 0000000000000..8a89c456cb834 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinksResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVpnSiteLinksResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnSiteLinksResult.class); + + /* + * List of VpnSitesLinks. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnSitesLinks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnSitesLinks. + * + * @param value the value value to set. + * @return the ListVpnSiteLinksResult object itself. + */ + public ListVpnSiteLinksResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnSiteLinksResult object itself. + */ + public ListVpnSiteLinksResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSitesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSitesResult.java new file mode 100644 index 0000000000000..e81077933eefa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSitesResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to get the next set of + * results. + */ +@Fluent +public final class ListVpnSitesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnSitesResult.class); + + /* + * List of VpnSites. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnSites. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnSites. + * + * @param value the value value to set. + * @return the ListVpnSitesResult object itself. + */ + public ListVpnSitesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnSitesResult object itself. + */ + public ListVpnSitesResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancer.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancer.java new file mode 100644 index 0000000000000..9dac9fc8ed090 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancer.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of LoadBalancer. */ +public interface LoadBalancer { + /** + * 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 extendedLocation property: The extended location of the load balancer. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the sku property: The load balancer SKU. + * + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the frontendIpConfigurations property: Object representing the frontend IPs to be used for the load + * balancer. + * + * @return the frontendIpConfigurations value. + */ + List frontendIpConfigurations(); + + /** + * Gets the backendAddressPools property: Collection of backend address pools used by a load balancer. + * + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * Gets the loadBalancingRules property: Object collection representing the load balancing rules Gets the + * provisioning. + * + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * Gets the probes property: Collection of probe objects used in the load balancer. + * + * @return the probes value. + */ + List probes(); + + /** + * Gets the inboundNatRules property: Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT + * rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are + * referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot + * reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * Gets the inboundNatPools property: Defines an external port range for inbound NAT to a single backend port on + * NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with + * the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is + * mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale + * sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have + * to reference individual inbound NAT rules. + * + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * Gets the outboundRules property: The outbound rules. + * + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * Gets the resourceGuid property: The resource GUID property of the load balancer resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the load balancer resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.LoadBalancerInner object. + * + * @return the inner object. + */ + LoadBalancerInner innerModel(); + + /** The entirety of the LoadBalancer definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The LoadBalancer definition stages. */ + interface DefinitionStages { + /** The first stage of the LoadBalancer definition. */ + interface Blank extends WithLocation { + } + /** The stage of the LoadBalancer 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 LoadBalancer definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the LoadBalancer 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.WithExtendedLocation, + DefinitionStages.WithSku, + DefinitionStages.WithFrontendIpConfigurations, + DefinitionStages.WithBackendAddressPools, + DefinitionStages.WithLoadBalancingRules, + DefinitionStages.WithProbes, + DefinitionStages.WithInboundNatRules, + DefinitionStages.WithInboundNatPools, + DefinitionStages.WithOutboundRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + LoadBalancer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LoadBalancer create(Context context); + } + /** The stage of the LoadBalancer 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 LoadBalancer definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the load balancer.. + * + * @param extendedLocation The extended location of the load balancer. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the LoadBalancer definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The load balancer SKU.. + * + * @param sku The load balancer SKU. + * @return the next definition stage. + */ + WithCreate withSku(LoadBalancerSku sku); + } + /** The stage of the LoadBalancer definition allowing to specify frontendIpConfigurations. */ + interface WithFrontendIpConfigurations { + /** + * Specifies the frontendIpConfigurations property: Object representing the frontend IPs to be used for the + * load balancer.. + * + * @param frontendIpConfigurations Object representing the frontend IPs to be used for the load balancer. + * @return the next definition stage. + */ + WithCreate withFrontendIpConfigurations(List frontendIpConfigurations); + } + /** The stage of the LoadBalancer definition allowing to specify backendAddressPools. */ + interface WithBackendAddressPools { + /** + * Specifies the backendAddressPools property: Collection of backend address pools used by a load balancer.. + * + * @param backendAddressPools Collection of backend address pools used by a load balancer. + * @return the next definition stage. + */ + WithCreate withBackendAddressPools(List backendAddressPools); + } + /** The stage of the LoadBalancer definition allowing to specify loadBalancingRules. */ + interface WithLoadBalancingRules { + /** + * Specifies the loadBalancingRules property: Object collection representing the load balancing rules Gets + * the provisioning.. + * + * @param loadBalancingRules Object collection representing the load balancing rules Gets the provisioning. + * @return the next definition stage. + */ + WithCreate withLoadBalancingRules(List loadBalancingRules); + } + /** The stage of the LoadBalancer definition allowing to specify probes. */ + interface WithProbes { + /** + * Specifies the probes property: Collection of probe objects used in the load balancer.. + * + * @param probes Collection of probe objects used in the load balancer. + * @return the next definition stage. + */ + WithCreate withProbes(List probes); + } + /** The stage of the LoadBalancer definition allowing to specify inboundNatRules. */ + interface WithInboundNatRules { + /** + * Specifies the inboundNatRules property: Collection of inbound NAT Rules used by a load balancer. Defining + * inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound + * NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual + * virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT + * rules.. + * + * @param inboundNatRules Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT + * rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT + * pools are referenced from virtual machine scale sets. NICs that are associated with individual + * virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT + * rules. + * @return the next definition stage. + */ + WithCreate withInboundNatRules(List inboundNatRules); + } + /** The stage of the LoadBalancer definition allowing to specify inboundNatPools. */ + interface WithInboundNatPools { + /** + * Specifies the inboundNatPools property: Defines an external port range for inbound NAT to a single + * backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for + * each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound + * NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools + * are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines + * cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules.. + * + * @param inboundNatPools Defines an external port range for inbound NAT to a single backend port on NICs + * associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated + * with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your + * Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced + * from virtual machine scale sets. NICs that are associated with individual virtual machines cannot + * reference an inbound NAT pool. They have to reference individual inbound NAT rules. + * @return the next definition stage. + */ + WithCreate withInboundNatPools(List inboundNatPools); + } + /** The stage of the LoadBalancer definition allowing to specify outboundRules. */ + interface WithOutboundRules { + /** + * Specifies the outboundRules property: The outbound rules.. + * + * @param outboundRules The outbound rules. + * @return the next definition stage. + */ + WithCreate withOutboundRules(List outboundRules); + } + } + /** + * Begins update for the LoadBalancer resource. + * + * @return the stage of resource update. + */ + LoadBalancer.Update update(); + + /** The template for LoadBalancer update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LoadBalancer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LoadBalancer apply(Context context); + } + /** The LoadBalancer update stages. */ + interface UpdateStages { + /** The stage of the LoadBalancer 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LoadBalancer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LoadBalancer refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddress.java new file mode 100644 index 0000000000000..88b10c6cb2408 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddress.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Load balancer backend addresses. */ +@JsonFlatten +@Fluent +public class LoadBalancerBackendAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddress.class); + + /* + * Name of the backend address. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Reference to an existing virtual network. + */ + @JsonProperty(value = "properties.virtualNetwork") + private SubResource virtualNetwork; + + /* + * Reference to an existing subnet. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /* + * IP Address belonging to the referenced virtual network. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /* + * Reference to IP address defined in network interfaces. + */ + @JsonProperty(value = "properties.networkInterfaceIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private SubResource networkInterfaceIpConfiguration; + + /* + * Reference to the frontend ip address configuration defined in regional + * loadbalancer. + */ + @JsonProperty(value = "properties.loadBalancerFrontendIPConfiguration") + private SubResource loadBalancerFrontendIpConfiguration; + + /** + * Get the name property: Name of the backend address. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the backend address. + * + * @param name the name value to set. + * @return the LoadBalancerBackendAddress object itself. + */ + public LoadBalancerBackendAddress withName(String name) { + this.name = name; + return this; + } + + /** + * Get the virtualNetwork property: Reference to an existing virtual network. + * + * @return the virtualNetwork value. + */ + public SubResource virtualNetwork() { + return this.virtualNetwork; + } + + /** + * Set the virtualNetwork property: Reference to an existing virtual network. + * + * @param virtualNetwork the virtualNetwork value to set. + * @return the LoadBalancerBackendAddress object itself. + */ + public LoadBalancerBackendAddress withVirtualNetwork(SubResource virtualNetwork) { + this.virtualNetwork = virtualNetwork; + return this; + } + + /** + * Get the subnet property: Reference to an existing subnet. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Reference to an existing subnet. + * + * @param subnet the subnet value to set. + * @return the LoadBalancerBackendAddress object itself. + */ + public LoadBalancerBackendAddress withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the ipAddress property: IP Address belonging to the referenced virtual network. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: IP Address belonging to the referenced virtual network. + * + * @param ipAddress the ipAddress value to set. + * @return the LoadBalancerBackendAddress object itself. + */ + public LoadBalancerBackendAddress withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the networkInterfaceIpConfiguration property: Reference to IP address defined in network interfaces. + * + * @return the networkInterfaceIpConfiguration value. + */ + public SubResource networkInterfaceIpConfiguration() { + return this.networkInterfaceIpConfiguration; + } + + /** + * Get the loadBalancerFrontendIpConfiguration property: Reference to the frontend ip address configuration defined + * in regional loadbalancer. + * + * @return the loadBalancerFrontendIpConfiguration value. + */ + public SubResource loadBalancerFrontendIpConfiguration() { + return this.loadBalancerFrontendIpConfiguration; + } + + /** + * Set the loadBalancerFrontendIpConfiguration property: Reference to the frontend ip address configuration defined + * in regional loadbalancer. + * + * @param loadBalancerFrontendIpConfiguration the loadBalancerFrontendIpConfiguration value to set. + * @return the LoadBalancerBackendAddress object itself. + */ + public LoadBalancerBackendAddress withLoadBalancerFrontendIpConfiguration( + SubResource loadBalancerFrontendIpConfiguration) { + this.loadBalancerFrontendIpConfiguration = loadBalancerFrontendIpConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPoolListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPoolListResult.java new file mode 100644 index 0000000000000..bb7f6e7c1082a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPoolListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListBackendAddressPool API service call. */ +@Fluent +public final class LoadBalancerBackendAddressPoolListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPoolListResult.class); + + /* + * A list of backend address pools in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of backend address pools in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of backend address pools in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerBackendAddressPoolListResult object itself. + */ + public LoadBalancerBackendAddressPoolListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPools.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPools.java new file mode 100644 index 0000000000000..0298559b8d86f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPools.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.network.generated.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 LoadBalancerBackendAddressPools. */ +public interface LoadBalancerBackendAddressPools { + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + BackendAddressPool get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context); + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, String backendAddressPoolName); + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, String backendAddressPoolName, Context context); + + /** + * Gets load balancer backend address pool. + * + * @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 load balancer backend address pool. + */ + BackendAddressPool getById(String id); + + /** + * Gets load balancer backend address pool. + * + * @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 load balancer backend address pool. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified load balancer backend address pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified load balancer backend address pool. + * + * @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 BackendAddressPool resource. + * + * @param name resource name. + * @return the first stage of the new BackendAddressPool definition. + */ + BackendAddressPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurationListResult.java new file mode 100644 index 0000000000000..8da3c5a95854d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurationListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListFrontendIPConfiguration API service call. */ +@Fluent +public final class LoadBalancerFrontendIpConfigurationListResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfigurationListResult.class); + + /* + * A list of frontend IP configurations in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of frontend IP configurations in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of frontend IP configurations in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerFrontendIpConfigurationListResult object itself. + */ + public LoadBalancerFrontendIpConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurations.java new file mode 100644 index 0000000000000..ad9c75ce2aa03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurations.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.network.generated.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 LoadBalancerFrontendIpConfigurations. */ +public interface LoadBalancerFrontendIpConfigurations { + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + FrontendIpConfiguration get(String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName); + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerListResult.java new file mode 100644 index 0000000000000..b706dd11a4ecf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListLoadBalancers API service call. */ +@Fluent +public final class LoadBalancerListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerListResult.class); + + /* + * A list of load balancers in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of load balancers in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of load balancers in a resource group. + * + * @param value the value value to set. + * @return the LoadBalancerListResult object itself. + */ + public LoadBalancerListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRuleListResult.java new file mode 100644 index 0000000000000..bc0fc2dcf1b46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListLoadBalancingRule API service call. */ +@Fluent +public final class LoadBalancerLoadBalancingRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerLoadBalancingRuleListResult.class); + + /* + * A list of load balancing rules in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of load balancing rules in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of load balancing rules in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerLoadBalancingRuleListResult object itself. + */ + public LoadBalancerLoadBalancingRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRules.java new file mode 100644 index 0000000000000..20a6da5f2f9f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRules.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.network.generated.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 LoadBalancerLoadBalancingRules. */ +public interface LoadBalancerLoadBalancingRules { + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + LoadBalancingRule get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerNetworkInterfaces.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerNetworkInterfaces.java new file mode 100644 index 0000000000000..bd94e1d9b0d2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerNetworkInterfaces.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerNetworkInterfaces. */ +public interface LoadBalancerNetworkInterfaces { + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleListResult.java new file mode 100644 index 0000000000000..2cfdf21581389 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListOutboundRule API service call. */ +@Fluent +public final class LoadBalancerOutboundRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerOutboundRuleListResult.class); + + /* + * A list of outbound rules in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of outbound rules in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of outbound rules in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerOutboundRuleListResult object itself. + */ + public LoadBalancerOutboundRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleProtocol.java new file mode 100644 index 0000000000000..caa1cc40bc5ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadBalancerOutboundRuleProtocol. */ +public final class LoadBalancerOutboundRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for LoadBalancerOutboundRuleProtocol. */ + public static final LoadBalancerOutboundRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for LoadBalancerOutboundRuleProtocol. */ + public static final LoadBalancerOutboundRuleProtocol UDP = fromString("Udp"); + + /** Static value All for LoadBalancerOutboundRuleProtocol. */ + public static final LoadBalancerOutboundRuleProtocol ALL = fromString("All"); + + /** + * Creates or finds a LoadBalancerOutboundRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerOutboundRuleProtocol. + */ + @JsonCreator + public static LoadBalancerOutboundRuleProtocol fromString(String name) { + return fromString(name, LoadBalancerOutboundRuleProtocol.class); + } + + /** @return known LoadBalancerOutboundRuleProtocol values. */ + public static Collection values() { + return values(LoadBalancerOutboundRuleProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRules.java new file mode 100644 index 0000000000000..809a34e78ad3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRules.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.network.generated.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 LoadBalancerOutboundRules. */ +public interface LoadBalancerOutboundRules { + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + OutboundRule get(String resourceGroupName, String loadBalancerName, String outboundRuleName); + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbeListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbeListResult.java new file mode 100644 index 0000000000000..cecb7ee333d4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbeListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListProbe API service call. */ +@Fluent +public final class LoadBalancerProbeListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerProbeListResult.class); + + /* + * A list of probes in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of probes in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of probes in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerProbeListResult object itself. + */ + public LoadBalancerProbeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbes.java new file mode 100644 index 0000000000000..d8c1212eb84da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbes.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.network.generated.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 LoadBalancerProbes. */ +public interface LoadBalancerProbes { + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + Probe get(String resourceGroupName, String loadBalancerName, String probeName); + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String probeName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSku.java new file mode 100644 index 0000000000000..db61acfe4509e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSku.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.network.generated.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; + +/** SKU of a load balancer. */ +@Fluent +public final class LoadBalancerSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerSku.class); + + /* + * Name of a load balancer SKU. + */ + @JsonProperty(value = "name") + private LoadBalancerSkuName name; + + /* + * Tier of a load balancer SKU. + */ + @JsonProperty(value = "tier") + private LoadBalancerSkuTier tier; + + /** + * Get the name property: Name of a load balancer SKU. + * + * @return the name value. + */ + public LoadBalancerSkuName name() { + return this.name; + } + + /** + * Set the name property: Name of a load balancer SKU. + * + * @param name the name value to set. + * @return the LoadBalancerSku object itself. + */ + public LoadBalancerSku withName(LoadBalancerSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of a load balancer SKU. + * + * @return the tier value. + */ + public LoadBalancerSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of a load balancer SKU. + * + * @param tier the tier value to set. + * @return the LoadBalancerSku object itself. + */ + public LoadBalancerSku withTier(LoadBalancerSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuName.java new file mode 100644 index 0000000000000..e1db1b1df1d14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuName.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadBalancerSkuName. */ +public final class LoadBalancerSkuName extends ExpandableStringEnum { + /** Static value Basic for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName BASIC = fromString("Basic"); + + /** Static value Standard for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName STANDARD = fromString("Standard"); + + /** Static value Gateway for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName GATEWAY = fromString("Gateway"); + + /** + * Creates or finds a LoadBalancerSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerSkuName. + */ + @JsonCreator + public static LoadBalancerSkuName fromString(String name) { + return fromString(name, LoadBalancerSkuName.class); + } + + /** @return known LoadBalancerSkuName values. */ + public static Collection values() { + return values(LoadBalancerSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuTier.java new file mode 100644 index 0000000000000..79e5638e169c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuTier.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadBalancerSkuTier. */ +public final class LoadBalancerSkuTier extends ExpandableStringEnum { + /** Static value Regional for LoadBalancerSkuTier. */ + public static final LoadBalancerSkuTier REGIONAL = fromString("Regional"); + + /** Static value Global for LoadBalancerSkuTier. */ + public static final LoadBalancerSkuTier GLOBAL = fromString("Global"); + + /** + * Creates or finds a LoadBalancerSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerSkuTier. + */ + @JsonCreator + public static LoadBalancerSkuTier fromString(String name) { + return fromString(name, LoadBalancerSkuTier.class); + } + + /** @return known LoadBalancerSkuTier values. */ + public static Collection values() { + return values(LoadBalancerSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequest.java new file mode 100644 index 0000000000000..92628e9f2342c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequest.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.network.generated.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 request for a VIP swap. */ +@Fluent +public final class LoadBalancerVipSwapRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerVipSwapRequest.class); + + /* + * A list of frontend IP configuration resources that should swap VIPs. + */ + @JsonProperty(value = "frontendIPConfigurations") + private List frontendIpConfigurations; + + /** + * Get the frontendIpConfigurations property: A list of frontend IP configuration resources that should swap VIPs. + * + * @return the frontendIpConfigurations value. + */ + public List frontendIpConfigurations() { + return this.frontendIpConfigurations; + } + + /** + * Set the frontendIpConfigurations property: A list of frontend IP configuration resources that should swap VIPs. + * + * @param frontendIpConfigurations the frontendIpConfigurations value to set. + * @return the LoadBalancerVipSwapRequest object itself. + */ + public LoadBalancerVipSwapRequest withFrontendIpConfigurations( + List frontendIpConfigurations) { + this.frontendIpConfigurations = frontendIpConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (frontendIpConfigurations() != null) { + frontendIpConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequestFrontendIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequestFrontendIpConfiguration.java new file mode 100644 index 0000000000000..2a8dd717c9ade --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequestFrontendIpConfiguration.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VIP swap request's frontend IP configuration object. */ +@JsonFlatten +@Fluent +public class LoadBalancerVipSwapRequestFrontendIpConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(LoadBalancerVipSwapRequestFrontendIpConfiguration.class); + + /* + * The ID of frontend IP configuration resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * A reference to public IP address resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIpAddress; + + /** + * Get the id property: The ID of frontend IP configuration resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of frontend IP configuration resource. + * + * @param id the id value to set. + * @return the LoadBalancerVipSwapRequestFrontendIpConfiguration object itself. + */ + public LoadBalancerVipSwapRequestFrontendIpConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the publicIpAddress property: A reference to public IP address resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: A reference to public IP address resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the LoadBalancerVipSwapRequestFrontendIpConfiguration object itself. + */ + public LoadBalancerVipSwapRequestFrontendIpConfiguration withPublicIpAddress(SubResource publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancers.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancers.java new file mode 100644 index 0000000000000..f46ca812cd7d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancers.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 LoadBalancers. */ +public interface LoadBalancers { + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName); + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadBalancerName, Context context); + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + LoadBalancer getByResourceGroup(String resourceGroupName, String loadBalancerName); + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String loadBalancerName, String expand, Context context); + + /** + * Gets all the load balancers in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the load balancers 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 all the load balancers in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the load balancers in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters); + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters, Context context); + + /** + * Gets the specified load balancer. + * + * @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 the specified load balancer. + */ + LoadBalancer getById(String id); + + /** + * Gets the specified load balancer. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified load balancer. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified load balancer. + * + * @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 LoadBalancer resource. + * + * @param name resource name. + * @return the first stage of the new LoadBalancer definition. + */ + LoadBalancer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancingRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancingRule.java new file mode 100644 index 0000000000000..b014b8042d28a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancingRule.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import java.util.List; + +/** An immutable client-side representation of LoadBalancingRule. */ +public interface LoadBalancingRule { + /** + * 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 that is unique within the set of load balancing rules used by + * the load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @return the frontendIpConfiguration value. + */ + SubResource frontendIpConfiguration(); + + /** + * Gets the backendAddressPool property: A reference to a pool of DIPs. Inbound traffic is randomly load balanced + * across IPs in the backend IPs. + * + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * Gets the backendAddressPools property: An array of references to pool of DIPs. + * + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * Gets the probe property: The reference to the load balancer probe used by the load balancing rule. + * + * @return the probe value. + */ + SubResource probe(); + + /** + * Gets the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * Gets the loadDistribution property: The load distribution policy for this rule. + * + * @return the loadDistribution value. + */ + LoadDistribution loadDistribution(); + + /** + * Gets the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @return the frontendPort value. + */ + Integer frontendPort(); + + /** + * Gets the backendPort property: The port used for internal connections on the endpoint. Acceptable values are + * between 0 and 65535. Note that value 0 enables "Any Port". + * + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * Gets the idleTimeoutInMinutes property: The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * Gets the enableFloatingIp property: Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn + * Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIp value. + */ + Boolean enableFloatingIp(); + + /** + * Gets the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * Gets the disableOutboundSnat property: Configures SNAT for the VMs in the backend pool to use the publicIP + * address specified in the frontend of the load balancing rule. + * + * @return the disableOutboundSnat value. + */ + Boolean disableOutboundSnat(); + + /** + * Gets the provisioningState property: The provisioning state of the load balancing rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner object. + * + * @return the inner object. + */ + LoadBalancingRuleInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadDistribution.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadDistribution.java new file mode 100644 index 0000000000000..aaaa6c15a2977 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadDistribution.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadDistribution. */ +public final class LoadDistribution extends ExpandableStringEnum { + /** Static value Default for LoadDistribution. */ + public static final LoadDistribution DEFAULT = fromString("Default"); + + /** Static value SourceIP for LoadDistribution. */ + public static final LoadDistribution SOURCE_IP = fromString("SourceIP"); + + /** Static value SourceIPProtocol for LoadDistribution. */ + public static final LoadDistribution SOURCE_IPPROTOCOL = fromString("SourceIPProtocol"); + + /** + * Creates or finds a LoadDistribution from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadDistribution. + */ + @JsonCreator + public static LoadDistribution fromString(String name) { + return fromString(name, LoadDistribution.class); + } + + /** @return known LoadDistribution values. */ + public static Collection values() { + return values(LoadDistribution.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateway.java new file mode 100644 index 0000000000000..4a94cbda33078 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateway.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import java.util.Map; + +/** An immutable client-side representation of LocalNetworkGateway. */ +public interface LocalNetworkGateway { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the localNetworkAddressSpace property: Local network site address space. + * + * @return the localNetworkAddressSpace value. + */ + AddressSpace localNetworkAddressSpace(); + + /** + * Gets the gatewayIpAddress property: IP address of local network gateway. + * + * @return the gatewayIpAddress value. + */ + String gatewayIpAddress(); + + /** + * Gets the fqdn property: FQDN of local network gateway. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the bgpSettings property: Local network gateway's BGP speaker settings. + * + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * Gets the resourceGuid property: The resource GUID property of the local network gateway resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the local network gateway resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.LocalNetworkGatewayInner object. + * + * @return the inner object. + */ + LocalNetworkGatewayInner innerModel(); + + /** The entirety of the LocalNetworkGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The LocalNetworkGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the LocalNetworkGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the LocalNetworkGateway 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 LocalNetworkGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the LocalNetworkGateway 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.WithLocalNetworkAddressSpace, + DefinitionStages.WithGatewayIpAddress, + DefinitionStages.WithFqdn, + DefinitionStages.WithBgpSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + LocalNetworkGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LocalNetworkGateway create(Context context); + } + /** The stage of the LocalNetworkGateway 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 LocalNetworkGateway definition allowing to specify localNetworkAddressSpace. */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies the localNetworkAddressSpace property: Local network site address space.. + * + * @param localNetworkAddressSpace Local network site address space. + * @return the next definition stage. + */ + WithCreate withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace); + } + /** The stage of the LocalNetworkGateway definition allowing to specify gatewayIpAddress. */ + interface WithGatewayIpAddress { + /** + * Specifies the gatewayIpAddress property: IP address of local network gateway.. + * + * @param gatewayIpAddress IP address of local network gateway. + * @return the next definition stage. + */ + WithCreate withGatewayIpAddress(String gatewayIpAddress); + } + /** The stage of the LocalNetworkGateway definition allowing to specify fqdn. */ + interface WithFqdn { + /** + * Specifies the fqdn property: FQDN of local network gateway.. + * + * @param fqdn FQDN of local network gateway. + * @return the next definition stage. + */ + WithCreate withFqdn(String fqdn); + } + /** The stage of the LocalNetworkGateway definition allowing to specify bgpSettings. */ + interface WithBgpSettings { + /** + * Specifies the bgpSettings property: Local network gateway's BGP speaker settings.. + * + * @param bgpSettings Local network gateway's BGP speaker settings. + * @return the next definition stage. + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + } + /** + * Begins update for the LocalNetworkGateway resource. + * + * @return the stage of resource update. + */ + LocalNetworkGateway.Update update(); + + /** The template for LocalNetworkGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LocalNetworkGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LocalNetworkGateway apply(Context context); + } + /** The LocalNetworkGateway update stages. */ + interface UpdateStages { + /** The stage of the LocalNetworkGateway 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LocalNetworkGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LocalNetworkGateway refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGatewayListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGatewayListResult.java new file mode 100644 index 0000000000000..afc598d9faf39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGatewayListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListLocalNetworkGateways API service call. */ +@Fluent +public final class LocalNetworkGatewayListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewayListResult.class); + + /* + * A list of local network gateways that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of local network gateways that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of local network gateways that exists in a resource group. + * + * @param value the value value to set. + * @return the LocalNetworkGatewayListResult object itself. + */ + public LocalNetworkGatewayListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateways.java new file mode 100644 index 0000000000000..524827f29b43c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateways.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.network.generated.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 LocalNetworkGateways. */ +public interface LocalNetworkGateways { + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + LocalNetworkGateway getByResourceGroup(String resourceGroupName, String localNetworkGatewayName); + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String localNetworkGatewayName, Context context); + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 localNetworkGatewayName); + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 localNetworkGatewayName, Context context); + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all the local network gateways in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified local network gateway in a resource group. + * + * @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 the specified local network gateway in a resource group. + */ + LocalNetworkGateway getById(String id); + + /** + * Gets the specified local network gateway in a resource group. + * + * @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 specified local network gateway in a resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified local network gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified local network gateway. + * + * @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 LocalNetworkGateway resource. + * + * @param name resource name. + * @return the first stage of the new LocalNetworkGateway definition. + */ + LocalNetworkGateway.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LogSpecification.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LogSpecification.java new file mode 100644 index 0000000000000..21d787ca0b72a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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.network.generated.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; + +/** Description of logging specification. */ +@Fluent +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * The name of the specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display name of the specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Duration of the blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: The name of the specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the specification. + * + * @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: The display name of the specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the specification. + * + * @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: Duration of the blob. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Duration of the blob. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleEnabledState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleEnabledState.java new file mode 100644 index 0000000000000..d945858cb56a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleEnabledState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedRuleEnabledState. */ +public final class ManagedRuleEnabledState extends ExpandableStringEnum { + /** Static value Disabled for ManagedRuleEnabledState. */ + public static final ManagedRuleEnabledState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ManagedRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedRuleEnabledState. + */ + @JsonCreator + public static ManagedRuleEnabledState fromString(String name) { + return fromString(name, ManagedRuleEnabledState.class); + } + + /** @return known ManagedRuleEnabledState values. */ + public static Collection values() { + return values(ManagedRuleEnabledState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleGroupOverride.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleGroupOverride.java new file mode 100644 index 0000000000000..fc3e52826a4da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleGroupOverride.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleGroupOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleGroupOverride.class); + + /* + * The managed rule group to override. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * List of rules that will be disabled. If none specified, all rules in the + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the ruleGroupName property: The managed rule group to override. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: The managed rule group to override. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the rules property: List of rules that will be disabled. If none specified, all rules in the group will be + * disabled. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules that will be disabled. If none specified, all rules in the group will be + * disabled. + * + * @param rules the rules value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroupName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model ManagedRuleGroupOverride")); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleOverride.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleOverride.java new file mode 100644 index 0000000000000..c5d2ec17dc410 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleOverride.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleOverride.class); + + /* + * Identifier for the managed rule. + */ + @JsonProperty(value = "ruleId", required = true) + private String ruleId; + + /* + * The state of the managed rule. Defaults to Disabled if not specified. + */ + @JsonProperty(value = "state") + private ManagedRuleEnabledState state; + + /** + * Get the ruleId property: Identifier for the managed rule. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: Identifier for the managed rule. + * + * @param ruleId the ruleId value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the state property: The state of the managed rule. Defaults to Disabled if not specified. + * + * @return the state value. + */ + public ManagedRuleEnabledState state() { + return this.state; + } + + /** + * Set the state property: The state of the managed rule. Defaults to Disabled if not specified. + * + * @param state the state value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withState(ManagedRuleEnabledState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleId in model ManagedRuleOverride")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleSet.java new file mode 100644 index 0000000000000..4ca997f2a29f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleSet.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.network.generated.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; + +/** Defines a managed rule set. */ +@Fluent +public final class ManagedRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSet.class); + + /* + * Defines the rule set type to use. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * Defines the rule group overrides to apply to the rule set. + */ + @JsonProperty(value = "ruleGroupOverrides") + private List ruleGroupOverrides; + + /** + * Get the ruleSetType property: Defines the rule set type to use. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the ruleSetType property: Defines the rule set type to use. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the ruleSetVersion property: Defines the version of the rule set to use. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the ruleSetVersion property: Defines the version of the rule set to use. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the ruleGroupOverrides property: Defines the rule group overrides to apply to the rule set. + * + * @return the ruleGroupOverrides value. + */ + public List ruleGroupOverrides() { + return this.ruleGroupOverrides; + } + + /** + * Set the ruleGroupOverrides property: Defines the rule group overrides to apply to the rule set. + * + * @param ruleGroupOverrides the ruleGroupOverrides value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleGroupOverrides(List ruleGroupOverrides) { + this.ruleGroupOverrides = ruleGroupOverrides; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleSetType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetType in model ManagedRuleSet")); + } + if (ruleSetVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetVersion in model ManagedRuleSet")); + } + if (ruleGroupOverrides() != null) { + ruleGroupOverrides().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRulesDefinition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRulesDefinition.java new file mode 100644 index 0000000000000..9915dc02b0c3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRulesDefinition.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Allow to exclude some variable satisfy the condition for the WAF check. */ +@Fluent +public final class ManagedRulesDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRulesDefinition.class); + + /* + * The Exclusions that are applied on the policy. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /* + * The managed rule sets that are associated with the policy. + */ + @JsonProperty(value = "managedRuleSets", required = true) + private List managedRuleSets; + + /** + * Get the exclusions property: The Exclusions that are applied on the policy. + * + * @return the exclusions value. + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set the exclusions property: The Exclusions that are applied on the policy. + * + * @param exclusions the exclusions value to set. + * @return the ManagedRulesDefinition object itself. + */ + public ManagedRulesDefinition withExclusions(List exclusions) { + this.exclusions = exclusions; + return this; + } + + /** + * Get the managedRuleSets property: The managed rule sets that are associated with the policy. + * + * @return the managedRuleSets value. + */ + public List managedRuleSets() { + return this.managedRuleSets; + } + + /** + * Set the managedRuleSets property: The managed rule sets that are associated with the policy. + * + * @param managedRuleSets the managedRuleSets value to set. + * @return the ManagedRulesDefinition object itself. + */ + public ManagedRulesDefinition withManagedRuleSets(List managedRuleSets) { + this.managedRuleSets = managedRuleSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + if (managedRuleSets() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property managedRuleSets in model ManagedRulesDefinition")); + } else { + managedRuleSets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..503ea4676acfd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentity.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.Map; + +/** Identity for the resource. */ +@Fluent +public class ManagedServiceIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedServiceIdentity.class); + + /* + * The principal id of the system assigned identity. This property will + * only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id of the system assigned identity. This property will only + * be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the resource. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user assigned identities. The type 'None' will remove any identities + * from the virtual machine. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal id of the system assigned identity. This property will only be + * provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the virtual machine. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the virtual machine. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentityUserAssignedIdentities.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentityUserAssignedIdentities.java new file mode 100644 index 0000000000000..a5e37259a34c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentityUserAssignedIdentities.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.network.generated.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; + +/** The ManagedServiceIdentityUserAssignedIdentities model. */ +@Immutable +public final class ManagedServiceIdentityUserAssignedIdentities { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ManagedServiceIdentityUserAssignedIdentities.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchCondition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchCondition.java new file mode 100644 index 0000000000000..2f9e9709e0611 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchCondition.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Define match conditions. */ +@Fluent +public final class MatchCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MatchCondition.class); + + /* + * List of match variables. + */ + @JsonProperty(value = "matchVariables", required = true) + private List matchVariables; + + /* + * The operator to be matched. + */ + @JsonProperty(value = "operator", required = true) + private WebApplicationFirewallOperator operator; + + /* + * Whether this is negate condition or not. + */ + @JsonProperty(value = "negationConditon") + private Boolean negationConditon; + + /* + * Match value. + */ + @JsonProperty(value = "matchValues", required = true) + private List matchValues; + + /* + * List of transforms. + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** + * Get the matchVariables property: List of match variables. + * + * @return the matchVariables value. + */ + public List matchVariables() { + return this.matchVariables; + } + + /** + * Set the matchVariables property: List of match variables. + * + * @param matchVariables the matchVariables value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchVariables(List matchVariables) { + this.matchVariables = matchVariables; + return this; + } + + /** + * Get the operator property: The operator to be matched. + * + * @return the operator value. + */ + public WebApplicationFirewallOperator operator() { + return this.operator; + } + + /** + * Set the operator property: The operator to be matched. + * + * @param operator the operator value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withOperator(WebApplicationFirewallOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negationConditon property: Whether this is negate condition or not. + * + * @return the negationConditon value. + */ + public Boolean negationConditon() { + return this.negationConditon; + } + + /** + * Set the negationConditon property: Whether this is negate condition or not. + * + * @param negationConditon the negationConditon value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withNegationConditon(Boolean negationConditon) { + this.negationConditon = negationConditon; + return this; + } + + /** + * Get the matchValues property: Match value. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: Match value. + * + * @param matchValues the matchValues value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariables() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchVariables in model MatchCondition")); + } else { + matchVariables().forEach(e -> e.validate()); + } + if (operator() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property operator in model MatchCondition")); + } + if (matchValues() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchValues in model MatchCondition")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchVariable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchVariable.java new file mode 100644 index 0000000000000..730db42f6bdf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchVariable.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Define match variables. */ +@Fluent +public final class MatchVariable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MatchVariable.class); + + /* + * Match Variable. + */ + @JsonProperty(value = "variableName", required = true) + private WebApplicationFirewallMatchVariable variableName; + + /* + * The selector of match variable. + */ + @JsonProperty(value = "selector") + private String selector; + + /** + * Get the variableName property: Match Variable. + * + * @return the variableName value. + */ + public WebApplicationFirewallMatchVariable variableName() { + return this.variableName; + } + + /** + * Set the variableName property: Match Variable. + * + * @param variableName the variableName value to set. + * @return the MatchVariable object itself. + */ + public MatchVariable withVariableName(WebApplicationFirewallMatchVariable variableName) { + this.variableName = variableName; + return this; + } + + /** + * Get the selector property: The selector of match variable. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: The selector of match variable. + * + * @param selector the selector value to set. + * @return the MatchVariable object itself. + */ + public MatchVariable withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (variableName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property variableName in model MatchVariable")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchedRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchedRule.java new file mode 100644 index 0000000000000..084f69cc4474e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchedRule.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.network.generated.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; + +/** Matched rule. */ +@Fluent +public final class MatchedRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MatchedRule.class); + + /* + * Name of the matched network security rule. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /* + * The network traffic is allowed or denied. Possible values are 'Allow' + * and 'Deny'. + */ + @JsonProperty(value = "action") + private String action; + + /** + * Get the ruleName property: Name of the matched network security rule. + * + * @return the ruleName value. + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set the ruleName property: Name of the matched network security rule. + * + * @param ruleName the ruleName value to set. + * @return the MatchedRule object itself. + */ + public MatchedRule withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Get the action property: The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @param action the action value to set. + * @return the MatchedRule object itself. + */ + public MatchedRule withAction(String action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MetricSpecification.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MetricSpecification.java new file mode 100644 index 0000000000000..3cae35fb447de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MetricSpecification.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Description of metrics specification. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * The name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Units the metric to be displayed in. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * List of availability. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /* + * Whether regional MDM account enabled. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private Boolean enableRegionalMdmAccount; + + /* + * Whether gaps would be filled with zeros. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Pattern for the filter of the metric. + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /* + * List of dimensions. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Whether the metric is internal. + */ + @JsonProperty(value = "isInternal") + private Boolean isInternal; + + /* + * The source MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /* + * The source MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /* + * The resource Id dimension name override. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get the name property: The name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The 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: The display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The 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: The description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: The 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: Units the metric to be displayed in. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Units the metric to be displayed in. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: The aggregation type. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: The aggregation type. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the availabilities property: List of availability. + * + * @return the availabilities value. + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set the availabilities property: List of availability. + * + * @param availabilities the availabilities value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAvailabilities(List availabilities) { + this.availabilities = availabilities; + return this; + } + + /** + * Get the enableRegionalMdmAccount property: Whether regional MDM account enabled. + * + * @return the enableRegionalMdmAccount value. + */ + public Boolean enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set the enableRegionalMdmAccount property: Whether regional MDM account enabled. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get the fillGapWithZero property: Whether gaps would be filled with zeros. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Whether gaps would be filled with zeros. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the metricFilterPattern property: Pattern for the filter of the metric. + * + * @return the metricFilterPattern value. + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set the metricFilterPattern property: Pattern for the filter of the metric. + * + * @param metricFilterPattern the metricFilterPattern value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { + this.metricFilterPattern = metricFilterPattern; + return this; + } + + /** + * Get the dimensions property: List of dimensions. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: List of dimensions. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the isInternal property: Whether the metric is internal. + * + * @return the isInternal value. + */ + public Boolean isInternal() { + return this.isInternal; + } + + /** + * Set the isInternal property: Whether the metric is internal. + * + * @param isInternal the isInternal value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withIsInternal(Boolean isInternal) { + this.isInternal = isInternal; + return this; + } + + /** + * Get the sourceMdmAccount property: The source MDM account. + * + * @return the sourceMdmAccount value. + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the sourceMdmAccount property: The source 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 source MDM namespace. + * + * @return the sourceMdmNamespace value. + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the sourceMdmNamespace property: The source MDM namespace. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Get the resourceIdDimensionNameOverride property: The resource Id dimension name override. + * + * @return the resourceIdDimensionNameOverride value. + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set the resourceIdDimensionNameOverride property: The resource Id dimension name override. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilities() != null) { + availabilities().forEach(e -> e.validate()); + } + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateway.java new file mode 100644 index 0000000000000..3f9124e4bf663 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateway.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NatGateway. */ +public interface NatGateway { + /** + * 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 nat gateway SKU. + * + * @return the sku value. + */ + NatGatewaySku sku(); + + /** + * Gets the zones property: A list of availability zones denoting the zone in which Nat Gateway should be deployed. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the idleTimeoutInMinutes property: The idle timeout of the nat gateway. + * + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * Gets the publicIpAddresses property: An array of public ip addresses associated with the nat gateway resource. + * + * @return the publicIpAddresses value. + */ + List publicIpAddresses(); + + /** + * Gets the publicIpPrefixes property: An array of public ip prefixes associated with the nat gateway resource. + * + * @return the publicIpPrefixes value. + */ + List publicIpPrefixes(); + + /** + * Gets the subnets property: An array of references to the subnets using this nat gateway resource. + * + * @return the subnets value. + */ + List subnets(); + + /** + * Gets the resourceGuid property: The resource GUID property of the NAT gateway resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the NAT gateway resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.NatGatewayInner object. + * + * @return the inner object. + */ + NatGatewayInner innerModel(); + + /** The entirety of the NatGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NatGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the NatGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NatGateway 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 NatGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NatGateway 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.WithSku, + DefinitionStages.WithZones, + DefinitionStages.WithIdleTimeoutInMinutes, + DefinitionStages.WithPublicIpAddresses, + DefinitionStages.WithPublicIpPrefixes { + /** + * Executes the create request. + * + * @return the created resource. + */ + NatGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NatGateway create(Context context); + } + /** The stage of the NatGateway 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 NatGateway definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The nat gateway SKU.. + * + * @param sku The nat gateway SKU. + * @return the next definition stage. + */ + WithCreate withSku(NatGatewaySku sku); + } + /** The stage of the NatGateway definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting the zone in which Nat Gateway should + * be deployed.. + * + * @param zones A list of availability zones denoting the zone in which Nat Gateway should be deployed. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the NatGateway definition allowing to specify idleTimeoutInMinutes. */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies the idleTimeoutInMinutes property: The idle timeout of the nat gateway.. + * + * @param idleTimeoutInMinutes The idle timeout of the nat gateway. + * @return the next definition stage. + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + /** The stage of the NatGateway definition allowing to specify publicIpAddresses. */ + interface WithPublicIpAddresses { + /** + * Specifies the publicIpAddresses property: An array of public ip addresses associated with the nat gateway + * resource.. + * + * @param publicIpAddresses An array of public ip addresses associated with the nat gateway resource. + * @return the next definition stage. + */ + WithCreate withPublicIpAddresses(List publicIpAddresses); + } + /** The stage of the NatGateway definition allowing to specify publicIpPrefixes. */ + interface WithPublicIpPrefixes { + /** + * Specifies the publicIpPrefixes property: An array of public ip prefixes associated with the nat gateway + * resource.. + * + * @param publicIpPrefixes An array of public ip prefixes associated with the nat gateway resource. + * @return the next definition stage. + */ + WithCreate withPublicIpPrefixes(List publicIpPrefixes); + } + } + /** + * Begins update for the NatGateway resource. + * + * @return the stage of resource update. + */ + NatGateway.Update update(); + + /** The template for NatGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NatGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NatGateway apply(Context context); + } + /** The NatGateway update stages. */ + interface UpdateStages { + /** The stage of the NatGateway 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NatGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NatGateway refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewayListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewayListResult.java new file mode 100644 index 0000000000000..c74117cb08403 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewayListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNatGateways API service call. */ +@Fluent +public final class NatGatewayListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatGatewayListResult.class); + + /* + * A list of Nat Gateways that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of Nat Gateways that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Nat Gateways that exists in a resource group. + * + * @param value the value value to set. + * @return the NatGatewayListResult object itself. + */ + public NatGatewayListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NatGatewayListResult object itself. + */ + public NatGatewayListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySku.java new file mode 100644 index 0000000000000..1943660723ae0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySku.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.network.generated.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; + +/** SKU of nat gateway. */ +@Fluent +public final class NatGatewaySku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatGatewaySku.class); + + /* + * Name of Nat Gateway SKU. + */ + @JsonProperty(value = "name") + private NatGatewaySkuName name; + + /** + * Get the name property: Name of Nat Gateway SKU. + * + * @return the name value. + */ + public NatGatewaySkuName name() { + return this.name; + } + + /** + * Set the name property: Name of Nat Gateway SKU. + * + * @param name the name value to set. + * @return the NatGatewaySku object itself. + */ + public NatGatewaySku withName(NatGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySkuName.java new file mode 100644 index 0000000000000..bc30b0f2f1bcc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySkuName.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NatGatewaySkuName. */ +public final class NatGatewaySkuName extends ExpandableStringEnum { + /** Static value Standard for NatGatewaySkuName. */ + public static final NatGatewaySkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a NatGatewaySkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding NatGatewaySkuName. + */ + @JsonCreator + public static NatGatewaySkuName fromString(String name) { + return fromString(name, NatGatewaySkuName.class); + } + + /** @return known NatGatewaySkuName values. */ + public static Collection values() { + return values(NatGatewaySkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateways.java new file mode 100644 index 0000000000000..b3bb00cd066c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateways.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 NatGateways. */ +public interface NatGateways { + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 natGatewayName); + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 natGatewayName, Context context); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + NatGateway getByResourceGroup(String resourceGroupName, String natGatewayName); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String natGatewayName, String expand, Context context); + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Nat Gateways 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 all the Nat Gateways in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource 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 all nat gateways in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @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 the specified nat gateway in a specified resource group. + */ + NatGateway getById(String id); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified nat gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified nat gateway. + * + * @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 NatGateway resource. + * + * @param name resource name. + * @return the first stage of the new NatGateway definition. + */ + NatGateway.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRule.java new file mode 100644 index 0000000000000..4e1c0816b302b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRule.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Rule of type nat. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("NatRule") +@Fluent +public final class NatRule extends FirewallPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatRule.class); + + /* + * Array of FirewallPolicyRuleNetworkProtocols. + */ + @JsonProperty(value = "ipProtocols") + private List ipProtocols; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * The translated address for this NAT rule. + */ + @JsonProperty(value = "translatedAddress") + private String translatedAddress; + + /* + * The translated port for this NAT rule. + */ + @JsonProperty(value = "translatedPort") + private String translatedPort; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * The translated FQDN for this NAT rule. + */ + @JsonProperty(value = "translatedFqdn") + private String translatedFqdn; + + /** + * Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @return the ipProtocols value. + */ + public List ipProtocols() { + return this.ipProtocols; + } + + /** + * Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @param ipProtocols the ipProtocols value to set. + * @return the NatRule object itself. + */ + public NatRule withIpProtocols(List ipProtocols) { + this.ipProtocols = ipProtocols; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the NatRule object itself. + */ + public NatRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the NatRule object itself. + */ + public NatRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the NatRule object itself. + */ + public NatRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the translatedAddress property: The translated address for this NAT rule. + * + * @return the translatedAddress value. + */ + public String translatedAddress() { + return this.translatedAddress; + } + + /** + * Set the translatedAddress property: The translated address for this NAT rule. + * + * @param translatedAddress the translatedAddress value to set. + * @return the NatRule object itself. + */ + public NatRule withTranslatedAddress(String translatedAddress) { + this.translatedAddress = translatedAddress; + return this; + } + + /** + * Get the translatedPort property: The translated port for this NAT rule. + * + * @return the translatedPort value. + */ + public String translatedPort() { + return this.translatedPort; + } + + /** + * Set the translatedPort property: The translated port for this NAT rule. + * + * @param translatedPort the translatedPort value to set. + * @return the NatRule object itself. + */ + public NatRule withTranslatedPort(String translatedPort) { + this.translatedPort = translatedPort; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the NatRule object itself. + */ + public NatRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @return the translatedFqdn value. + */ + public String translatedFqdn() { + return this.translatedFqdn; + } + + /** + * Set the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @param translatedFqdn the translatedFqdn value to set. + * @return the NatRule object itself. + */ + public NatRule withTranslatedFqdn(String translatedFqdn) { + this.translatedFqdn = translatedFqdn; + return this; + } + + /** {@inheritDoc} */ + @Override + public NatRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public NatRule withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRules.java new file mode 100644 index 0000000000000..83d1ba4055938 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRules.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.network.generated.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 NatRules. */ +public interface NatRules { + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + VpnGatewayNatRule get(String resourceGroupName, String gatewayName, String natRuleName); + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + Response getWithResponse( + String resourceGroupName, String gatewayName, String natRuleName, Context context); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, String natRuleName); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, String natRuleName, Context context); + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName); + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName, Context context); + + /** + * Retrieves the details of a nat ruleGet. + * + * @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 vpnGatewayNatRule Resource. + */ + VpnGatewayNatRule getById(String id); + + /** + * Retrieves the details of a nat ruleGet. + * + * @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 vpnGatewayNatRule Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a nat rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a nat rule. + * + * @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 VpnGatewayNatRule resource. + * + * @param name resource name. + * @return the first stage of the new VpnGatewayNatRule definition. + */ + VpnGatewayNatRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticParameters.java new file mode 100644 index 0000000000000..4fc8bf89de0a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticParameters.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters to get network configuration diagnostic. */ +@Fluent +public final class NetworkConfigurationDiagnosticParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticParameters.class); + + /* + * The ID of the target resource to perform network configuration + * diagnostic. Valid options are VM, NetworkInterface, + * VMSS/NetworkInterface and Application Gateway. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * Verbosity level. + */ + @JsonProperty(value = "verbosityLevel") + private VerbosityLevel verbosityLevel; + + /* + * List of network configuration diagnostic profiles. + */ + @JsonProperty(value = "profiles", required = true) + private List profiles; + + /** + * Get the targetResourceId property: The ID of the target resource to perform network configuration diagnostic. + * Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The ID of the target resource to perform network configuration diagnostic. + * Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param targetResourceId the targetResourceId value to set. + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the verbosityLevel property: Verbosity level. + * + * @return the verbosityLevel value. + */ + public VerbosityLevel verbosityLevel() { + return this.verbosityLevel; + } + + /** + * Set the verbosityLevel property: Verbosity level. + * + * @param verbosityLevel the verbosityLevel value to set. + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withVerbosityLevel(VerbosityLevel verbosityLevel) { + this.verbosityLevel = verbosityLevel; + return this; + } + + /** + * Get the profiles property: List of network configuration diagnostic profiles. + * + * @return the profiles value. + */ + public List profiles() { + return this.profiles; + } + + /** + * Set the profiles property: List of network configuration diagnostic profiles. + * + * @param profiles the profiles value to set. + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withProfiles(List profiles) { + this.profiles = profiles; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model" + + " NetworkConfigurationDiagnosticParameters")); + } + if (profiles() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property profiles in model NetworkConfigurationDiagnosticParameters")); + } else { + profiles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticProfile.java new file mode 100644 index 0000000000000..f60c37c521fb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticProfile.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters to compare with network configuration. */ +@Fluent +public final class NetworkConfigurationDiagnosticProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticProfile.class); + + /* + * The direction of the traffic. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /* + * Protocol to be verified on. Accepted values are '*', TCP, UDP. + */ + @JsonProperty(value = "protocol", required = true) + private String protocol; + + /* + * Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + */ + @JsonProperty(value = "source", required = true) + private String source; + + /* + * Traffic destination. Accepted values are: '*', IP Address/CIDR, Service + * Tag. + */ + @JsonProperty(value = "destination", required = true) + private String destination; + + /* + * Traffic destination port. Accepted values are '*' and a single port in + * the range (0 - 65535). + */ + @JsonProperty(value = "destinationPort", required = true) + private String destinationPort; + + /** + * Get the direction property: The direction of the traffic. + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of the traffic. + * + * @param direction the direction value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get the protocol property: Protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @param protocol the protocol value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source property: Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @param source the source value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @param destination the destination value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the destinationPort property: Traffic destination port. Accepted values are '*' and a single port in the + * range (0 - 65535). + * + * @return the destinationPort value. + */ + public String destinationPort() { + return this.destinationPort; + } + + /** + * Set the destinationPort property: Traffic destination port. Accepted values are '*' and a single port in the + * range (0 - 65535). + * + * @param destinationPort the destinationPort value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (direction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property direction in model NetworkConfigurationDiagnosticProfile")); + } + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model NetworkConfigurationDiagnosticProfile")); + } + if (source() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property source in model NetworkConfigurationDiagnosticProfile")); + } + if (destination() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destination in model NetworkConfigurationDiagnosticProfile")); + } + if (destinationPort() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationPort in model NetworkConfigurationDiagnosticProfile")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java new file mode 100644 index 0000000000000..1799950d60ef4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import java.util.List; + +/** An immutable client-side representation of NetworkConfigurationDiagnosticResponse. */ +public interface NetworkConfigurationDiagnosticResponse { + /** + * Gets the results property: List of network configuration diagnostic results. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner object. + * + * @return the inner object. + */ + NetworkConfigurationDiagnosticResponseInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.java new file mode 100644 index 0000000000000..fbdc22bb9a196 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.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.network.generated.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; + +/** Network configuration diagnostic result corresponded to provided traffic query. */ +@Fluent +public final class NetworkConfigurationDiagnosticResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticResult.class); + + /* + * Network configuration diagnostic profile. + */ + @JsonProperty(value = "profile") + private NetworkConfigurationDiagnosticProfile profile; + + /* + * Network security group result. + */ + @JsonProperty(value = "networkSecurityGroupResult") + private NetworkSecurityGroupResult networkSecurityGroupResult; + + /** + * Get the profile property: Network configuration diagnostic profile. + * + * @return the profile value. + */ + public NetworkConfigurationDiagnosticProfile profile() { + return this.profile; + } + + /** + * Set the profile property: Network configuration diagnostic profile. + * + * @param profile the profile value to set. + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withProfile(NetworkConfigurationDiagnosticProfile profile) { + this.profile = profile; + return this; + } + + /** + * Get the networkSecurityGroupResult property: Network security group result. + * + * @return the networkSecurityGroupResult value. + */ + public NetworkSecurityGroupResult networkSecurityGroupResult() { + return this.networkSecurityGroupResult; + } + + /** + * Set the networkSecurityGroupResult property: Network security group result. + * + * @param networkSecurityGroupResult the networkSecurityGroupResult value to set. + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withNetworkSecurityGroupResult( + NetworkSecurityGroupResult networkSecurityGroupResult) { + this.networkSecurityGroupResult = networkSecurityGroupResult; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (profile() != null) { + profile().validate(); + } + if (networkSecurityGroupResult() != null) { + networkSecurityGroupResult().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicy.java new file mode 100644 index 0000000000000..b918645b602fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicy.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Network Intent Policy resource. */ +@Fluent +public final class NetworkIntentPolicy extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkIntentPolicy.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the NetworkIntentPolicy object itself. + */ + public NetworkIntentPolicy withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkIntentPolicy withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkIntentPolicy withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyConfiguration.java new file mode 100644 index 0000000000000..187b256d687ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyConfiguration.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.network.generated.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; + +/** Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. */ +@Fluent +public final class NetworkIntentPolicyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkIntentPolicyConfiguration.class); + + /* + * The name of the Network Intent Policy for storing in target + * subscription. + */ + @JsonProperty(value = "networkIntentPolicyName") + private String networkIntentPolicyName; + + /* + * Source network intent policy. + */ + @JsonProperty(value = "sourceNetworkIntentPolicy") + private NetworkIntentPolicy sourceNetworkIntentPolicy; + + /** + * Get the networkIntentPolicyName property: The name of the Network Intent Policy for storing in target + * subscription. + * + * @return the networkIntentPolicyName value. + */ + public String networkIntentPolicyName() { + return this.networkIntentPolicyName; + } + + /** + * Set the networkIntentPolicyName property: The name of the Network Intent Policy for storing in target + * subscription. + * + * @param networkIntentPolicyName the networkIntentPolicyName value to set. + * @return the NetworkIntentPolicyConfiguration object itself. + */ + public NetworkIntentPolicyConfiguration withNetworkIntentPolicyName(String networkIntentPolicyName) { + this.networkIntentPolicyName = networkIntentPolicyName; + return this; + } + + /** + * Get the sourceNetworkIntentPolicy property: Source network intent policy. + * + * @return the sourceNetworkIntentPolicy value. + */ + public NetworkIntentPolicy sourceNetworkIntentPolicy() { + return this.sourceNetworkIntentPolicy; + } + + /** + * Set the sourceNetworkIntentPolicy property: Source network intent policy. + * + * @param sourceNetworkIntentPolicy the sourceNetworkIntentPolicy value to set. + * @return the NetworkIntentPolicyConfiguration object itself. + */ + public NetworkIntentPolicyConfiguration withSourceNetworkIntentPolicy( + NetworkIntentPolicy sourceNetworkIntentPolicy) { + this.sourceNetworkIntentPolicy = sourceNetworkIntentPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceNetworkIntentPolicy() != null) { + sourceNetworkIntentPolicy().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterface.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterface.java new file mode 100644 index 0000000000000..5b3cdbe6d4b11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterface.java @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkInterface. */ +public interface NetworkInterface { + /** + * 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 extendedLocation property: The extended location of the network interface. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the virtualMachine property: The reference to a virtual machine. + * + * @return the virtualMachine value. + */ + SubResource virtualMachine(); + + /** + * Gets the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * Gets the privateEndpoint property: A reference to the private endpoint to which the network interface is linked. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the ipConfigurations property: A list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the tapConfigurations property: A list of TapConfigurations of the network interface. + * + * @return the tapConfigurations value. + */ + List tapConfigurations(); + + /** + * Gets the dnsSettings property: The DNS settings in network interface. + * + * @return the dnsSettings value. + */ + NetworkInterfaceDnsSettings dnsSettings(); + + /** + * Gets the macAddress property: The MAC address of the network interface. + * + * @return the macAddress value. + */ + String macAddress(); + + /** + * Gets the primary property: Whether this is a primary network interface on a virtual machine. + * + * @return the primary value. + */ + Boolean primary(); + + /** + * Gets the enableAcceleratedNetworking property: If the network interface is accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * Gets the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIpForwarding value. + */ + Boolean enableIpForwarding(); + + /** + * Gets the hostedWorkloads property: A list of references to linked BareMetal resources. + * + * @return the hostedWorkloads value. + */ + List hostedWorkloads(); + + /** + * Gets the dscpConfiguration property: A reference to the dscp configuration to which the network interface is + * linked. + * + * @return the dscpConfiguration value. + */ + SubResource dscpConfiguration(); + + /** + * Gets the resourceGuid property: The resource GUID property of the network interface resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the network interface resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the workloadType property: WorkloadType of the NetworkInterface for BareMetal resources. + * + * @return the workloadType value. + */ + String workloadType(); + + /** + * Gets the nicType property: Type of Network Interface resource. + * + * @return the nicType value. + */ + NetworkInterfaceNicType nicType(); + + /** + * Gets the privateLinkService property: Privatelinkservice of the network interface resource. + * + * @return the privateLinkService value. + */ + PrivateLinkService privateLinkService(); + + /** + * Gets the migrationPhase property: Migration phase of Network Interface resource. + * + * @return the migrationPhase value. + */ + NetworkInterfaceMigrationPhase migrationPhase(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.NetworkInterfaceInner object. + * + * @return the inner object. + */ + NetworkInterfaceInner innerModel(); + + /** The entirety of the NetworkInterface definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkInterface definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkInterface definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkInterface 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 NetworkInterface definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkInterface 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.WithExtendedLocation, + DefinitionStages.WithNetworkSecurityGroup, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithDnsSettings, + DefinitionStages.WithEnableAcceleratedNetworking, + DefinitionStages.WithEnableIpForwarding, + DefinitionStages.WithWorkloadType, + DefinitionStages.WithNicType, + DefinitionStages.WithPrivateLinkService, + DefinitionStages.WithMigrationPhase { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkInterface create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkInterface create(Context context); + } + /** The stage of the NetworkInterface 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 NetworkInterface definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the network interface.. + * + * @param extendedLocation The extended location of the network interface. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the NetworkInterface definition allowing to specify networkSecurityGroup. */ + interface WithNetworkSecurityGroup { + /** + * Specifies the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource.. + * + * @param networkSecurityGroup The reference to the NetworkSecurityGroup resource. + * @return the next definition stage. + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + /** The stage of the NetworkInterface definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: A list of IPConfigurations of the network interface.. + * + * @param ipConfigurations A list of IPConfigurations of the network interface. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the NetworkInterface definition allowing to specify dnsSettings. */ + interface WithDnsSettings { + /** + * Specifies the dnsSettings property: The DNS settings in network interface.. + * + * @param dnsSettings The DNS settings in network interface. + * @return the next definition stage. + */ + WithCreate withDnsSettings(NetworkInterfaceDnsSettings dnsSettings); + } + /** The stage of the NetworkInterface definition allowing to specify enableAcceleratedNetworking. */ + interface WithEnableAcceleratedNetworking { + /** + * Specifies the enableAcceleratedNetworking property: If the network interface is accelerated networking + * enabled.. + * + * @param enableAcceleratedNetworking If the network interface is accelerated networking enabled. + * @return the next definition stage. + */ + WithCreate withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + /** The stage of the NetworkInterface definition allowing to specify enableIpForwarding. */ + interface WithEnableIpForwarding { + /** + * Specifies the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network + * interface.. + * + * @param enableIpForwarding Indicates whether IP forwarding is enabled on this network interface. + * @return the next definition stage. + */ + WithCreate withEnableIpForwarding(Boolean enableIpForwarding); + } + /** The stage of the NetworkInterface definition allowing to specify workloadType. */ + interface WithWorkloadType { + /** + * Specifies the workloadType property: WorkloadType of the NetworkInterface for BareMetal resources. + * + * @param workloadType WorkloadType of the NetworkInterface for BareMetal resources. + * @return the next definition stage. + */ + WithCreate withWorkloadType(String workloadType); + } + /** The stage of the NetworkInterface definition allowing to specify nicType. */ + interface WithNicType { + /** + * Specifies the nicType property: Type of Network Interface resource.. + * + * @param nicType Type of Network Interface resource. + * @return the next definition stage. + */ + WithCreate withNicType(NetworkInterfaceNicType nicType); + } + /** The stage of the NetworkInterface definition allowing to specify privateLinkService. */ + interface WithPrivateLinkService { + /** + * Specifies the privateLinkService property: Privatelinkservice of the network interface resource.. + * + * @param privateLinkService Privatelinkservice of the network interface resource. + * @return the next definition stage. + */ + WithCreate withPrivateLinkService(PrivateLinkServiceInner privateLinkService); + } + /** The stage of the NetworkInterface definition allowing to specify migrationPhase. */ + interface WithMigrationPhase { + /** + * Specifies the migrationPhase property: Migration phase of Network Interface resource.. + * + * @param migrationPhase Migration phase of Network Interface resource. + * @return the next definition stage. + */ + WithCreate withMigrationPhase(NetworkInterfaceMigrationPhase migrationPhase); + } + } + /** + * Begins update for the NetworkInterface resource. + * + * @return the stage of resource update. + */ + NetworkInterface.Update update(); + + /** The template for NetworkInterface update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkInterface apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkInterface apply(Context context); + } + /** The NetworkInterface update stages. */ + interface UpdateStages { + /** The stage of the NetworkInterface 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkInterface refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkInterface refresh(Context context); + + /** + * Gets all route tables applied to a network interface. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + EffectiveRouteListResult getEffectiveRouteTable(); + + /** + * Gets all route tables applied to a network interface. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + EffectiveRouteListResult getEffectiveRouteTable(Context context); + + /** + * Gets all network security groups applied to a network interface. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups(); + + /** + * Gets all network security groups applied to a network interface. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAssociation.java new file mode 100644 index 0000000000000..3370ab355e08a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAssociation.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network interface and its custom security rules. */ +@Fluent +public final class NetworkInterfaceAssociation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceAssociation.class); + + /* + * Network interface ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get the id property: Network interface ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the securityRules property: Collection of custom security rules. + * + * @return the securityRules value. + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set the securityRules property: Collection of custom security rules. + * + * @param securityRules the securityRules value to set. + * @return the NetworkInterfaceAssociation object itself. + */ + public NetworkInterfaceAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityRules() != null) { + securityRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceDnsSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceDnsSettings.java new file mode 100644 index 0000000000000..c4dd58421ac40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceDnsSettings.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.network.generated.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; + +/** DNS settings of a network interface. */ +@Fluent +public final class NetworkInterfaceDnsSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceDnsSettings.class); + + /* + * List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to + * azure provided DNS resolution. 'AzureProvidedDNS' value cannot be + * combined with other IPs, it must be the only value in dnsServers + * collection. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /* + * If the VM that uses this NIC is part of an Availability Set, then this + * list will have the union of all DNS servers from all NICs that are part + * of the Availability Set. This property is what is configured on each of + * those VMs. + */ + @JsonProperty(value = "appliedDnsServers", access = JsonProperty.Access.WRITE_ONLY) + private List appliedDnsServers; + + /* + * Relative DNS name for this NIC used for internal communications between + * VMs in the same virtual network. + */ + @JsonProperty(value = "internalDnsNameLabel") + private String internalDnsNameLabel; + + /* + * Fully qualified DNS name supporting internal communications between VMs + * in the same virtual network. + */ + @JsonProperty(value = "internalFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String internalFqdn; + + /* + * Even if internalDnsNameLabel is not specified, a DNS entry is created + * for the primary NIC of the VM. This DNS name can be constructed by + * concatenating the VM name with the value of internalDomainNameSuffix. + */ + @JsonProperty(value = "internalDomainNameSuffix", access = JsonProperty.Access.WRITE_ONLY) + private String internalDomainNameSuffix; + + /** + * Get the dnsServers property: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided + * DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in + * dnsServers collection. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided + * DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in + * dnsServers collection. + * + * @param dnsServers the dnsServers value to set. + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get the appliedDnsServers property: If the VM that uses this NIC is part of an Availability Set, then this list + * will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what + * is configured on each of those VMs. + * + * @return the appliedDnsServers value. + */ + public List appliedDnsServers() { + return this.appliedDnsServers; + } + + /** + * Get the internalDnsNameLabel property: Relative DNS name for this NIC used for internal communications between + * VMs in the same virtual network. + * + * @return the internalDnsNameLabel value. + */ + public String internalDnsNameLabel() { + return this.internalDnsNameLabel; + } + + /** + * Set the internalDnsNameLabel property: Relative DNS name for this NIC used for internal communications between + * VMs in the same virtual network. + * + * @param internalDnsNameLabel the internalDnsNameLabel value to set. + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalDnsNameLabel(String internalDnsNameLabel) { + this.internalDnsNameLabel = internalDnsNameLabel; + return this; + } + + /** + * Get the internalFqdn property: Fully qualified DNS name supporting internal communications between VMs in the + * same virtual network. + * + * @return the internalFqdn value. + */ + public String internalFqdn() { + return this.internalFqdn; + } + + /** + * Get the internalDomainNameSuffix property: Even if internalDnsNameLabel is not specified, a DNS entry is created + * for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of + * internalDomainNameSuffix. + * + * @return the internalDomainNameSuffix value. + */ + public String internalDomainNameSuffix() { + return this.internalDomainNameSuffix; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.java new file mode 100644 index 0000000000000..1e78c234dfa18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.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.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import java.util.List; + +/** An immutable client-side representation of NetworkInterfaceIpConfiguration. */ +public interface NetworkInterfaceIpConfiguration { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @return the gatewayLoadBalancer value. + */ + SubResource gatewayLoadBalancer(); + + /** + * Gets the virtualNetworkTaps property: The reference to Virtual Network Taps. + * + * @return the virtualNetworkTaps value. + */ + List virtualNetworkTaps(); + + /** + * Gets the applicationGatewayBackendAddressPools property: The reference to ApplicationGatewayBackendAddressPool + * resource. + * + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * Gets the loadBalancerBackendAddressPools property: The reference to LoadBalancerBackendAddressPool resource. + * + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * Gets the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. + * + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * Gets the privateIpAddress property: Private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is + * IPv4. + * + * @return the privateIpAddressVersion value. + */ + IpVersion privateIpAddressVersion(); + + /** + * Gets the subnet property: Subnet bound to the IP configuration. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the primary property: Whether this is a primary customer address on the network interface. + * + * @return the primary value. + */ + Boolean primary(); + + /** + * Gets the publicIpAddress property: Public IP address bound to the IP configuration. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the applicationSecurityGroups property: Application security groups in which the IP configuration is + * included. + * + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * Gets the provisioningState property: The provisioning state of the network interface IP configuration. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateLinkConnectionProperties property: PrivateLinkConnection properties for the network interface. + * + * @return the privateLinkConnectionProperties value. + */ + NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner + * object. + * + * @return the inner object. + */ + NetworkInterfaceIpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java new file mode 100644 index 0000000000000..d200300b1ea07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list ip configurations API service call. */ +@Fluent +public final class NetworkInterfaceIpConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationListResult.class); + + /* + * A list of ip configurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of ip configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ip configurations. + * + * @param value the value value to set. + * @return the NetworkInterfaceIpConfigurationListResult object itself. + */ + public NetworkInterfaceIpConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.java new file mode 100644 index 0000000000000..6e816224be392 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; +import java.util.List; + +/** PrivateLinkConnection properties for the network interface. */ +@Immutable +public final class NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.class); + + /* + * The group ID for current private link connection. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The required member name for current private link connection. + */ + @JsonProperty(value = "requiredMemberName", access = JsonProperty.Access.WRITE_ONLY) + private String requiredMemberName; + + /* + * List of FQDNs for current private link connection. + */ + @JsonProperty(value = "fqdns", access = JsonProperty.Access.WRITE_ONLY) + private List fqdns; + + /** + * Get the groupId property: The group ID for current private link connection. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMemberName property: The required member name for current private link connection. + * + * @return the requiredMemberName value. + */ + public String requiredMemberName() { + return this.requiredMemberName; + } + + /** + * Get the fqdns property: List of FQDNs for current private link connection. + * + * @return the fqdns value. + */ + public List fqdns() { + return this.fqdns; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurations.java new file mode 100644 index 0000000000000..8022428cccaad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurations.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 NetworkInterfaceIpConfigurations. */ +public interface NetworkInterfaceIpConfigurations { + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + NetworkInterfaceIpConfiguration get( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName); + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceListResult.java new file mode 100644 index 0000000000000..934e3d6fa61ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListNetworkInterface API service call. */ +@Fluent +public final class NetworkInterfaceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceListResult.class); + + /* + * A list of network interfaces in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of network interfaces in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network interfaces in a resource group. + * + * @param value the value value to set. + * @return the NetworkInterfaceListResult object itself. + */ + public NetworkInterfaceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancerListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancerListResult.java new file mode 100644 index 0000000000000..3aff432e8be56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancerListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list ip configurations API service call. */ +@Fluent +public final class NetworkInterfaceLoadBalancerListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceLoadBalancerListResult.class); + + /* + * A list of load balancers. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of load balancers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of load balancers. + * + * @param value the value value to set. + * @return the NetworkInterfaceLoadBalancerListResult object itself. + */ + public NetworkInterfaceLoadBalancerListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancers.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancers.java new file mode 100644 index 0000000000000..05c19f40b8a33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancers.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkInterfaceLoadBalancers. */ +public interface NetworkInterfaceLoadBalancers { + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + PagedIterable list(String resourceGroupName, String networkInterfaceName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceMigrationPhase.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceMigrationPhase.java new file mode 100644 index 0000000000000..aceec6031c7b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceMigrationPhase.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkInterfaceMigrationPhase. */ +public final class NetworkInterfaceMigrationPhase extends ExpandableStringEnum { + /** Static value None for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase NONE = fromString("None"); + + /** Static value Prepare for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase PREPARE = fromString("Prepare"); + + /** Static value Commit for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase COMMIT = fromString("Commit"); + + /** Static value Abort for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase ABORT = fromString("Abort"); + + /** Static value Committed for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase COMMITTED = fromString("Committed"); + + /** + * Creates or finds a NetworkInterfaceMigrationPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceMigrationPhase. + */ + @JsonCreator + public static NetworkInterfaceMigrationPhase fromString(String name) { + return fromString(name, NetworkInterfaceMigrationPhase.class); + } + + /** @return known NetworkInterfaceMigrationPhase values. */ + public static Collection values() { + return values(NetworkInterfaceMigrationPhase.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceNicType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceNicType.java new file mode 100644 index 0000000000000..91ee494b2c426 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceNicType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkInterfaceNicType. */ +public final class NetworkInterfaceNicType extends ExpandableStringEnum { + /** Static value Standard for NetworkInterfaceNicType. */ + public static final NetworkInterfaceNicType STANDARD = fromString("Standard"); + + /** Static value Elastic for NetworkInterfaceNicType. */ + public static final NetworkInterfaceNicType ELASTIC = fromString("Elastic"); + + /** + * Creates or finds a NetworkInterfaceNicType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceNicType. + */ + @JsonCreator + public static NetworkInterfaceNicType fromString(String name) { + return fromString(name, NetworkInterfaceNicType.class); + } + + /** @return known NetworkInterfaceNicType values. */ + public static Collection values() { + return values(NetworkInterfaceNicType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfiguration.java new file mode 100644 index 0000000000000..7932dd96b8ee7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfiguration.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.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; + +/** An immutable client-side representation of NetworkInterfaceTapConfiguration. */ +public interface NetworkInterfaceTapConfiguration { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Sub Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the virtualNetworkTap property: The reference to the Virtual Network Tap resource. + * + * @return the virtualNetworkTap value. + */ + VirtualNetworkTap virtualNetworkTap(); + + /** + * Gets the provisioningState property: The provisioning state of the network interface tap configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner + * object. + * + * @return the inner object. + */ + NetworkInterfaceTapConfigurationInner innerModel(); + + /** The entirety of the NetworkInterfaceTapConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The NetworkInterfaceTapConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkInterfaceTapConfiguration definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the NetworkInterfaceTapConfiguration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkInterfaceName. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @return the next definition stage. + */ + WithCreate withExistingNetworkInterface(String resourceGroupName, String networkInterfaceName); + } + /** + * The stage of the NetworkInterfaceTapConfiguration 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.WithName, DefinitionStages.WithVirtualNetworkTap { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkInterfaceTapConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkInterfaceTapConfiguration create(Context context); + } + /** The stage of the NetworkInterfaceTapConfiguration definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the NetworkInterfaceTapConfiguration definition allowing to specify virtualNetworkTap. */ + interface WithVirtualNetworkTap { + /** + * Specifies the virtualNetworkTap property: The reference to the Virtual Network Tap resource.. + * + * @param virtualNetworkTap The reference to the Virtual Network Tap resource. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap); + } + } + /** + * Begins update for the NetworkInterfaceTapConfiguration resource. + * + * @return the stage of resource update. + */ + NetworkInterfaceTapConfiguration.Update update(); + + /** The template for NetworkInterfaceTapConfiguration update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithVirtualNetworkTap { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkInterfaceTapConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkInterfaceTapConfiguration apply(Context context); + } + /** The NetworkInterfaceTapConfiguration update stages. */ + interface UpdateStages { + /** The stage of the NetworkInterfaceTapConfiguration update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the NetworkInterfaceTapConfiguration update allowing to specify virtualNetworkTap. */ + interface WithVirtualNetworkTap { + /** + * Specifies the virtualNetworkTap property: The reference to the Virtual Network Tap resource.. + * + * @param virtualNetworkTap The reference to the Virtual Network Tap resource. + * @return the next definition stage. + */ + Update withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkInterfaceTapConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkInterfaceTapConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationListResult.java new file mode 100644 index 0000000000000..7f451bd496aae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list tap configurations API service call. */ +@Fluent +public final class NetworkInterfaceTapConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationListResult.class); + + /* + * A list of tap configurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of tap configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of tap configurations. + * + * @param value the value value to set. + * @return the NetworkInterfaceTapConfigurationListResult object itself. + */ + public NetworkInterfaceTapConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurations.java new file mode 100644 index 0000000000000..92c50dea48758 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurations.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 NetworkInterfaceTapConfigurations. */ +public interface NetworkInterfaceTapConfigurations { + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + NetworkInterfaceTapConfiguration get( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Get the specified tap configuration on a network interface. + * + * @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 the specified tap configuration on a network interface. + */ + NetworkInterfaceTapConfiguration getById(String id); + + /** + * Get the specified tap configuration on a network interface. + * + * @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 specified tap configuration on a network interface. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @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 NetworkInterfaceTapConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new NetworkInterfaceTapConfiguration definition. + */ + NetworkInterfaceTapConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaces.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaces.java new file mode 100644 index 0000000000000..d52426939c7cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaces.java @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 NetworkInterfaces. */ +public interface NetworkInterfaces { + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName); + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context); + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName); + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 all network interfaces in a cloud service. + */ + PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + NetworkInterface getCloudServiceNetworkInterface( + String resourceGroupName, String cloudServiceName, String roleInstanceName, String networkInterfaceName); + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + Response getCloudServiceNetworkInterfaceWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand, + Context context); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkInterfaceName); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkInterfaceName, Context context); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + NetworkInterface getByResourceGroup(String resourceGroupName, String networkInterfaceName); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, String expand, Context context); + + /** + * Gets all network interfaces in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + PagedIterable list(); + + /** + * Gets all network interfaces 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 all network interfaces in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network interfaces in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + EffectiveRouteListResult getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + EffectiveRouteListResult getEffectiveRouteTable( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, Context context); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + NetworkInterface getVirtualMachineScaleSetNetworkInterface( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + Response getVirtualMachineScaleSetNetworkInterfaceWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + NetworkInterfaceIpConfiguration getVirtualMachineScaleSetIpConfiguration( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + Response getVirtualMachineScaleSetIpConfigurationWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand, + Context context); + + /** + * Gets information about the specified network interface. + * + * @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 information about the specified network interface. + */ + NetworkInterface getById(String id); + + /** + * Gets information about the specified network interface. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified network interface. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified network interface. + * + * @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 NetworkInterface resource. + * + * @param name resource name. + * @return the first stage of the new NetworkInterface definition. + */ + NetworkInterface.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkOperationStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkOperationStatus.java new file mode 100644 index 0000000000000..3c2bab36508d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkOperationStatus.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkOperationStatus. */ +public final class NetworkOperationStatus extends ExpandableStringEnum { + /** Static value InProgress for NetworkOperationStatus. */ + public static final NetworkOperationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for NetworkOperationStatus. */ + public static final NetworkOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for NetworkOperationStatus. */ + public static final NetworkOperationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a NetworkOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkOperationStatus. + */ + @JsonCreator + public static NetworkOperationStatus fromString(String name) { + return fromString(name, NetworkOperationStatus.class); + } + + /** @return known NetworkOperationStatus values. */ + public static Collection values() { + return values(NetworkOperationStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfile.java new file mode 100644 index 0000000000000..26c69356778b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfile.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkProfile. */ +public interface NetworkProfile { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the containerNetworkInterfaces property: List of child container network interfaces. + * + * @return the containerNetworkInterfaces value. + */ + List containerNetworkInterfaces(); + + /** + * Gets the containerNetworkInterfaceConfigurations property: List of chid container network interface + * configurations. + * + * @return the containerNetworkInterfaceConfigurations value. + */ + List containerNetworkInterfaceConfigurations(); + + /** + * Gets the resourceGuid property: The resource GUID property of the network profile resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the network profile resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.NetworkProfileInner object. + * + * @return the inner object. + */ + NetworkProfileInner innerModel(); + + /** The entirety of the NetworkProfile definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkProfile definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkProfile definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkProfile 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 NetworkProfile definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkProfile 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.WithContainerNetworkInterfaceConfigurations { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkProfile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkProfile create(Context context); + } + /** The stage of the NetworkProfile 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 NetworkProfile definition allowing to specify containerNetworkInterfaceConfigurations. */ + interface WithContainerNetworkInterfaceConfigurations { + /** + * Specifies the containerNetworkInterfaceConfigurations property: List of chid container network interface + * configurations.. + * + * @param containerNetworkInterfaceConfigurations List of chid container network interface configurations. + * @return the next definition stage. + */ + WithCreate withContainerNetworkInterfaceConfigurations( + List containerNetworkInterfaceConfigurations); + } + } + /** + * Begins update for the NetworkProfile resource. + * + * @return the stage of resource update. + */ + NetworkProfile.Update update(); + + /** The template for NetworkProfile update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkProfile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkProfile apply(Context context); + } + /** The NetworkProfile update stages. */ + interface UpdateStages { + /** The stage of the NetworkProfile 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkProfile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkProfile refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfileListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfileListResult.java new file mode 100644 index 0000000000000..c280bb2935152 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfileListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkProfiles API service call. */ +@Fluent +public final class NetworkProfileListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfileListResult.class); + + /* + * A list of network profiles that exist in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of network profiles that exist in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network profiles that exist in a resource group. + * + * @param value the value value to set. + * @return the NetworkProfileListResult object itself. + */ + public NetworkProfileListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkProfileListResult object itself. + */ + public NetworkProfileListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfiles.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfiles.java new file mode 100644 index 0000000000000..bf110ee47310a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfiles.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 NetworkProfiles. */ +public interface NetworkProfiles { + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkProfileName); + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkProfileName, Context context); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + NetworkProfile getByResourceGroup(String resourceGroupName, String networkProfileName); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkProfileName, String expand, Context context); + + /** + * Gets all the network profiles in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the network profiles 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 all the network profiles in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network profiles in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified network profile in a specified resource group. + * + * @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 the specified network profile in a specified resource group. + */ + NetworkProfile getById(String id); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified network profile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified network profile. + * + * @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 NetworkProfile resource. + * + * @param name resource name. + * @return the first stage of the new NetworkProfile definition. + */ + NetworkProfile.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkRule.java new file mode 100644 index 0000000000000..08deb665ca8dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkRule.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Rule of type network. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("NetworkRule") +@Fluent +public final class NetworkRule extends FirewallPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRule.class); + + /* + * Array of FirewallPolicyRuleNetworkProtocols. + */ + @JsonProperty(value = "ipProtocols") + private List ipProtocols; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + @JsonProperty(value = "destinationIpGroups") + private List destinationIpGroups; + + /* + * List of destination FQDNs. + */ + @JsonProperty(value = "destinationFqdns") + private List destinationFqdns; + + /** + * Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @return the ipProtocols value. + */ + public List ipProtocols() { + return this.ipProtocols; + } + + /** + * Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @param ipProtocols the ipProtocols value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withIpProtocols(List ipProtocols) { + this.ipProtocols = ipProtocols; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @return the destinationIpGroups value. + */ + public List destinationIpGroups() { + return this.destinationIpGroups; + } + + /** + * Set the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @param destinationIpGroups the destinationIpGroups value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationIpGroups(List destinationIpGroups) { + this.destinationIpGroups = destinationIpGroups; + return this; + } + + /** + * Get the destinationFqdns property: List of destination FQDNs. + * + * @return the destinationFqdns value. + */ + public List destinationFqdns() { + return this.destinationFqdns; + } + + /** + * Set the destinationFqdns property: List of destination FQDNs. + * + * @param destinationFqdns the destinationFqdns value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationFqdns(List destinationFqdns) { + this.destinationFqdns = destinationFqdns; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkRule withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.java new file mode 100644 index 0000000000000..f13daeb1a20dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.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.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkSecurityGroup. */ +public interface NetworkSecurityGroup { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the securityRules property: A collection of security rules of the network security group. + * + * @return the securityRules value. + */ + List securityRules(); + + /** + * Gets the defaultSecurityRules property: The default security rules of network security group. + * + * @return the defaultSecurityRules value. + */ + List defaultSecurityRules(); + + /** + * Gets the networkInterfaces property: A collection of references to network interfaces. + * + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * Gets the subnets property: A collection of references to subnets. + * + * @return the subnets value. + */ + List subnets(); + + /** + * Gets the flowLogs property: A collection of references to flow log resources. + * + * @return the flowLogs value. + */ + List flowLogs(); + + /** + * Gets the resourceGuid property: The resource GUID property of the network security group resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the network security group resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.NetworkSecurityGroupInner object. + * + * @return the inner object. + */ + NetworkSecurityGroupInner innerModel(); + + /** The entirety of the NetworkSecurityGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkSecurityGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkSecurityGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkSecurityGroup 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 NetworkSecurityGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkSecurityGroup 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.WithSecurityRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkSecurityGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkSecurityGroup create(Context context); + } + /** The stage of the NetworkSecurityGroup 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 NetworkSecurityGroup definition allowing to specify securityRules. */ + interface WithSecurityRules { + /** + * Specifies the securityRules property: A collection of security rules of the network security group.. + * + * @param securityRules A collection of security rules of the network security group. + * @return the next definition stage. + */ + WithCreate withSecurityRules(List securityRules); + } + } + /** + * Begins update for the NetworkSecurityGroup resource. + * + * @return the stage of resource update. + */ + NetworkSecurityGroup.Update update(); + + /** The template for NetworkSecurityGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkSecurityGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkSecurityGroup apply(Context context); + } + /** The NetworkSecurityGroup update stages. */ + interface UpdateStages { + /** The stage of the NetworkSecurityGroup 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkSecurityGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkSecurityGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupListResult.java new file mode 100644 index 0000000000000..f88aeb631c6c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkSecurityGroups API service call. */ +@Fluent +public final class NetworkSecurityGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupListResult.class); + + /* + * A list of NetworkSecurityGroup resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of NetworkSecurityGroup resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of NetworkSecurityGroup resources. + * + * @param value the value value to set. + * @return the NetworkSecurityGroupListResult object itself. + */ + public NetworkSecurityGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkSecurityGroupListResult object itself. + */ + public NetworkSecurityGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupResult.java new file mode 100644 index 0000000000000..0544675b93903 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupResult.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.network.generated.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; + +/** Network configuration diagnostic result corresponded provided traffic query. */ +@Fluent +public final class NetworkSecurityGroupResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupResult.class); + + /* + * The network traffic is allowed or denied. + */ + @JsonProperty(value = "securityRuleAccessResult") + private SecurityRuleAccess securityRuleAccessResult; + + /* + * List of results network security groups diagnostic. + */ + @JsonProperty(value = "evaluatedNetworkSecurityGroups", access = JsonProperty.Access.WRITE_ONLY) + private List evaluatedNetworkSecurityGroups; + + /** + * Get the securityRuleAccessResult property: The network traffic is allowed or denied. + * + * @return the securityRuleAccessResult value. + */ + public SecurityRuleAccess securityRuleAccessResult() { + return this.securityRuleAccessResult; + } + + /** + * Set the securityRuleAccessResult property: The network traffic is allowed or denied. + * + * @param securityRuleAccessResult the securityRuleAccessResult value to set. + * @return the NetworkSecurityGroupResult object itself. + */ + public NetworkSecurityGroupResult withSecurityRuleAccessResult(SecurityRuleAccess securityRuleAccessResult) { + this.securityRuleAccessResult = securityRuleAccessResult; + return this; + } + + /** + * Get the evaluatedNetworkSecurityGroups property: List of results network security groups diagnostic. + * + * @return the evaluatedNetworkSecurityGroups value. + */ + public List evaluatedNetworkSecurityGroups() { + return this.evaluatedNetworkSecurityGroups; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (evaluatedNetworkSecurityGroups() != null) { + evaluatedNetworkSecurityGroups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroups.java new file mode 100644 index 0000000000000..065f5f070aae5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroups.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 NetworkSecurityGroups. */ +public interface NetworkSecurityGroups { + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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. + */ + void deleteByResourceGroup(String resourceGroupName, String networkSecurityGroupName); + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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. + */ + void delete(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 the specified network security group. + */ + NetworkSecurityGroup getByResourceGroup(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkSecurityGroupName, String expand, Context context); + + /** + * Gets all network security groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + PagedIterable list(); + + /** + * Gets all network security groups 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 all network security groups in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource 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 all network security groups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified network security group. + * + * @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 the specified network security group. + */ + NetworkSecurityGroup getById(String id); + + /** + * Gets the specified network security group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified network security group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified network security group. + * + * @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 NetworkSecurityGroup resource. + * + * @param name resource name. + * @return the first stage of the new NetworkSecurityGroup definition. + */ + NetworkSecurityGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityRulesEvaluationResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityRulesEvaluationResult.java new file mode 100644 index 0000000000000..873c94073271a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityRulesEvaluationResult.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Network security rules evaluation result. */ +@Fluent +public final class NetworkSecurityRulesEvaluationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityRulesEvaluationResult.class); + + /* + * Name of the network security rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Value indicating whether protocol is matched. + */ + @JsonProperty(value = "protocolMatched") + private Boolean protocolMatched; + + /* + * Value indicating whether source is matched. + */ + @JsonProperty(value = "sourceMatched") + private Boolean sourceMatched; + + /* + * Value indicating whether source port is matched. + */ + @JsonProperty(value = "sourcePortMatched") + private Boolean sourcePortMatched; + + /* + * Value indicating whether destination is matched. + */ + @JsonProperty(value = "destinationMatched") + private Boolean destinationMatched; + + /* + * Value indicating whether destination port is matched. + */ + @JsonProperty(value = "destinationPortMatched") + private Boolean destinationPortMatched; + + /** + * Get the name property: Name of the network security rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the network security rule. + * + * @param name the name value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocolMatched property: Value indicating whether protocol is matched. + * + * @return the protocolMatched value. + */ + public Boolean protocolMatched() { + return this.protocolMatched; + } + + /** + * Set the protocolMatched property: Value indicating whether protocol is matched. + * + * @param protocolMatched the protocolMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withProtocolMatched(Boolean protocolMatched) { + this.protocolMatched = protocolMatched; + return this; + } + + /** + * Get the sourceMatched property: Value indicating whether source is matched. + * + * @return the sourceMatched value. + */ + public Boolean sourceMatched() { + return this.sourceMatched; + } + + /** + * Set the sourceMatched property: Value indicating whether source is matched. + * + * @param sourceMatched the sourceMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourceMatched(Boolean sourceMatched) { + this.sourceMatched = sourceMatched; + return this; + } + + /** + * Get the sourcePortMatched property: Value indicating whether source port is matched. + * + * @return the sourcePortMatched value. + */ + public Boolean sourcePortMatched() { + return this.sourcePortMatched; + } + + /** + * Set the sourcePortMatched property: Value indicating whether source port is matched. + * + * @param sourcePortMatched the sourcePortMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourcePortMatched(Boolean sourcePortMatched) { + this.sourcePortMatched = sourcePortMatched; + return this; + } + + /** + * Get the destinationMatched property: Value indicating whether destination is matched. + * + * @return the destinationMatched value. + */ + public Boolean destinationMatched() { + return this.destinationMatched; + } + + /** + * Set the destinationMatched property: Value indicating whether destination is matched. + * + * @param destinationMatched the destinationMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationMatched(Boolean destinationMatched) { + this.destinationMatched = destinationMatched; + return this; + } + + /** + * Get the destinationPortMatched property: Value indicating whether destination port is matched. + * + * @return the destinationPortMatched value. + */ + public Boolean destinationPortMatched() { + return this.destinationPortMatched; + } + + /** + * Set the destinationPortMatched property: Value indicating whether destination port is matched. + * + * @param destinationPortMatched the destinationPortMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationPortMatched(Boolean destinationPortMatched) { + this.destinationPortMatched = destinationPortMatched; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliance.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliance.java new file mode 100644 index 0000000000000..7908a13fcef07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliance.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkVirtualAppliance. */ +public interface NetworkVirtualAppliance { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The service principal that has read access to cloud-init and config blob. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the nvaSku property: Network Virtual Appliance SKU. + * + * @return the nvaSku value. + */ + VirtualApplianceSkuProperties nvaSku(); + + /** + * Gets the addressPrefix property: Address Prefix. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the bootStrapConfigurationBlobs property: BootStrapConfigurationBlobs storage URLs. + * + * @return the bootStrapConfigurationBlobs value. + */ + List bootStrapConfigurationBlobs(); + + /** + * Gets the virtualHub property: The Virtual Hub where Network Virtual Appliance is being deployed. + * + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * Gets the cloudInitConfigurationBlobs property: CloudInitConfigurationBlob storage URLs. + * + * @return the cloudInitConfigurationBlobs value. + */ + List cloudInitConfigurationBlobs(); + + /** + * Gets the cloudInitConfiguration property: CloudInitConfiguration string in plain text. + * + * @return the cloudInitConfiguration value. + */ + String cloudInitConfiguration(); + + /** + * Gets the virtualApplianceAsn property: VirtualAppliance ASN. + * + * @return the virtualApplianceAsn value. + */ + Long virtualApplianceAsn(); + + /** + * Gets the virtualApplianceNics property: List of Virtual Appliance Network Interfaces. + * + * @return the virtualApplianceNics value. + */ + List virtualApplianceNics(); + + /** + * Gets the virtualApplianceSites property: List of references to VirtualApplianceSite. + * + * @return the virtualApplianceSites value. + */ + List virtualApplianceSites(); + + /** + * Gets the inboundSecurityRules property: List of references to InboundSecurityRules. + * + * @return the inboundSecurityRules value. + */ + List inboundSecurityRules(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.NetworkVirtualApplianceInner object. + * + * @return the inner object. + */ + NetworkVirtualApplianceInner innerModel(); + + /** The entirety of the NetworkVirtualAppliance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkVirtualAppliance definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkVirtualAppliance definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkVirtualAppliance 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 NetworkVirtualAppliance definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkVirtualAppliance definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithNvaSku, + DefinitionStages.WithBootStrapConfigurationBlobs, + DefinitionStages.WithVirtualHub, + DefinitionStages.WithCloudInitConfigurationBlobs, + DefinitionStages.WithCloudInitConfiguration, + DefinitionStages.WithVirtualApplianceAsn { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkVirtualAppliance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkVirtualAppliance create(Context context); + } + /** The stage of the NetworkVirtualAppliance 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 NetworkVirtualAppliance definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The service principal that has read access to cloud-init and config + * blob.. + * + * @param identity The service principal that has read access to cloud-init and config blob. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify nvaSku. */ + interface WithNvaSku { + /** + * Specifies the nvaSku property: Network Virtual Appliance SKU.. + * + * @param nvaSku Network Virtual Appliance SKU. + * @return the next definition stage. + */ + WithCreate withNvaSku(VirtualApplianceSkuProperties nvaSku); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify bootStrapConfigurationBlobs. */ + interface WithBootStrapConfigurationBlobs { + /** + * Specifies the bootStrapConfigurationBlobs property: BootStrapConfigurationBlobs storage URLs.. + * + * @param bootStrapConfigurationBlobs BootStrapConfigurationBlobs storage URLs. + * @return the next definition stage. + */ + WithCreate withBootStrapConfigurationBlobs(List bootStrapConfigurationBlobs); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The Virtual Hub where Network Virtual Appliance is being deployed.. + * + * @param virtualHub The Virtual Hub where Network Virtual Appliance is being deployed. + * @return the next definition stage. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify cloudInitConfigurationBlobs. */ + interface WithCloudInitConfigurationBlobs { + /** + * Specifies the cloudInitConfigurationBlobs property: CloudInitConfigurationBlob storage URLs.. + * + * @param cloudInitConfigurationBlobs CloudInitConfigurationBlob storage URLs. + * @return the next definition stage. + */ + WithCreate withCloudInitConfigurationBlobs(List cloudInitConfigurationBlobs); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify cloudInitConfiguration. */ + interface WithCloudInitConfiguration { + /** + * Specifies the cloudInitConfiguration property: CloudInitConfiguration string in plain text.. + * + * @param cloudInitConfiguration CloudInitConfiguration string in plain text. + * @return the next definition stage. + */ + WithCreate withCloudInitConfiguration(String cloudInitConfiguration); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify virtualApplianceAsn. */ + interface WithVirtualApplianceAsn { + /** + * Specifies the virtualApplianceAsn property: VirtualAppliance ASN.. + * + * @param virtualApplianceAsn VirtualAppliance ASN. + * @return the next definition stage. + */ + WithCreate withVirtualApplianceAsn(Long virtualApplianceAsn); + } + } + /** + * Begins update for the NetworkVirtualAppliance resource. + * + * @return the stage of resource update. + */ + NetworkVirtualAppliance.Update update(); + + /** The template for NetworkVirtualAppliance update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkVirtualAppliance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkVirtualAppliance apply(Context context); + } + /** The NetworkVirtualAppliance update stages. */ + interface UpdateStages { + /** The stage of the NetworkVirtualAppliance 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkVirtualAppliance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkVirtualAppliance refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceListResult.java new file mode 100644 index 0000000000000..47e54b5d7ab0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkVirtualAppliances API service call. */ +@Fluent +public final class NetworkVirtualApplianceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceListResult.class); + + /* + * List of Network Virtual Appliances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Network Virtual Appliances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Network Virtual Appliances. + * + * @param value the value value to set. + * @return the NetworkVirtualApplianceListResult object itself. + */ + public NetworkVirtualApplianceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkVirtualApplianceListResult object itself. + */ + public NetworkVirtualApplianceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.java new file mode 100644 index 0000000000000..d8ccfdf5427f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkVirtualApplianceSites API service call. */ +@Fluent +public final class NetworkVirtualApplianceSiteListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceSiteListResult.class); + + /* + * List of Network Virtual Appliance sites. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Network Virtual Appliance sites. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Network Virtual Appliance sites. + * + * @param value the value value to set. + * @return the NetworkVirtualApplianceSiteListResult object itself. + */ + public NetworkVirtualApplianceSiteListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkVirtualApplianceSiteListResult object itself. + */ + public NetworkVirtualApplianceSiteListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSku.java new file mode 100644 index 0000000000000..8b16f0b4232fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSku.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkVirtualApplianceSku. */ +public interface NetworkVirtualApplianceSku { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the vendor property: Network Virtual Appliance Sku vendor. + * + * @return the vendor value. + */ + String vendor(); + + /** + * Gets the availableVersions property: Available Network Virtual Appliance versions. + * + * @return the availableVersions value. + */ + List availableVersions(); + + /** + * Gets the availableScaleUnits property: The list of scale units available. + * + * @return the availableScaleUnits value. + */ + List availableScaleUnits(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner object. + * + * @return the inner object. + */ + NetworkVirtualApplianceSkuInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuInstances.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuInstances.java new file mode 100644 index 0000000000000..651fba584e072 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuInstances.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.network.generated.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; + +/** List of available Sku and instances. */ +@Immutable +public final class NetworkVirtualApplianceSkuInstances { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceSkuInstances.class); + + /* + * Scale Unit. + */ + @JsonProperty(value = "scaleUnit", access = JsonProperty.Access.WRITE_ONLY) + private String scaleUnit; + + /* + * Instance Count. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** + * Get the scaleUnit property: Scale Unit. + * + * @return the scaleUnit value. + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Get the instanceCount property: Instance Count. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.java new file mode 100644 index 0000000000000..9c8de86a63276 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkVirtualApplianceSkus API service call. */ +@Fluent +public final class NetworkVirtualApplianceSkuListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceSkuListResult.class); + + /* + * List of Network Virtual Appliance Skus that are available. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Network Virtual Appliance Skus that are available. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Network Virtual Appliance Skus that are available. + * + * @param value the value value to set. + * @return the NetworkVirtualApplianceSkuListResult object itself. + */ + public NetworkVirtualApplianceSkuListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkVirtualApplianceSkuListResult object itself. + */ + public NetworkVirtualApplianceSkuListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.java new file mode 100644 index 0000000000000..41e333586c64c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 NetworkVirtualAppliances. */ +public interface NetworkVirtualAppliances { + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkVirtualApplianceName); + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkVirtualApplianceName, Context context); + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + NetworkVirtualAppliance getByResourceGroup(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String expand, Context context); + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListNetworkVirtualAppliances API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + PagedIterable list(); + + /** + * Gets all Network Virtual Appliances 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 all Network Virtual Appliances in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Network Virtual Appliance. + * + * @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 the specified Network Virtual Appliance. + */ + NetworkVirtualAppliance getById(String id); + + /** + * Gets the specified Network Virtual Appliance. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Network Virtual Appliance. + * + * @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 NetworkVirtualAppliance resource. + * + * @param name resource name. + * @return the first stage of the new NetworkVirtualAppliance definition. + */ + NetworkVirtualAppliance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcher.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcher.java new file mode 100644 index 0000000000000..98541dc93f175 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcher.java @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import java.util.Map; + +/** An immutable client-side representation of NetworkWatcher. */ +public interface NetworkWatcher { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the provisioningState property: The provisioning state of the network watcher resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.NetworkWatcherInner object. + * + * @return the inner object. + */ + NetworkWatcherInner innerModel(); + + /** The entirety of the NetworkWatcher definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkWatcher definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkWatcher definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkWatcher 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 NetworkWatcher definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkWatcher 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkWatcher create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkWatcher create(Context context); + } + /** The stage of the NetworkWatcher 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); + } + } + /** + * Begins update for the NetworkWatcher resource. + * + * @return the stage of resource update. + */ + NetworkWatcher.Update update(); + + /** The template for NetworkWatcher update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkWatcher apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkWatcher apply(Context context); + } + /** The NetworkWatcher update stages. */ + interface UpdateStages { + /** The stage of the NetworkWatcher 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkWatcher refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkWatcher refresh(Context context); + + /** + * Gets the current network topology by resource group. + * + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + Topology getTopology(TopologyParameters parameters); + + /** + * Gets the current network topology by resource group. + * + * @param parameters Parameters that define the representation of topology. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + Response getTopologyWithResponse(TopologyParameters parameters, Context context); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + VerificationIpFlowResult verifyIpFlow(VerificationIpFlowParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + VerificationIpFlowResult verifyIpFlow(VerificationIpFlowParameters parameters, Context context); + + /** + * Gets the next hop from the specified VM. + * + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + NextHopResult getNextHop(NextHopParameters parameters); + + /** + * Gets the next hop from the specified VM. + * + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + NextHopResult getNextHop(NextHopParameters parameters, Context context); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + SecurityGroupViewResult getVMSecurityRules(SecurityGroupViewParameters parameters); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + SecurityGroupViewResult getVMSecurityRules(SecurityGroupViewParameters parameters, Context context); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + TroubleshootingResult getTroubleshooting(TroubleshootingParameters parameters); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + TroubleshootingResult getTroubleshooting(TroubleshootingParameters parameters, Context context); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + TroubleshootingResult getTroubleshootingResult(QueryTroubleshootingParameters parameters); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + TroubleshootingResult getTroubleshootingResult(QueryTroubleshootingParameters parameters, Context context); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation setFlowLogConfiguration(FlowLogInformationInner parameters); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation setFlowLogConfiguration(FlowLogInformationInner parameters, Context context); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation getFlowLogStatus(FlowLogStatusParameters parameters); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation getFlowLogStatus(FlowLogStatusParameters parameters, Context context); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + ConnectivityInformation checkConnectivity(ConnectivityParameters parameters); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + ConnectivityInformation checkConnectivity(ConnectivityParameters parameters, Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + AzureReachabilityReport getAzureReachabilityReport(AzureReachabilityReportParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + AzureReachabilityReport getAzureReachabilityReport(AzureReachabilityReportParameters parameters, Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + AvailableProvidersList listAvailableProviders(AvailableProvidersListParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + AvailableProvidersList listAvailableProviders(AvailableProvidersListParameters parameters, Context context); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + NetworkConfigurationDiagnosticParameters parameters); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + NetworkConfigurationDiagnosticParameters parameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.java new file mode 100644 index 0000000000000..da1202c6cf327 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkWatchers API service call. */ +@Fluent +public final class NetworkWatcherListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatcherListResult.class); + + /* + * List of network watcher resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of network watcher resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of network watcher resources. + * + * @param value the value value to set. + * @return the NetworkWatcherListResult object itself. + */ + public NetworkWatcherListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java new file mode 100644 index 0000000000000..19836d05f8250 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; + +/** Resource collection API of NetworkWatchers. */ +public interface NetworkWatchers { + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + NetworkWatcher getByResourceGroup(String resourceGroupName, String networkWatcherName); + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkWatcherName, Context context); + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkWatcherName); + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkWatcherName, Context context); + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource 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 all network watchers by resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all network watchers by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + PagedIterable list(); + + /** + * Gets all network watchers by 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 all network watchers by subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + Topology getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters); + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + Response getTopologyWithResponse( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + VerificationIpFlowResult verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + VerificationIpFlowResult verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + NextHopResult getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + NextHopResult getNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + SecurityGroupViewResult getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + SecurityGroupViewResult getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + TroubleshootingResult getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + TroubleshootingResult getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + TroubleshootingResult getTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + TroubleshootingResult getTroubleshootingResult( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + ConnectivityInformation checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + ConnectivityInformation checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + AzureReachabilityReport getAzureReachabilityReport( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + AzureReachabilityReport getAzureReachabilityReport( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + AvailableProvidersList listAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + AvailableProvidersList listAvailableProviders( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context); + + /** + * Gets the specified network watcher by resource group. + * + * @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 the specified network watcher by resource group. + */ + NetworkWatcher getById(String id); + + /** + * Gets the specified network watcher by resource group. + * + * @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 specified network watcher by resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified network watcher resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified network watcher resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkWatcher resource. + * + * @param name resource name. + * @return the first stage of the new NetworkWatcher definition. + */ + NetworkWatcher.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopParameters.java new file mode 100644 index 0000000000000..2dd0a97d69826 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopParameters.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters that define the source and destination endpoint. */ +@Fluent +public final class NextHopParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NextHopParameters.class); + + /* + * The resource identifier of the target resource against which the action + * is to be performed. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * The source IP address. + */ + @JsonProperty(value = "sourceIPAddress", required = true) + private String sourceIpAddress; + + /* + * The destination IP address. + */ + @JsonProperty(value = "destinationIPAddress", required = true) + private String destinationIpAddress; + + /* + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of the nics, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the targetResourceId property: The resource identifier of the target resource against which the action is to + * be performed. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The resource identifier of the target resource against which the action is to + * be performed. + * + * @param targetResourceId the targetResourceId value to set. + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the sourceIpAddress property: The source IP address. + * + * @return the sourceIpAddress value. + */ + public String sourceIpAddress() { + return this.sourceIpAddress; + } + + /** + * Set the sourceIpAddress property: The source IP address. + * + * @param sourceIpAddress the sourceIpAddress value to set. + * @return the NextHopParameters object itself. + */ + public NextHopParameters withSourceIpAddress(String sourceIpAddress) { + this.sourceIpAddress = sourceIpAddress; + return this; + } + + /** + * Get the destinationIpAddress property: The destination IP address. + * + * @return the destinationIpAddress value. + */ + public String destinationIpAddress() { + return this.destinationIpAddress; + } + + /** + * Set the destinationIpAddress property: The destination IP address. + * + * @param destinationIpAddress the destinationIpAddress value to set. + * @return the NextHopParameters object itself. + */ + public NextHopParameters withDestinationIpAddress(String destinationIpAddress) { + this.destinationIpAddress = destinationIpAddress; + return this; + } + + /** + * Get the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of + * the nics, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value. + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of + * the nics, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set. + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model NextHopParameters")); + } + if (sourceIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceIpAddress in model NextHopParameters")); + } + if (destinationIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationIpAddress in model NextHopParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java new file mode 100644 index 0000000000000..296e30f871af7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; + +/** An immutable client-side representation of NextHopResult. */ +public interface NextHopResult { + /** + * Gets the nextHopType property: Next hop type. + * + * @return the nextHopType value. + */ + NextHopType nextHopType(); + + /** + * Gets the nextHopIpAddress property: Next hop IP Address. + * + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * Gets the routeTableId property: The resource identifier for the route table associated with the route being + * returned. If the route being returned does not correspond to any user created routes then this field will be the + * string 'System Route'. + * + * @return the routeTableId value. + */ + String routeTableId(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner object. + * + * @return the inner object. + */ + NextHopResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.java new file mode 100644 index 0000000000000..0ce8f2c104f07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NextHopType. */ +public final class NextHopType extends ExpandableStringEnum { + /** Static value Internet for NextHopType. */ + public static final NextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for NextHopType. */ + public static final NextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value VirtualNetworkGateway for NextHopType. */ + public static final NextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for NextHopType. */ + public static final NextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value HyperNetGateway for NextHopType. */ + public static final NextHopType HYPER_NET_GATEWAY = fromString("HyperNetGateway"); + + /** Static value None for NextHopType. */ + public static final NextHopType NONE = fromString("None"); + + /** + * Creates or finds a NextHopType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NextHopType. + */ + @JsonCreator + public static NextHopType fromString(String name) { + return fromString(name, NextHopType.class); + } + + /** @return known NextHopType values. */ + public static Collection values() { + return values(NextHopType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365BreakOutCategoryPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365BreakOutCategoryPolicies.java new file mode 100644 index 0000000000000..430bfb2a67d8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365BreakOutCategoryPolicies.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.network.generated.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; + +/** Office365 breakout categories. */ +@Fluent +public final class O365BreakOutCategoryPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(O365BreakOutCategoryPolicies.class); + + /* + * Flag to control allow category. + */ + @JsonProperty(value = "allow") + private Boolean allow; + + /* + * Flag to control optimize category. + */ + @JsonProperty(value = "optimize") + private Boolean optimize; + + /* + * Flag to control default category. + */ + @JsonProperty(value = "default") + private Boolean defaultProperty; + + /** + * Get the allow property: Flag to control allow category. + * + * @return the allow value. + */ + public Boolean allow() { + return this.allow; + } + + /** + * Set the allow property: Flag to control allow category. + * + * @param allow the allow value to set. + * @return the O365BreakOutCategoryPolicies object itself. + */ + public O365BreakOutCategoryPolicies withAllow(Boolean allow) { + this.allow = allow; + return this; + } + + /** + * Get the optimize property: Flag to control optimize category. + * + * @return the optimize value. + */ + public Boolean optimize() { + return this.optimize; + } + + /** + * Set the optimize property: Flag to control optimize category. + * + * @param optimize the optimize value to set. + * @return the O365BreakOutCategoryPolicies object itself. + */ + public O365BreakOutCategoryPolicies withOptimize(Boolean optimize) { + this.optimize = optimize; + return this; + } + + /** + * Get the defaultProperty property: Flag to control default category. + * + * @return the defaultProperty value. + */ + public Boolean defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Flag to control default category. + * + * @param defaultProperty the defaultProperty value to set. + * @return the O365BreakOutCategoryPolicies object itself. + */ + public O365BreakOutCategoryPolicies withDefaultProperty(Boolean defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365PolicyProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365PolicyProperties.java new file mode 100644 index 0000000000000..2c1b7a3d0f828 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365PolicyProperties.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.network.generated.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 Office365 breakout policy. */ +@Fluent +public final class O365PolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(O365PolicyProperties.class); + + /* + * Office365 breakout categories. + */ + @JsonProperty(value = "breakOutCategories") + private O365BreakOutCategoryPolicies breakOutCategories; + + /** + * Get the breakOutCategories property: Office365 breakout categories. + * + * @return the breakOutCategories value. + */ + public O365BreakOutCategoryPolicies breakOutCategories() { + return this.breakOutCategories; + } + + /** + * Set the breakOutCategories property: Office365 breakout categories. + * + * @param breakOutCategories the breakOutCategories value to set. + * @return the O365PolicyProperties object itself. + */ + public O365PolicyProperties withBreakOutCategories(O365BreakOutCategoryPolicies breakOutCategories) { + this.breakOutCategories = breakOutCategories; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (breakOutCategories() != null) { + breakOutCategories().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Office365PolicyProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Office365PolicyProperties.java new file mode 100644 index 0000000000000..3c37cdd064871 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Office365PolicyProperties.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.network.generated.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; + +/** Network Virtual Appliance Sku Properties. */ +@Fluent +public final class Office365PolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Office365PolicyProperties.class); + + /* + * Office 365 breakout categories. + */ + @JsonProperty(value = "breakOutCategories") + private BreakOutCategoryPolicies breakOutCategories; + + /** + * Get the breakOutCategories property: Office 365 breakout categories. + * + * @return the breakOutCategories value. + */ + public BreakOutCategoryPolicies breakOutCategories() { + return this.breakOutCategories; + } + + /** + * Set the breakOutCategories property: Office 365 breakout categories. + * + * @param breakOutCategories the breakOutCategories value to set. + * @return the Office365PolicyProperties object itself. + */ + public Office365PolicyProperties withBreakOutCategories(BreakOutCategoryPolicies breakOutCategories) { + this.breakOutCategories = breakOutCategories; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (breakOutCategories() != null) { + breakOutCategories().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OfficeTrafficCategory.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OfficeTrafficCategory.java new file mode 100644 index 0000000000000..f0d0f0d2b654a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OfficeTrafficCategory.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OfficeTrafficCategory. */ +public final class OfficeTrafficCategory extends ExpandableStringEnum { + /** Static value Optimize for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory OPTIMIZE = fromString("Optimize"); + + /** Static value OptimizeAndAllow for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory OPTIMIZE_AND_ALLOW = fromString("OptimizeAndAllow"); + + /** Static value All for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory ALL = fromString("All"); + + /** Static value None for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory NONE = fromString("None"); + + /** + * Creates or finds a OfficeTrafficCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding OfficeTrafficCategory. + */ + @JsonCreator + public static OfficeTrafficCategory fromString(String name) { + return fromString(name, OfficeTrafficCategory.class); + } + + /** @return known OfficeTrafficCategory values. */ + public static Collection values() { + return values(OfficeTrafficCategory.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operation.java new file mode 100644 index 0000000000000..4aaa7c0a9b439 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operation.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: Specification of the service. + * + * @return the serviceSpecification value. + */ + OperationPropertiesFormatServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..f08fc49879b6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Display metadata associated with the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Service provider: Microsoft Network. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Type of the operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Service provider: Microsoft Network. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Microsoft Network. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Type of the operation: get, read, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Type of the operation: get, read, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..45683ed66f395 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Network operations. It contains a list of operations and a URL link to get the next set + * of results. + */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of Network operations supported by the Network resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Network operations supported by the Network resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Network operations supported by the Network resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationPropertiesFormatServiceSpecification.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationPropertiesFormatServiceSpecification.java new file mode 100644 index 0000000000000..e3c3235d1d4cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationPropertiesFormatServiceSpecification.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Specification of the service. */ +@Fluent +public final class OperationPropertiesFormatServiceSpecification { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(OperationPropertiesFormatServiceSpecification.class); + + /* + * Operation service specification. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * Operation log specification. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get the metricSpecifications property: Operation service specification. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Operation service specification. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withMetricSpecifications( + List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get the logSpecifications property: Operation log specification. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Operation log specification. + * + * @param logSpecifications the logSpecifications value to set. + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withLogSpecifications( + List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operations.java new file mode 100644 index 0000000000000..a9d02dffcbf94 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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.network.generated.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 Network Rest API 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 result of the request to list Network operations. + */ + PagedIterable list(); + + /** + * Lists all of the available Network Rest API 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 result of the request to list Network operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Origin.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Origin.java new file mode 100644 index 0000000000000..5710e019416e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Origin.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Origin. */ +public final class Origin extends ExpandableStringEnum { + /** Static value Local for Origin. */ + public static final Origin LOCAL = fromString("Local"); + + /** Static value Inbound for Origin. */ + public static final Origin INBOUND = fromString("Inbound"); + + /** Static value Outbound for Origin. */ + public static final Origin OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** @return known Origin values. */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java new file mode 100644 index 0000000000000..8c73537a0ba34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import java.util.List; + +/** An immutable client-side representation of OutboundRule. */ +public interface OutboundRule { + /** + * 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 that is unique within the set of outbound rules used by the load + * balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. + * + * @return the allocatedOutboundPorts value. + */ + Integer allocatedOutboundPorts(); + + /** + * Gets the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. + * + * @return the frontendIpConfigurations value. + */ + List frontendIpConfigurations(); + + /** + * Gets the backendAddressPool property: A reference to a pool of DIPs. Outbound traffic is randomly load balanced + * across IPs in the backend IPs. + * + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * Gets the provisioningState property: The provisioning state of the outbound rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the protocol property: The protocol for the outbound rule in load balancer. + * + * @return the protocol value. + */ + LoadBalancerOutboundRuleProtocol protocol(); + + /** + * Gets the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * Gets the idleTimeoutInMinutes property: The timeout for the TCP idle connection. + * + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner object. + * + * @return the inner object. + */ + OutboundRuleInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.java new file mode 100644 index 0000000000000..68febd37f2dbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OutputType. */ +public final class OutputType extends ExpandableStringEnum { + /** Static value Workspace for OutputType. */ + public static final OutputType WORKSPACE = fromString("Workspace"); + + /** + * Creates or finds a OutputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OutputType. + */ + @JsonCreator + public static OutputType fromString(String name) { + return fromString(name, OutputType.class); + } + + /** @return known OutputType values. */ + public static Collection values() { + return values(OutputType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntry.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntry.java new file mode 100644 index 0000000000000..6c8444e8f6811 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntry.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Allow to exclude some variable satisfy the condition for the WAF check. */ +@Fluent +public final class OwaspCrsExclusionEntry { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OwaspCrsExclusionEntry.class); + + /* + * The variable to be excluded. + */ + @JsonProperty(value = "matchVariable", required = true) + private OwaspCrsExclusionEntryMatchVariable matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selectorMatchOperator", required = true) + private OwaspCrsExclusionEntrySelectorMatchOperator selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which + * elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selector", required = true) + private String selector; + + /** + * Get the matchVariable property: The variable to be excluded. + * + * @return the matchVariable value. + */ + public OwaspCrsExclusionEntryMatchVariable matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: The variable to be excluded. + * + * @param matchVariable the matchVariable value to set. + * @return the OwaspCrsExclusionEntry object itself. + */ + public OwaspCrsExclusionEntry withMatchVariable(OwaspCrsExclusionEntryMatchVariable matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + * + * @return the selectorMatchOperator value. + */ + public OwaspCrsExclusionEntrySelectorMatchOperator selectorMatchOperator() { + return this.selectorMatchOperator; + } + + /** + * Set the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + * + * @param selectorMatchOperator the selectorMatchOperator value to set. + * @return the OwaspCrsExclusionEntry object itself. + */ + public OwaspCrsExclusionEntry withSelectorMatchOperator( + OwaspCrsExclusionEntrySelectorMatchOperator selectorMatchOperator) { + this.selectorMatchOperator = selectorMatchOperator; + return this; + } + + /** + * Get the selector property: When matchVariable is a collection, operator used to specify which elements in the + * collection this exclusion applies to. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: When matchVariable is a collection, operator used to specify which elements in the + * collection this exclusion applies to. + * + * @param selector the selector value to set. + * @return the OwaspCrsExclusionEntry object itself. + */ + public OwaspCrsExclusionEntry withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchVariable in model OwaspCrsExclusionEntry")); + } + if (selectorMatchOperator() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectorMatchOperator in model OwaspCrsExclusionEntry")); + } + if (selector() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property selector in model OwaspCrsExclusionEntry")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntryMatchVariable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntryMatchVariable.java new file mode 100644 index 0000000000000..88317e14b7f92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntryMatchVariable.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OwaspCrsExclusionEntryMatchVariable. */ +public final class OwaspCrsExclusionEntryMatchVariable + extends ExpandableStringEnum { + /** Static value RequestHeaderNames for OwaspCrsExclusionEntryMatchVariable. */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_HEADER_NAMES = fromString("RequestHeaderNames"); + + /** Static value RequestCookieNames for OwaspCrsExclusionEntryMatchVariable. */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_COOKIE_NAMES = fromString("RequestCookieNames"); + + /** Static value RequestArgNames for OwaspCrsExclusionEntryMatchVariable. */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_ARG_NAMES = fromString("RequestArgNames"); + + /** + * Creates or finds a OwaspCrsExclusionEntryMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding OwaspCrsExclusionEntryMatchVariable. + */ + @JsonCreator + public static OwaspCrsExclusionEntryMatchVariable fromString(String name) { + return fromString(name, OwaspCrsExclusionEntryMatchVariable.class); + } + + /** @return known OwaspCrsExclusionEntryMatchVariable values. */ + public static Collection values() { + return values(OwaspCrsExclusionEntryMatchVariable.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntrySelectorMatchOperator.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntrySelectorMatchOperator.java new file mode 100644 index 0000000000000..4ac543e2bc97f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntrySelectorMatchOperator.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OwaspCrsExclusionEntrySelectorMatchOperator. */ +public final class OwaspCrsExclusionEntrySelectorMatchOperator + extends ExpandableStringEnum { + /** Static value Equals for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator EQUALS = fromString("Equals"); + + /** Static value Contains for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator CONTAINS = fromString("Contains"); + + /** Static value StartsWith for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator STARTS_WITH = fromString("StartsWith"); + + /** Static value EndsWith for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value EqualsAny for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator EQUALS_ANY = fromString("EqualsAny"); + + /** + * Creates or finds a OwaspCrsExclusionEntrySelectorMatchOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding OwaspCrsExclusionEntrySelectorMatchOperator. + */ + @JsonCreator + public static OwaspCrsExclusionEntrySelectorMatchOperator fromString(String name) { + return fromString(name, OwaspCrsExclusionEntrySelectorMatchOperator.class); + } + + /** @return known OwaspCrsExclusionEntrySelectorMatchOperator values. */ + public static Collection values() { + return values(OwaspCrsExclusionEntrySelectorMatchOperator.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SConnectionConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SConnectionConfiguration.java new file mode 100644 index 0000000000000..b21200f4b10a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SConnectionConfiguration.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** P2SConnectionConfiguration Resource. */ +@JsonFlatten +@Fluent +public class P2SConnectionConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SConnectionConfiguration.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The reference to the address space resource which represents Address + * space for P2S VpnClient. + */ + @JsonProperty(value = "properties.vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /* + * The Routing Configuration indicating the associated and propagated route + * tables on this connection. + */ + @JsonProperty(value = "properties.routingConfiguration") + private RoutingConfiguration routingConfiguration; + + /* + * Flag indicating whether the enable internet security flag is turned on + * for the P2S Connections or not. + */ + @JsonProperty(value = "properties.enableInternetSecurity") + private Boolean enableInternetSecurity; + + /* + * The provisioning state of the P2SConnectionConfiguration resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the P2SConnectionConfiguration object itself. + */ + public P2SConnectionConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the vpnClientAddressPool property: The reference to the address space resource which represents Address space + * for P2S VpnClient. + * + * @return the vpnClientAddressPool value. + */ + public AddressSpace vpnClientAddressPool() { + return this.vpnClientAddressPool; + } + + /** + * Set the vpnClientAddressPool property: The reference to the address space resource which represents Address space + * for P2S VpnClient. + * + * @param vpnClientAddressPool the vpnClientAddressPool value to set. + * @return the P2SConnectionConfiguration object itself. + */ + public P2SConnectionConfiguration withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.vpnClientAddressPool = vpnClientAddressPool; + return this; + } + + /** + * Get the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + public RoutingConfiguration routingConfiguration() { + return this.routingConfiguration; + } + + /** + * Set the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @param routingConfiguration the routingConfiguration value to set. + * @return the P2SConnectionConfiguration object itself. + */ + public P2SConnectionConfiguration withRoutingConfiguration(RoutingConfiguration routingConfiguration) { + this.routingConfiguration = routingConfiguration; + return this; + } + + /** + * Get the enableInternetSecurity property: Flag indicating whether the enable internet security flag is turned on + * for the P2S Connections or not. + * + * @return the enableInternetSecurity value. + */ + public Boolean enableInternetSecurity() { + return this.enableInternetSecurity; + } + + /** + * Set the enableInternetSecurity property: Flag indicating whether the enable internet security flag is turned on + * for the P2S Connections or not. + * + * @param enableInternetSecurity the enableInternetSecurity value to set. + * @return the P2SConnectionConfiguration object itself. + */ + public P2SConnectionConfiguration withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.enableInternetSecurity = enableInternetSecurity; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the P2SConnectionConfiguration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public P2SConnectionConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vpnClientAddressPool() != null) { + vpnClientAddressPool().validate(); + } + if (routingConfiguration() != null) { + routingConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealth.java new file mode 100644 index 0000000000000..32c350e5f9cf6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealth.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner; + +/** An immutable client-side representation of P2SVpnConnectionHealth. */ +public interface P2SVpnConnectionHealth { + /** + * Gets the sasUrl property: Returned sas url of the blob to which the p2s vpn connection detailed health will be + * written. + * + * @return the sasUrl value. + */ + String sasUrl(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner object. + * + * @return the inner object. + */ + P2SVpnConnectionHealthInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealthRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealthRequest.java new file mode 100644 index 0000000000000..be42ce86bcb4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealthRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** List of P2S Vpn connection health request. */ +@Fluent +public final class P2SVpnConnectionHealthRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnConnectionHealthRequest.class); + + /* + * The list of p2s vpn user names whose p2s vpn connection detailed health + * to retrieve for. + */ + @JsonProperty(value = "vpnUserNamesFilter") + private List vpnUserNamesFilter; + + /* + * The sas-url to download the P2S Vpn connection health detail. + */ + @JsonProperty(value = "outputBlobSasUrl") + private String outputBlobSasUrl; + + /** + * Get the vpnUserNamesFilter property: The list of p2s vpn user names whose p2s vpn connection detailed health to + * retrieve for. + * + * @return the vpnUserNamesFilter value. + */ + public List vpnUserNamesFilter() { + return this.vpnUserNamesFilter; + } + + /** + * Set the vpnUserNamesFilter property: The list of p2s vpn user names whose p2s vpn connection detailed health to + * retrieve for. + * + * @param vpnUserNamesFilter the vpnUserNamesFilter value to set. + * @return the P2SVpnConnectionHealthRequest object itself. + */ + public P2SVpnConnectionHealthRequest withVpnUserNamesFilter(List vpnUserNamesFilter) { + this.vpnUserNamesFilter = vpnUserNamesFilter; + return this; + } + + /** + * Get the outputBlobSasUrl property: The sas-url to download the P2S Vpn connection health detail. + * + * @return the outputBlobSasUrl value. + */ + public String outputBlobSasUrl() { + return this.outputBlobSasUrl; + } + + /** + * Set the outputBlobSasUrl property: The sas-url to download the P2S Vpn connection health detail. + * + * @param outputBlobSasUrl the outputBlobSasUrl value to set. + * @return the P2SVpnConnectionHealthRequest object itself. + */ + public P2SVpnConnectionHealthRequest withOutputBlobSasUrl(String outputBlobSasUrl) { + this.outputBlobSasUrl = outputBlobSasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionRequest.java new file mode 100644 index 0000000000000..cfc871367d00e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionRequest.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** List of p2s vpn connections to be disconnected. */ +@Fluent +public final class P2SVpnConnectionRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnConnectionRequest.class); + + /* + * List of p2s vpn connection Ids. + */ + @JsonProperty(value = "vpnConnectionIds") + private List vpnConnectionIds; + + /** + * Get the vpnConnectionIds property: List of p2s vpn connection Ids. + * + * @return the vpnConnectionIds value. + */ + public List vpnConnectionIds() { + return this.vpnConnectionIds; + } + + /** + * Set the vpnConnectionIds property: List of p2s vpn connection Ids. + * + * @param vpnConnectionIds the vpnConnectionIds value to set. + * @return the P2SVpnConnectionRequest object itself. + */ + public P2SVpnConnectionRequest withVpnConnectionIds(List vpnConnectionIds) { + this.vpnConnectionIds = vpnConnectionIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateway.java new file mode 100644 index 0000000000000..1939b4c8442fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateway.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.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of P2SVpnGateway. */ +public interface P2SVpnGateway { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the virtualHub property: The VirtualHub to which the gateway belongs. + * + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * Gets the p2SConnectionConfigurations property: List of all p2s connection configurations of the gateway. + * + * @return the p2SConnectionConfigurations value. + */ + List p2SConnectionConfigurations(); + + /** + * Gets the provisioningState property: The provisioning state of the P2S VPN gateway resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway. + * + * @return the vpnGatewayScaleUnit value. + */ + Integer vpnGatewayScaleUnit(); + + /** + * Gets the vpnServerConfiguration property: The VpnServerConfiguration to which the p2sVpnGateway is attached to. + * + * @return the vpnServerConfiguration value. + */ + SubResource vpnServerConfiguration(); + + /** + * Gets the vpnClientConnectionHealth property: All P2S VPN clients' connection health status. + * + * @return the vpnClientConnectionHealth value. + */ + VpnClientConnectionHealth vpnClientConnectionHealth(); + + /** + * Gets the customDnsServers property: List of all customer specified DNS servers IP addresses. + * + * @return the customDnsServers value. + */ + List customDnsServers(); + + /** + * Gets the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP Interface of + * the P2SVpnGateway. + * + * @return the isRoutingPreferenceInternet value. + */ + Boolean isRoutingPreferenceInternet(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.P2SVpnGatewayInner object. + * + * @return the inner object. + */ + P2SVpnGatewayInner innerModel(); + + /** The entirety of the P2SVpnGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The P2SVpnGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the P2SVpnGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the P2SVpnGateway 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 P2SVpnGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the P2SVpnGateway 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.WithVirtualHub, + DefinitionStages.WithP2SConnectionConfigurations, + DefinitionStages.WithVpnGatewayScaleUnit, + DefinitionStages.WithVpnServerConfiguration, + DefinitionStages.WithCustomDnsServers, + DefinitionStages.WithIsRoutingPreferenceInternet { + /** + * Executes the create request. + * + * @return the created resource. + */ + P2SVpnGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + P2SVpnGateway create(Context context); + } + /** The stage of the P2SVpnGateway 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 P2SVpnGateway definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The VirtualHub to which the gateway belongs.. + * + * @param virtualHub The VirtualHub to which the gateway belongs. + * @return the next definition stage. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + /** The stage of the P2SVpnGateway definition allowing to specify p2SConnectionConfigurations. */ + interface WithP2SConnectionConfigurations { + /** + * Specifies the p2SConnectionConfigurations property: List of all p2s connection configurations of the + * gateway.. + * + * @param p2SConnectionConfigurations List of all p2s connection configurations of the gateway. + * @return the next definition stage. + */ + WithCreate withP2SConnectionConfigurations(List p2SConnectionConfigurations); + } + /** The stage of the P2SVpnGateway definition allowing to specify vpnGatewayScaleUnit. */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway.. + * + * @param vpnGatewayScaleUnit The scale unit for this p2s vpn gateway. + * @return the next definition stage. + */ + WithCreate withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + /** The stage of the P2SVpnGateway definition allowing to specify vpnServerConfiguration. */ + interface WithVpnServerConfiguration { + /** + * Specifies the vpnServerConfiguration property: The VpnServerConfiguration to which the p2sVpnGateway is + * attached to.. + * + * @param vpnServerConfiguration The VpnServerConfiguration to which the p2sVpnGateway is attached to. + * @return the next definition stage. + */ + WithCreate withVpnServerConfiguration(SubResource vpnServerConfiguration); + } + /** The stage of the P2SVpnGateway definition allowing to specify customDnsServers. */ + interface WithCustomDnsServers { + /** + * Specifies the customDnsServers property: List of all customer specified DNS servers IP addresses.. + * + * @param customDnsServers List of all customer specified DNS servers IP addresses. + * @return the next definition stage. + */ + WithCreate withCustomDnsServers(List customDnsServers); + } + /** The stage of the P2SVpnGateway definition allowing to specify isRoutingPreferenceInternet. */ + interface WithIsRoutingPreferenceInternet { + /** + * Specifies the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP + * Interface of the P2SVpnGateway.. + * + * @param isRoutingPreferenceInternet Enable Routing Preference property for the Public IP Interface of the + * P2SVpnGateway. + * @return the next definition stage. + */ + WithCreate withIsRoutingPreferenceInternet(Boolean isRoutingPreferenceInternet); + } + } + /** + * Begins update for the P2SVpnGateway resource. + * + * @return the stage of resource update. + */ + P2SVpnGateway.Update update(); + + /** The template for P2SVpnGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + P2SVpnGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + P2SVpnGateway apply(Context context); + } + /** The P2SVpnGateway update stages. */ + interface UpdateStages { + /** The stage of the P2SVpnGateway 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + P2SVpnGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + P2SVpnGateway refresh(Context context); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + P2SVpnGateway reset(); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource 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 p2SVpnGateway Resource. + */ + P2SVpnGateway reset(Context context); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generateVpnProfile(P2SVpnProfileParameters parameters); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generateVpnProfile(P2SVpnProfileParameters parameters, Context context); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + P2SVpnGateway getP2SVpnConnectionHealth(); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource 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 the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + P2SVpnGateway getP2SVpnConnectionHealth(Context context); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed(P2SVpnConnectionHealthRequest request); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed(P2SVpnConnectionHealthRequest request, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateways.java new file mode 100644 index 0000000000000..d90b7fd577f6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateways.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 P2SVpnGateways. */ +public interface P2SVpnGateways { + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + P2SVpnGateway getByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, Context context); + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + PagedIterable list(); + + /** + * Lists all the P2SVpnGateways 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 result of the request to list P2SVpnGateways. + */ + PagedIterable list(Context context); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + P2SVpnGateway reset(String resourceGroupName, String gatewayName); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + P2SVpnGateway reset(String resourceGroupName, String gatewayName, Context context); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName, Context context); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context); + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request); + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context); + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @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 p2SVpnGateway Resource. + */ + P2SVpnGateway getById(String id); + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @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 p2SVpnGateway Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @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 P2SVpnGateway resource. + * + * @param name resource name. + * @return the first stage of the new P2SVpnGateway definition. + */ + P2SVpnGateway.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnProfileParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnProfileParameters.java new file mode 100644 index 0000000000000..bd541a89b794a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnProfileParameters.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.network.generated.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; + +/** Vpn Client Parameters for package generation. */ +@Fluent +public final class P2SVpnProfileParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnProfileParameters.class); + + /* + * VPN client authentication method. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** + * Get the authenticationMethod property: VPN client authentication method. + * + * @return the authenticationMethod value. + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: VPN client authentication method. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the P2SVpnProfileParameters object itself. + */ + public P2SVpnProfileParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCapture.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCapture.java new file mode 100644 index 0000000000000..9abf2b60cc331 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCapture.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters that define the create packet capture operation. */ +@JsonFlatten +@Fluent +public class PacketCapture { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCapture.class); + + /* + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target", required = true) + private String target; + + /* + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Long bytesToCapturePerPacket; + + /* + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Long totalBytesPerSession; + + /* + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /* + * The storage location for a packet capture session. + */ + @JsonProperty(value = "properties.storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /* + * A list of packet capture filters. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * Get the target property: The ID of the targeted resource, only VM is currently supported. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value. + */ + public Long bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withBytesToCapturePerPacket(Long bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get the totalBytesPerSession property: Maximum size of the capture output. + * + * @return the totalBytesPerSession value. + */ + public Long totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set the totalBytesPerSession property: Maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withTotalBytesPerSession(Long totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value. + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation property: The storage location for a packet capture session. + * + * @return the storageLocation value. + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation property: The storage location for a packet capture session. + * + * @param storageLocation the storageLocation value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters property: A list of packet capture filters. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: A list of packet capture filters. + * + * @param filters the filters value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property target in model PacketCapture")); + } + if (storageLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property storageLocation in model PacketCapture")); + } else { + storageLocation().validate(); + } + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureFilter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureFilter.java new file mode 100644 index 0000000000000..713df1d5ec75c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureFilter.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.network.generated.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; + +/** Filter that is applied to packet capture request. Multiple filters can be applied. */ +@Fluent +public final class PacketCaptureFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureFilter.class); + + /* + * Protocol to be filtered on. + */ + @JsonProperty(value = "protocol") + private PcProtocol protocol; + + /* + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "localIPAddress") + private String localIpAddress; + + /* + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "remoteIPAddress") + private String remoteIpAddress; + + /* + * Local port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "localPort") + private String localPort; + + /* + * Remote port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "remotePort") + private String remotePort; + + /** + * Get the protocol property: Protocol to be filtered on. + * + * @return the protocol value. + */ + public PcProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol to be filtered on. + * + * @param protocol the protocol value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withProtocol(PcProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the localIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address + * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the localIpAddress value. + */ + public String localIpAddress() { + return this.localIpAddress; + } + + /** + * Set the localIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address + * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param localIpAddress the localIpAddress value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalIpAddress(String localIpAddress) { + this.localIpAddress = localIpAddress; + return this; + } + + /** + * Get the remoteIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address + * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the remoteIpAddress value. + */ + public String remoteIpAddress() { + return this.remoteIpAddress; + } + + /** + * Set the remoteIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address + * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param remoteIpAddress the remoteIpAddress value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemoteIpAddress(String remoteIpAddress) { + this.remoteIpAddress = remoteIpAddress; + return this; + } + + /** + * Get the localPort property: Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. + * "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + * + * @return the localPort value. + */ + public String localPort() { + return this.localPort; + } + + /** + * Set the localPort property: Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. + * "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + * + * @param localPort the localPort value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get the remotePort property: Remote port to be filtered on. Notation: "80" for single port entry."80-85" for + * range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple + * entries not currently supported. Default = null. + * + * @return the remotePort value. + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set the remotePort property: Remote port to be filtered on. Notation: "80" for single port entry."80-85" for + * range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple + * entries not currently supported. Default = null. + * + * @param remotePort the remotePort value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureListResult.java new file mode 100644 index 0000000000000..2aa88ccbe49be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of packet capture sessions. */ +@Fluent +public final class PacketCaptureListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureListResult.class); + + /* + * Information about packet capture sessions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Information about packet capture sessions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about packet capture sessions. + * + * @param value the value value to set. + * @return the PacketCaptureListResult object itself. + */ + public PacketCaptureListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureParameters.java new file mode 100644 index 0000000000000..b80d993885c1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureParameters.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters that define the create packet capture operation. */ +@Fluent +public class PacketCaptureParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureParameters.class); + + /* + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "target", required = true) + private String target; + + /* + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "bytesToCapturePerPacket") + private Long bytesToCapturePerPacket; + + /* + * Maximum size of the capture output. + */ + @JsonProperty(value = "totalBytesPerSession") + private Long totalBytesPerSession; + + /* + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /* + * The storage location for a packet capture session. + */ + @JsonProperty(value = "storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /* + * A list of packet capture filters. + */ + @JsonProperty(value = "filters") + private List filters; + + /** + * Get the target property: The ID of the targeted resource, only VM is currently supported. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value. + */ + public Long bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withBytesToCapturePerPacket(Long bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get the totalBytesPerSession property: Maximum size of the capture output. + * + * @return the totalBytesPerSession value. + */ + public Long totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set the totalBytesPerSession property: Maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTotalBytesPerSession(Long totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value. + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation property: The storage location for a packet capture session. + * + * @return the storageLocation value. + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation property: The storage location for a packet capture session. + * + * @param storageLocation the storageLocation value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters property: A list of packet capture filters. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: A list of packet capture filters. + * + * @param filters the filters value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property target in model PacketCaptureParameters")); + } + if (storageLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageLocation in model PacketCaptureParameters")); + } else { + storageLocation().validate(); + } + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureQueryStatusResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureQueryStatusResult.java new file mode 100644 index 0000000000000..9fd00564615d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureQueryStatusResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of PacketCaptureQueryStatusResult. */ +public interface PacketCaptureQueryStatusResult { + /** + * Gets the name property: The name of the packet capture resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ID of the packet capture resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the captureStartTime property: The start time of the packet capture session. + * + * @return the captureStartTime value. + */ + OffsetDateTime captureStartTime(); + + /** + * Gets the packetCaptureStatus property: The status of the packet capture session. + * + * @return the packetCaptureStatus value. + */ + PcStatus packetCaptureStatus(); + + /** + * Gets the stopReason property: The reason the current packet capture session was stopped. + * + * @return the stopReason value. + */ + String stopReason(); + + /** + * Gets the packetCaptureError property: List of errors of packet capture session. + * + * @return the packetCaptureError value. + */ + List packetCaptureError(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner + * object. + * + * @return the inner object. + */ + PacketCaptureQueryStatusResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResult.java new file mode 100644 index 0000000000000..f96136f123a8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import java.util.List; + +/** An immutable client-side representation of PacketCaptureResult. */ +public interface PacketCaptureResult { + /** + * Gets the name property: Name of the packet capture session. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: ID of the packet capture operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the target property: The ID of the targeted resource, only VM is currently supported. + * + * @return the target value. + */ + String target(); + + /** + * Gets the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are + * truncated. + * + * @return the bytesToCapturePerPacket value. + */ + Long bytesToCapturePerPacket(); + + /** + * Gets the totalBytesPerSession property: Maximum size of the capture output. + * + * @return the totalBytesPerSession value. + */ + Long totalBytesPerSession(); + + /** + * Gets the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value. + */ + Integer timeLimitInSeconds(); + + /** + * Gets the storageLocation property: The storage location for a packet capture session. + * + * @return the storageLocation value. + */ + PacketCaptureStorageLocation storageLocation(); + + /** + * Gets the filters property: A list of packet capture filters. + * + * @return the filters value. + */ + List filters(); + + /** + * Gets the provisioningState property: The provisioning state of the packet capture session. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner object. + * + * @return the inner object. + */ + PacketCaptureResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResultProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResultProperties.java new file mode 100644 index 0000000000000..85bc4c8826f66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResultProperties.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.network.generated.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 packet capture session. */ +@Fluent +public final class PacketCaptureResultProperties extends PacketCaptureParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureResultProperties.class); + + /* + * The provisioning state of the packet capture session. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the provisioningState property: The provisioning state of the packet capture session. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withBytesToCapturePerPacket(Long bytesToCapturePerPacket) { + super.withBytesToCapturePerPacket(bytesToCapturePerPacket); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withTotalBytesPerSession(Long totalBytesPerSession) { + super.withTotalBytesPerSession(totalBytesPerSession); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withTimeLimitInSeconds(Integer timeLimitInSeconds) { + super.withTimeLimitInSeconds(timeLimitInSeconds); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withStorageLocation(PacketCaptureStorageLocation storageLocation) { + super.withStorageLocation(storageLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withFilters(List filters) { + super.withFilters(filters); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureStorageLocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureStorageLocation.java new file mode 100644 index 0000000000000..402b05996f419 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureStorageLocation.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 storage location for a packet capture session. */ +@Fluent +public final class PacketCaptureStorageLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureStorageLocation.class); + + /* + * The ID of the storage account to save the packet capture session. + * Required if no local file path is provided. + */ + @JsonProperty(value = "storageId") + private String storageId; + + /* + * The URI of the storage path to save the packet capture. Must be a + * well-formed URI describing the location to save the packet capture. + */ + @JsonProperty(value = "storagePath") + private String storagePath; + + /* + * A valid local path on the targeting VM. Must include the name of the + * capture file (*.cap). For linux virtual machine it must start with + * /var/captures. Required if no storage ID is provided, otherwise + * optional. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * Get the storageId property: The ID of the storage account to save the packet capture session. Required if no + * local file path is provided. + * + * @return the storageId value. + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the storageId property: The ID of the storage account to save the packet capture session. Required if no + * local file path is provided. + * + * @param storageId the storageId value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the storagePath property: The URI of the storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @return the storagePath value. + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the storagePath property: The URI of the storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param storagePath the storagePath value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + + /** + * Get the filePath property: A valid local path on the targeting VM. Must include the name of the capture file + * (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, + * otherwise optional. + * + * @return the filePath value. + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the filePath property: A valid local path on the targeting VM. Must include the name of the capture file + * (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, + * otherwise optional. + * + * @param filePath the filePath value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptures.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptures.java new file mode 100644 index 0000000000000..31596e60075d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptures.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 PacketCaptures. */ +public interface PacketCaptures { + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + PacketCaptureResult create( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters); + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + PacketCaptureResult create( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + PacketCaptureResult get(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkWatcherName, String packetCaptureName); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkWatcherName, String packetCaptureName, Context context); + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + PacketCaptureQueryStatusResult getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + PacketCaptureQueryStatusResult getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcError.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcError.java new file mode 100644 index 0000000000000..c61081392c247 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcError.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PcError. */ +public final class PcError extends ExpandableStringEnum { + /** Static value InternalError for PcError. */ + public static final PcError INTERNAL_ERROR = fromString("InternalError"); + + /** Static value AgentStopped for PcError. */ + public static final PcError AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value CaptureFailed for PcError. */ + public static final PcError CAPTURE_FAILED = fromString("CaptureFailed"); + + /** Static value LocalFileFailed for PcError. */ + public static final PcError LOCAL_FILE_FAILED = fromString("LocalFileFailed"); + + /** Static value StorageFailed for PcError. */ + public static final PcError STORAGE_FAILED = fromString("StorageFailed"); + + /** + * Creates or finds a PcError from its string representation. + * + * @param name a name to look for. + * @return the corresponding PcError. + */ + @JsonCreator + public static PcError fromString(String name) { + return fromString(name, PcError.class); + } + + /** @return known PcError values. */ + public static Collection values() { + return values(PcError.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcProtocol.java new file mode 100644 index 0000000000000..8e4a7c8b09171 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PcProtocol. */ +public final class PcProtocol extends ExpandableStringEnum { + /** Static value TCP for PcProtocol. */ + public static final PcProtocol TCP = fromString("TCP"); + + /** Static value UDP for PcProtocol. */ + public static final PcProtocol UDP = fromString("UDP"); + + /** Static value Any for PcProtocol. */ + public static final PcProtocol ANY = fromString("Any"); + + /** + * Creates or finds a PcProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding PcProtocol. + */ + @JsonCreator + public static PcProtocol fromString(String name) { + return fromString(name, PcProtocol.class); + } + + /** @return known PcProtocol values. */ + public static Collection values() { + return values(PcProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcStatus.java new file mode 100644 index 0000000000000..eb57e996202cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcStatus.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PcStatus. */ +public final class PcStatus extends ExpandableStringEnum { + /** Static value NotStarted for PcStatus. */ + public static final PcStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value Running for PcStatus. */ + public static final PcStatus RUNNING = fromString("Running"); + + /** Static value Stopped for PcStatus. */ + public static final PcStatus STOPPED = fromString("Stopped"); + + /** Static value Error for PcStatus. */ + public static final PcStatus ERROR = fromString("Error"); + + /** Static value Unknown for PcStatus. */ + public static final PcStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a PcStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PcStatus. + */ + @JsonCreator + public static PcStatus fromString(String name) { + return fromString(name, PcStatus.class); + } + + /** @return known PcStatus values. */ + public static Collection values() { + return values(PcStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnection.java new file mode 100644 index 0000000000000..60c7ab60a7e1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnection.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; + +/** An immutable client-side representation of PeerExpressRouteCircuitConnection. */ +public interface PeerExpressRouteCircuitConnection { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit. + * + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * Gets the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of + * the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * Gets the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * Gets the connectionName property: The name of the express route circuit connection resource. + * + * @return the connectionName value. + */ + String connectionName(); + + /** + * Gets the authResourceGuid property: The resource guid of the authorization used for the express route circuit + * connection. + * + * @return the authResourceGuid value. + */ + String authResourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the peer express route circuit connection + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner + * object. + * + * @return the inner object. + */ + PeerExpressRouteCircuitConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java new file mode 100644 index 0000000000000..03d8940c2878f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListPeeredConnections API service call retrieves all global reach peer circuit connections that belongs + * to a Private Peering for an ExpressRouteCircuit. + */ +@Fluent +public final class PeerExpressRouteCircuitConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerExpressRouteCircuitConnectionListResult.class); + + /* + * The global reach peer circuit connection associated with Private Peering + * in an ExpressRoute Circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The global reach peer circuit connection associated with Private Peering in an + * ExpressRoute Circuit. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The global reach peer circuit connection associated with Private Peering in an + * ExpressRoute Circuit. + * + * @param value the value value to set. + * @return the PeerExpressRouteCircuitConnectionListResult object itself. + */ + public PeerExpressRouteCircuitConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the PeerExpressRouteCircuitConnectionListResult object itself. + */ + public PeerExpressRouteCircuitConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnections.java new file mode 100644 index 0000000000000..f76c0a4885010 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnections.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 PeerExpressRouteCircuitConnections. */ +public interface PeerExpressRouteCircuitConnections { + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + PeerExpressRouteCircuitConnection get( + String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRoute.java new file mode 100644 index 0000000000000..91f2e917d1a52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRoute.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Peer routing details. */ +@Immutable +public final class PeerRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerRoute.class); + + /* + * The peer's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /* + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /* + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /* + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /* + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /* + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** + * Get the localAddress property: The peer's local address. + * + * @return the localAddress value. + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the network property: The route's network prefix. + * + * @return the network value. + */ + public String network() { + return this.network; + } + + /** + * Get the nextHop property: The route's next hop. + * + * @return the nextHop value. + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Get the sourcePeer property: The peer this route was learned from. + * + * @return the sourcePeer value. + */ + public String sourcePeer() { + return this.sourcePeer; + } + + /** + * Get the origin property: The source this route was learned from. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the asPath property: The route's AS path sequence. + * + * @return the asPath value. + */ + public String asPath() { + return this.asPath; + } + + /** + * Get the weight property: The route's weight. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java new file mode 100644 index 0000000000000..921e0847e98c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import java.util.List; + +/** An immutable client-side representation of PeerRouteList. */ +public interface PeerRouteList { + /** + * Gets the value property: List of peer routes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner object. + * + * @return the inner object. + */ + PeerRouteListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.java new file mode 100644 index 0000000000000..3a701cbc9db5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PfsGroup. */ +public final class PfsGroup extends ExpandableStringEnum { + /** Static value None for PfsGroup. */ + public static final PfsGroup NONE = fromString("None"); + + /** Static value PFS1 for PfsGroup. */ + public static final PfsGroup PFS1 = fromString("PFS1"); + + /** Static value PFS2 for PfsGroup. */ + public static final PfsGroup PFS2 = fromString("PFS2"); + + /** Static value PFS2048 for PfsGroup. */ + public static final PfsGroup PFS2048 = fromString("PFS2048"); + + /** Static value ECP256 for PfsGroup. */ + public static final PfsGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for PfsGroup. */ + public static final PfsGroup ECP384 = fromString("ECP384"); + + /** Static value PFS24 for PfsGroup. */ + public static final PfsGroup PFS24 = fromString("PFS24"); + + /** Static value PFS14 for PfsGroup. */ + public static final PfsGroup PFS14 = fromString("PFS14"); + + /** Static value PFSMM for PfsGroup. */ + public static final PfsGroup PFSMM = fromString("PFSMM"); + + /** + * Creates or finds a PfsGroup from its string representation. + * + * @param name a name to look for. + * @return the corresponding PfsGroup. + */ + @JsonCreator + public static PfsGroup fromString(String name) { + return fromString(name, PfsGroup.class); + } + + /** @return known PfsGroup values. */ + public static Collection values() { + return values(PfsGroup.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.java new file mode 100644 index 0000000000000..dfad614fd5c5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Defines contents of a web application firewall global configuration. */ +@Fluent +public final class PolicySettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicySettings.class); + + /* + * The state of the policy. + */ + @JsonProperty(value = "state") + private WebApplicationFirewallEnabledState state; + + /* + * The mode of the policy. + */ + @JsonProperty(value = "mode") + private WebApplicationFirewallMode mode; + + /* + * Whether to allow WAF to check request Body. + */ + @JsonProperty(value = "requestBodyCheck") + private Boolean requestBodyCheck; + + /* + * Maximum request body size in Kb for WAF. + */ + @JsonProperty(value = "maxRequestBodySizeInKb") + private Integer maxRequestBodySizeInKb; + + /* + * Maximum file upload size in Mb for WAF. + */ + @JsonProperty(value = "fileUploadLimitInMb") + private Integer fileUploadLimitInMb; + + /** + * Get the state property: The state of the policy. + * + * @return the state value. + */ + public WebApplicationFirewallEnabledState state() { + return this.state; + } + + /** + * Set the state property: The state of the policy. + * + * @param state the state value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withState(WebApplicationFirewallEnabledState state) { + this.state = state; + return this; + } + + /** + * Get the mode property: The mode of the policy. + * + * @return the mode value. + */ + public WebApplicationFirewallMode mode() { + return this.mode; + } + + /** + * Set the mode property: The mode of the policy. + * + * @param mode the mode value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withMode(WebApplicationFirewallMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the requestBodyCheck property: Whether to allow WAF to check request Body. + * + * @return the requestBodyCheck value. + */ + public Boolean requestBodyCheck() { + return this.requestBodyCheck; + } + + /** + * Set the requestBodyCheck property: Whether to allow WAF to check request Body. + * + * @param requestBodyCheck the requestBodyCheck value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withRequestBodyCheck(Boolean requestBodyCheck) { + this.requestBodyCheck = requestBodyCheck; + return this; + } + + /** + * Get the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @return the maxRequestBodySizeInKb value. + */ + public Integer maxRequestBodySizeInKb() { + return this.maxRequestBodySizeInKb; + } + + /** + * Set the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @param maxRequestBodySizeInKb the maxRequestBodySizeInKb value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withMaxRequestBodySizeInKb(Integer maxRequestBodySizeInKb) { + this.maxRequestBodySizeInKb = maxRequestBodySizeInKb; + return this; + } + + /** + * Get the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @return the fileUploadLimitInMb value. + */ + public Integer fileUploadLimitInMb() { + return this.fileUploadLimitInMb; + } + + /** + * Set the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @param fileUploadLimitInMb the fileUploadLimitInMb value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withFileUploadLimitInMb(Integer fileUploadLimitInMb) { + this.fileUploadLimitInMb = fileUploadLimitInMb; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java new file mode 100644 index 0000000000000..eb357189f4b2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PreferredIpVersion. */ +public final class PreferredIpVersion extends ExpandableStringEnum { + /** Static value IPv4 for PreferredIpVersion. */ + public static final PreferredIpVersion IPV4 = fromString("IPv4"); + + /** Static value IPv6 for PreferredIpVersion. */ + public static final PreferredIpVersion IPV6 = fromString("IPv6"); + + /** + * Creates or finds a PreferredIpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreferredIpVersion. + */ + @JsonCreator + public static PreferredIpVersion fromString(String name) { + return fromString(name, PreferredIpVersion.class); + } + + /** @return known PreferredIpVersion values. */ + public static Collection values() { + return values(PreferredIpVersion.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.java new file mode 100644 index 0000000000000..68b8a9c89a2fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PreferredRoutingGateway. */ +public final class PreferredRoutingGateway extends ExpandableStringEnum { + /** Static value ExpressRoute for PreferredRoutingGateway. */ + public static final PreferredRoutingGateway EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** Static value VpnGateway for PreferredRoutingGateway. */ + public static final PreferredRoutingGateway VPN_GATEWAY = fromString("VpnGateway"); + + /** Static value None for PreferredRoutingGateway. */ + public static final PreferredRoutingGateway NONE = fromString("None"); + + /** + * Creates or finds a PreferredRoutingGateway from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreferredRoutingGateway. + */ + @JsonCreator + public static PreferredRoutingGateway fromString(String name) { + return fromString(name, PreferredRoutingGateway.class); + } + + /** @return known PreferredRoutingGateway values. */ + public static Collection values() { + return values(PreferredRoutingGateway.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.java new file mode 100644 index 0000000000000..a03604d63422d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Details of PrepareNetworkPolicies for Subnet. */ +@Fluent +public final class PrepareNetworkPoliciesRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrepareNetworkPoliciesRequest.class); + + /* + * The name of the service for which subnet is being prepared for. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /* + * A list of NetworkIntentPolicyConfiguration. + */ + @JsonProperty(value = "networkIntentPolicyConfigurations") + private List networkIntentPolicyConfigurations; + + /** + * Get the serviceName property: The name of the service for which subnet is being prepared for. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the service for which subnet is being prepared for. + * + * @param serviceName the serviceName value to set. + * @return the PrepareNetworkPoliciesRequest object itself. + */ + public PrepareNetworkPoliciesRequest withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the networkIntentPolicyConfigurations property: A list of NetworkIntentPolicyConfiguration. + * + * @return the networkIntentPolicyConfigurations value. + */ + public List networkIntentPolicyConfigurations() { + return this.networkIntentPolicyConfigurations; + } + + /** + * Set the networkIntentPolicyConfigurations property: A list of NetworkIntentPolicyConfiguration. + * + * @param networkIntentPolicyConfigurations the networkIntentPolicyConfigurations value to set. + * @return the PrepareNetworkPoliciesRequest object itself. + */ + public PrepareNetworkPoliciesRequest withNetworkIntentPolicyConfigurations( + List networkIntentPolicyConfigurations) { + this.networkIntentPolicyConfigurations = networkIntentPolicyConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkIntentPolicyConfigurations() != null) { + networkIntentPolicyConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.java new file mode 100644 index 0000000000000..aeef0fffed09a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.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.network.generated.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; + +/** PrivateDnsZoneConfig resource. */ +@JsonFlatten +@Fluent +public class PrivateDnsZoneConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZoneConfig.class); + + /* + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource id of the private dns zone. + */ + @JsonProperty(value = "properties.privateDnsZoneId") + private String privateDnsZoneId; + + /* + * A collection of information regarding a recordSet, holding information + * to identify private resources. + */ + @JsonProperty(value = "properties.recordSets", access = JsonProperty.Access.WRITE_ONLY) + private List recordSets; + + /** + * Get the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the PrivateDnsZoneConfig object itself. + */ + public PrivateDnsZoneConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get the privateDnsZoneId property: The resource id of the private dns zone. + * + * @return the privateDnsZoneId value. + */ + public String privateDnsZoneId() { + return this.privateDnsZoneId; + } + + /** + * Set the privateDnsZoneId property: The resource id of the private dns zone. + * + * @param privateDnsZoneId the privateDnsZoneId value to set. + * @return the PrivateDnsZoneConfig object itself. + */ + public PrivateDnsZoneConfig withPrivateDnsZoneId(String privateDnsZoneId) { + this.privateDnsZoneId = privateDnsZoneId; + return this; + } + + /** + * Get the recordSets property: A collection of information regarding a recordSet, holding information to identify + * private resources. + * + * @return the recordSets value. + */ + public List recordSets() { + return this.recordSets; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recordSets() != null) { + recordSets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroup.java new file mode 100644 index 0000000000000..d29875f57f9cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroup.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import java.util.List; + +/** An immutable client-side representation of PrivateDnsZoneGroup. */ +public interface PrivateDnsZoneGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the provisioningState property: The provisioning state of the private dns zone group resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateDnsZoneConfigs property: A collection of private dns zone configurations of the private dns zone + * group. + * + * @return the privateDnsZoneConfigs value. + */ + List privateDnsZoneConfigs(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner object. + * + * @return the inner object. + */ + PrivateDnsZoneGroupInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.java new file mode 100644 index 0000000000000..e179eb63729ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateDnsZoneGroups API service call. */ +@Fluent +public final class PrivateDnsZoneGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZoneGroupListResult.class); + + /* + * A list of private dns zone group resources in a private endpoint. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of private dns zone group resources in a private endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of private dns zone group resources in a private endpoint. + * + * @param value the value value to set. + * @return the PrivateDnsZoneGroupListResult object itself. + */ + public PrivateDnsZoneGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.java new file mode 100644 index 0000000000000..38dcb1541ca33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; + +/** Resource collection API of PrivateDnsZoneGroups. */ +public interface PrivateDnsZoneGroups { + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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. + */ + void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName); + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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. + */ + void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context); + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the private dns zone group resource by specified private dns zone group name. + */ + PrivateDnsZoneGroup get(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName); + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone 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 the private dns zone group resource by specified private dns zone group name. + */ + Response getWithResponse( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context); + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + PrivateDnsZoneGroup createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters); + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + PrivateDnsZoneGroup createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context); + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + PagedIterable list(String privateEndpointName, String resourceGroupName); + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + PagedIterable list(String privateEndpointName, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..db04e881b5f74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PrivateEndpoint. */ +public interface PrivateEndpoint { + /** + * 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 extendedLocation property: The extended location of the load balancer. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the subnet property: The ID of the subnet from which the private IP will be allocated. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the networkInterfaces property: An array of references to the network interfaces created for this private + * endpoint. + * + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateLinkServiceConnections property: A grouping of information about the connection to the remote + * resource. + * + * @return the privateLinkServiceConnections value. + */ + List privateLinkServiceConnections(); + + /** + * Gets the manualPrivateLinkServiceConnections property: A grouping of information about the connection to the + * remote resource. Used when the network admin does not have access to approve connections to the remote resource. + * + * @return the manualPrivateLinkServiceConnections value. + */ + List manualPrivateLinkServiceConnections(); + + /** + * Gets the customDnsConfigs property: An array of custom dns configurations. + * + * @return the customDnsConfigs value. + */ + List customDnsConfigs(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.PrivateEndpointInner object. + * + * @return the inner object. + */ + PrivateEndpointInner innerModel(); + + /** The entirety of the PrivateEndpoint definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PrivateEndpoint definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpoint definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PrivateEndpoint 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 PrivateEndpoint definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PrivateEndpoint 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.WithExtendedLocation, + DefinitionStages.WithSubnet, + DefinitionStages.WithPrivateLinkServiceConnections, + DefinitionStages.WithManualPrivateLinkServiceConnections, + DefinitionStages.WithCustomDnsConfigs { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpoint create(Context context); + } + /** The stage of the PrivateEndpoint 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 PrivateEndpoint definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the load balancer.. + * + * @param extendedLocation The extended location of the load balancer. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PrivateEndpoint definition allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: The ID of the subnet from which the private IP will be allocated.. + * + * @param subnet The ID of the subnet from which the private IP will be allocated. + * @return the next definition stage. + */ + WithCreate withSubnet(SubnetInner subnet); + } + /** The stage of the PrivateEndpoint definition allowing to specify privateLinkServiceConnections. */ + interface WithPrivateLinkServiceConnections { + /** + * Specifies the privateLinkServiceConnections property: A grouping of information about the connection to + * the remote resource.. + * + * @param privateLinkServiceConnections A grouping of information about the connection to the remote + * resource. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnections( + List privateLinkServiceConnections); + } + /** The stage of the PrivateEndpoint definition allowing to specify manualPrivateLinkServiceConnections. */ + interface WithManualPrivateLinkServiceConnections { + /** + * Specifies the manualPrivateLinkServiceConnections property: A grouping of information about the + * connection to the remote resource. Used when the network admin does not have access to approve + * connections to the remote resource.. + * + * @param manualPrivateLinkServiceConnections A grouping of information about the connection to the remote + * resource. Used when the network admin does not have access to approve connections to the remote + * resource. + * @return the next definition stage. + */ + WithCreate withManualPrivateLinkServiceConnections( + List manualPrivateLinkServiceConnections); + } + /** The stage of the PrivateEndpoint definition allowing to specify customDnsConfigs. */ + interface WithCustomDnsConfigs { + /** + * Specifies the customDnsConfigs property: An array of custom dns configurations.. + * + * @param customDnsConfigs An array of custom dns configurations. + * @return the next definition stage. + */ + WithCreate withCustomDnsConfigs(List customDnsConfigs); + } + } + /** + * Begins update for the PrivateEndpoint resource. + * + * @return the stage of resource update. + */ + PrivateEndpoint.Update update(); + + /** The template for PrivateEndpoint update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithExtendedLocation, + UpdateStages.WithSubnet, + UpdateStages.WithPrivateLinkServiceConnections, + UpdateStages.WithManualPrivateLinkServiceConnections, + UpdateStages.WithCustomDnsConfigs { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpoint apply(Context context); + } + /** The PrivateEndpoint update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpoint 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 PrivateEndpoint update allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the load balancer.. + * + * @param extendedLocation The extended location of the load balancer. + * @return the next definition stage. + */ + Update withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PrivateEndpoint update allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: The ID of the subnet from which the private IP will be allocated.. + * + * @param subnet The ID of the subnet from which the private IP will be allocated. + * @return the next definition stage. + */ + Update withSubnet(SubnetInner subnet); + } + /** The stage of the PrivateEndpoint update allowing to specify privateLinkServiceConnections. */ + interface WithPrivateLinkServiceConnections { + /** + * Specifies the privateLinkServiceConnections property: A grouping of information about the connection to + * the remote resource.. + * + * @param privateLinkServiceConnections A grouping of information about the connection to the remote + * resource. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnections(List privateLinkServiceConnections); + } + /** The stage of the PrivateEndpoint update allowing to specify manualPrivateLinkServiceConnections. */ + interface WithManualPrivateLinkServiceConnections { + /** + * Specifies the manualPrivateLinkServiceConnections property: A grouping of information about the + * connection to the remote resource. Used when the network admin does not have access to approve + * connections to the remote resource.. + * + * @param manualPrivateLinkServiceConnections A grouping of information about the connection to the remote + * resource. Used when the network admin does not have access to approve connections to the remote + * resource. + * @return the next definition stage. + */ + Update withManualPrivateLinkServiceConnections( + List manualPrivateLinkServiceConnections); + } + /** The stage of the PrivateEndpoint update allowing to specify customDnsConfigs. */ + interface WithCustomDnsConfigs { + /** + * Specifies the customDnsConfigs property: An array of custom dns configurations.. + * + * @param customDnsConfigs An array of custom dns configurations. + * @return the next definition stage. + */ + Update withCustomDnsConfigs(List customDnsConfigs); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpoint refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..55185c0112a15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the linkIdentifier property: The consumer link id. + * + * @return the linkIdentifier value. + */ + String linkIdentifier(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..40159279d4b0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateEndpointConnection API service call. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * A list of PrivateEndpointConnection resources for a specific private + * link service. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of PrivateEndpointConnection resources for a specific private link service. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of PrivateEndpointConnection resources for a specific private link service. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointListResult.java new file mode 100644 index 0000000000000..fe7bf8b71993d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateEndpoints API service call. */ +@Fluent +public final class PrivateEndpointListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointListResult.class); + + /* + * A list of private endpoint resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of private endpoint resources in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of private endpoint resources in a resource group. + * + * @param value the value value to set. + * @return the PrivateEndpointListResult object itself. + */ + public PrivateEndpointListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoints.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoints.java new file mode 100644 index 0000000000000..4d8f7c58ea346 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoints.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 PrivateEndpoints. */ +public interface PrivateEndpoints { + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 privateEndpointName); + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 privateEndpointName, Context context); + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + PrivateEndpoint getByResourceGroup(String resourceGroupName, String privateEndpointName); + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateEndpointName, String expand, Context context); + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all private endpoints in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + PagedIterable list(); + + /** + * Gets all private endpoints in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified private endpoint by resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + PrivateEndpoint getById(String id); + + /** + * Gets the specified private endpoint by resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified private endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified private endpoint. + * + * @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.resourcemanager.network.generated.models.ErrorException 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 PrivateEndpoint resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpoint definition. + */ + PrivateEndpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkService.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkService.java new file mode 100644 index 0000000000000..78c7fcc456b77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkService.java @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PrivateLinkService. */ +public interface PrivateLinkService { + /** + * 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 extendedLocation property: The extended location of the load balancer. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the loadBalancerFrontendIpConfigurations property: An array of references to the load balancer IP + * configurations. + * + * @return the loadBalancerFrontendIpConfigurations value. + */ + List loadBalancerFrontendIpConfigurations(); + + /** + * Gets the ipConfigurations property: An array of private link service IP configurations. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the networkInterfaces property: An array of references to the network interfaces created for this private + * link service. + * + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * Gets the provisioningState property: The provisioning state of the private link service resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateEndpointConnections property: An array of list about connections to the private endpoint. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the visibility property: The visibility list of the private link service. + * + * @return the visibility value. + */ + PrivateLinkServicePropertiesVisibility visibility(); + + /** + * Gets the autoApproval property: The auto-approval list of the private link service. + * + * @return the autoApproval value. + */ + PrivateLinkServicePropertiesAutoApproval autoApproval(); + + /** + * Gets the fqdns property: The list of Fqdn. + * + * @return the fqdns value. + */ + List fqdns(); + + /** + * Gets the alias property: The alias of the private link service. + * + * @return the alias value. + */ + String alias(); + + /** + * Gets the enableProxyProtocol property: Whether the private link service is enabled for proxy protocol or not. + * + * @return the enableProxyProtocol value. + */ + Boolean enableProxyProtocol(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.PrivateLinkServiceInner object. + * + * @return the inner object. + */ + PrivateLinkServiceInner innerModel(); + + /** The entirety of the PrivateLinkService definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PrivateLinkService definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateLinkService definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PrivateLinkService 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 PrivateLinkService definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PrivateLinkService 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.WithExtendedLocation, + DefinitionStages.WithLoadBalancerFrontendIpConfigurations, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithVisibility, + DefinitionStages.WithAutoApproval, + DefinitionStages.WithFqdns, + DefinitionStages.WithEnableProxyProtocol { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateLinkService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateLinkService create(Context context); + } + /** The stage of the PrivateLinkService 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 PrivateLinkService definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the load balancer.. + * + * @param extendedLocation The extended location of the load balancer. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PrivateLinkService definition allowing to specify loadBalancerFrontendIpConfigurations. */ + interface WithLoadBalancerFrontendIpConfigurations { + /** + * Specifies the loadBalancerFrontendIpConfigurations property: An array of references to the load balancer + * IP configurations.. + * + * @param loadBalancerFrontendIpConfigurations An array of references to the load balancer IP + * configurations. + * @return the next definition stage. + */ + WithCreate withLoadBalancerFrontendIpConfigurations( + List loadBalancerFrontendIpConfigurations); + } + /** The stage of the PrivateLinkService definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: An array of private link service IP configurations.. + * + * @param ipConfigurations An array of private link service IP configurations. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the PrivateLinkService definition allowing to specify visibility. */ + interface WithVisibility { + /** + * Specifies the visibility property: The visibility list of the private link service.. + * + * @param visibility The visibility list of the private link service. + * @return the next definition stage. + */ + WithCreate withVisibility(PrivateLinkServicePropertiesVisibility visibility); + } + /** The stage of the PrivateLinkService definition allowing to specify autoApproval. */ + interface WithAutoApproval { + /** + * Specifies the autoApproval property: The auto-approval list of the private link service.. + * + * @param autoApproval The auto-approval list of the private link service. + * @return the next definition stage. + */ + WithCreate withAutoApproval(PrivateLinkServicePropertiesAutoApproval autoApproval); + } + /** The stage of the PrivateLinkService definition allowing to specify fqdns. */ + interface WithFqdns { + /** + * Specifies the fqdns property: The list of Fqdn.. + * + * @param fqdns The list of Fqdn. + * @return the next definition stage. + */ + WithCreate withFqdns(List fqdns); + } + /** The stage of the PrivateLinkService definition allowing to specify enableProxyProtocol. */ + interface WithEnableProxyProtocol { + /** + * Specifies the enableProxyProtocol property: Whether the private link service is enabled for proxy + * protocol or not.. + * + * @param enableProxyProtocol Whether the private link service is enabled for proxy protocol or not. + * @return the next definition stage. + */ + WithCreate withEnableProxyProtocol(Boolean enableProxyProtocol); + } + } + /** + * Begins update for the PrivateLinkService resource. + * + * @return the stage of resource update. + */ + PrivateLinkService.Update update(); + + /** The template for PrivateLinkService update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithExtendedLocation, + UpdateStages.WithLoadBalancerFrontendIpConfigurations, + UpdateStages.WithIpConfigurations, + UpdateStages.WithVisibility, + UpdateStages.WithAutoApproval, + UpdateStages.WithFqdns, + UpdateStages.WithEnableProxyProtocol { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateLinkService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateLinkService apply(Context context); + } + /** The PrivateLinkService update stages. */ + interface UpdateStages { + /** The stage of the PrivateLinkService 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 PrivateLinkService update allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the load balancer.. + * + * @param extendedLocation The extended location of the load balancer. + * @return the next definition stage. + */ + Update withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PrivateLinkService update allowing to specify loadBalancerFrontendIpConfigurations. */ + interface WithLoadBalancerFrontendIpConfigurations { + /** + * Specifies the loadBalancerFrontendIpConfigurations property: An array of references to the load balancer + * IP configurations.. + * + * @param loadBalancerFrontendIpConfigurations An array of references to the load balancer IP + * configurations. + * @return the next definition stage. + */ + Update withLoadBalancerFrontendIpConfigurations( + List loadBalancerFrontendIpConfigurations); + } + /** The stage of the PrivateLinkService update allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: An array of private link service IP configurations.. + * + * @param ipConfigurations An array of private link service IP configurations. + * @return the next definition stage. + */ + Update withIpConfigurations(List ipConfigurations); + } + /** The stage of the PrivateLinkService update allowing to specify visibility. */ + interface WithVisibility { + /** + * Specifies the visibility property: The visibility list of the private link service.. + * + * @param visibility The visibility list of the private link service. + * @return the next definition stage. + */ + Update withVisibility(PrivateLinkServicePropertiesVisibility visibility); + } + /** The stage of the PrivateLinkService update allowing to specify autoApproval. */ + interface WithAutoApproval { + /** + * Specifies the autoApproval property: The auto-approval list of the private link service.. + * + * @param autoApproval The auto-approval list of the private link service. + * @return the next definition stage. + */ + Update withAutoApproval(PrivateLinkServicePropertiesAutoApproval autoApproval); + } + /** The stage of the PrivateLinkService update allowing to specify fqdns. */ + interface WithFqdns { + /** + * Specifies the fqdns property: The list of Fqdn.. + * + * @param fqdns The list of Fqdn. + * @return the next definition stage. + */ + Update withFqdns(List fqdns); + } + /** The stage of the PrivateLinkService update allowing to specify enableProxyProtocol. */ + interface WithEnableProxyProtocol { + /** + * Specifies the enableProxyProtocol property: Whether the private link service is enabled for proxy + * protocol or not.. + * + * @param enableProxyProtocol Whether the private link service is enabled for proxy protocol or not. + * @return the next definition stage. + */ + Update withEnableProxyProtocol(Boolean enableProxyProtocol); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateLinkService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateLinkService refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnection.java new file mode 100644 index 0000000000000..2521647f10337 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnection.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateLinkServiceConnection resource. */ +@JsonFlatten +@Fluent +public class PrivateLinkServiceConnection extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnection.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The provisioning state of the private link service connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The resource id of private link service. + */ + @JsonProperty(value = "properties.privateLinkServiceId") + private String privateLinkServiceId; + + /* + * The ID(s) of the group(s) obtained from the remote resource that this + * private endpoint should connect to. + */ + @JsonProperty(value = "properties.groupIds") + private List groupIds; + + /* + * A message passed to the owner of the remote resource with this + * connection request. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.requestMessage") + private String requestMessage; + + /* + * A collection of read-only information about the state of the connection + * to the remote resource. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the PrivateLinkServiceConnection object itself. + */ + public PrivateLinkServiceConnection withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioningState property: The provisioning state of the private link service connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateLinkServiceId property: The resource id of private link service. + * + * @return the privateLinkServiceId value. + */ + public String privateLinkServiceId() { + return this.privateLinkServiceId; + } + + /** + * Set the privateLinkServiceId property: The resource id of private link service. + * + * @param privateLinkServiceId the privateLinkServiceId value to set. + * @return the PrivateLinkServiceConnection object itself. + */ + public PrivateLinkServiceConnection withPrivateLinkServiceId(String privateLinkServiceId) { + this.privateLinkServiceId = privateLinkServiceId; + return this; + } + + /** + * Get the groupIds property: The ID(s) of the group(s) obtained from the remote resource that this private endpoint + * should connect to. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Set the groupIds property: The ID(s) of the group(s) obtained from the remote resource that this private endpoint + * should connect to. + * + * @param groupIds the groupIds value to set. + * @return the PrivateLinkServiceConnection object itself. + */ + public PrivateLinkServiceConnection withGroupIds(List groupIds) { + this.groupIds = groupIds; + return this; + } + + /** + * Get the requestMessage property: A message passed to the owner of the remote resource with this connection + * request. Restricted to 140 chars. + * + * @return the requestMessage value. + */ + public String requestMessage() { + return this.requestMessage; + } + + /** + * Set the requestMessage property: A message passed to the owner of the remote resource with this connection + * request. Restricted to 140 chars. + * + * @param requestMessage the requestMessage value to set. + * @return the PrivateLinkServiceConnection object itself. + */ + public PrivateLinkServiceConnection withRequestMessage(String requestMessage) { + this.requestMessage = requestMessage; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of read-only information about the state of the + * connection to the remote resource. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of read-only information about the state of the + * connection to the remote resource. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateLinkServiceConnection object itself. + */ + public PrivateLinkServiceConnection withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkServiceConnection withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnectionState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..f16ac8ad1a7a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java new file mode 100644 index 0000000000000..c854b99fbd21f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner; + +/** An immutable client-side representation of PrivateLinkServiceIpConfiguration. */ +public interface PrivateLinkServiceIpConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of private link service ip configuration. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the primary property: Whether the ip configuration is primary or not. + * + * @return the primary value. + */ + Boolean primary(); + + /** + * Gets the provisioningState property: The provisioning state of the private link service IP configuration + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is + * IPv4. + * + * @return the privateIpAddressVersion value. + */ + IpVersion privateIpAddressVersion(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner + * object. + * + * @return the inner object. + */ + PrivateLinkServiceIpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceListResult.java new file mode 100644 index 0000000000000..7a1b9706ec2c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateLinkService API service call. */ +@Fluent +public final class PrivateLinkServiceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceListResult.class); + + /* + * A list of PrivateLinkService resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of PrivateLinkService resources in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of PrivateLinkService resources in a resource group. + * + * @param value the value value to set. + * @return the PrivateLinkServiceListResult object itself. + */ + public PrivateLinkServiceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesAutoApproval.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesAutoApproval.java new file mode 100644 index 0000000000000..6f061d8d6deae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesAutoApproval.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The auto-approval list of the private link service. */ +@Fluent +public final class PrivateLinkServicePropertiesAutoApproval extends ResourceSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServicePropertiesAutoApproval.class); + + /** {@inheritDoc} */ + @Override + public PrivateLinkServicePropertiesAutoApproval withSubscriptions(List subscriptions) { + super.withSubscriptions(subscriptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java new file mode 100644 index 0000000000000..fcc5fe9774b11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The visibility list of the private link service. */ +@Fluent +public final class PrivateLinkServicePropertiesVisibility extends ResourceSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServicePropertiesVisibility.class); + + /** {@inheritDoc} */ + @Override + public PrivateLinkServicePropertiesVisibility withSubscriptions(List subscriptions) { + super.withSubscriptions(subscriptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java new file mode 100644 index 0000000000000..0c660c4e70e12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; + +/** An immutable client-side representation of PrivateLinkServiceVisibility. */ +public interface PrivateLinkServiceVisibility { + /** + * Gets the visible property: Private Link Service Visibility (True/False). + * + * @return the visible value. + */ + Boolean visible(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner + * object. + * + * @return the inner object. + */ + PrivateLinkServiceVisibilityInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.java new file mode 100644 index 0000000000000..5e9cf8e045860 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; + +/** Resource collection API of PrivateLinkServices. */ +public interface PrivateLinkServices { + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 serviceName); + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 serviceName, Context context); + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + PrivateLinkService getByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, String expand, Context context); + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all private link service in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + PagedIterable list(); + + /** + * Gets all private link service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + PagedIterable list(Context context); + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + PrivateEndpointConnection getPrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName); + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + Response getPrivateEndpointConnectionWithResponse( + String resourceGroupName, String serviceName, String peConnectionName, String expand, Context context); + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + PrivateEndpointConnection updatePrivateEndpointConnection( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + Response updatePrivateEndpointConnectionWithResponse( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName); + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName, Context context); + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName); + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName, Context context); + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters); + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context); + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters); + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + PagedIterable listAutoApprovedPrivateLinkServices(String location); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + PagedIterable listAutoApprovedPrivateLinkServices(String location, Context context); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource 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 an array of private link service id that can be linked to a private end point with auto approved. + */ + PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName, Context context); + + /** + * Gets the specified private link service by resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + PrivateLinkService getById(String id); + + /** + * Gets the specified private link service by resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified private link service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified private link service. + * + * @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.resourcemanager.network.generated.models.ErrorException 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 PrivateLinkService resource. + * + * @param name resource name. + * @return the first stage of the new PrivateLinkService definition. + */ + PrivateLinkService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Probe.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Probe.java new file mode 100644 index 0000000000000..a5d121e15a118 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Probe.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import java.util.List; + +/** An immutable client-side representation of Probe. */ +public interface Probe { + /** + * 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 that is unique within the set of probes used by the load + * balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the loadBalancingRules property: The load balancer rules that use this probe. + * + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * Gets the protocol property: The protocol of the end point. If 'Tcp' is specified, a received ACK is required for + * the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is + * required for the probe to be successful. + * + * @return the protocol value. + */ + ProbeProtocol protocol(); + + /** + * Gets the port property: The port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @return the port value. + */ + Integer port(); + + /** + * Gets the intervalInSeconds property: The interval, in seconds, for how frequently to probe the endpoint for + * health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which + * allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is + * 5. + * + * @return the intervalInSeconds value. + */ + Integer intervalInSeconds(); + + /** + * Gets the numberOfProbes property: The number of probes where if no response, will result in stopping further + * traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or + * slower than the typical times used in Azure. + * + * @return the numberOfProbes value. + */ + Integer numberOfProbes(); + + /** + * Gets the requestPath property: The URI used for requesting health status from the VM. Path is required if a + * protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @return the requestPath value. + */ + String requestPath(); + + /** + * Gets the provisioningState property: The provisioning state of the probe resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ProbeInner object. + * + * @return the inner object. + */ + ProbeInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeProtocol.java new file mode 100644 index 0000000000000..0f332b3e59200 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProbeProtocol. */ +public final class ProbeProtocol extends ExpandableStringEnum { + /** Static value Http for ProbeProtocol. */ + public static final ProbeProtocol HTTP = fromString("Http"); + + /** Static value Tcp for ProbeProtocol. */ + public static final ProbeProtocol TCP = fromString("Tcp"); + + /** Static value Https for ProbeProtocol. */ + public static final ProbeProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ProbeProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProbeProtocol. + */ + @JsonCreator + public static ProbeProtocol fromString(String name) { + return fromString(name, ProbeProtocol.class); + } + + /** @return known ProbeProtocol values. */ + public static Collection values() { + return values(ProbeProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProcessorArchitecture.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProcessorArchitecture.java new file mode 100644 index 0000000000000..7c080e88baa05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProcessorArchitecture.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProcessorArchitecture. */ +public final class ProcessorArchitecture extends ExpandableStringEnum { + /** Static value Amd64 for ProcessorArchitecture. */ + public static final ProcessorArchitecture AMD64 = fromString("Amd64"); + + /** Static value X86 for ProcessorArchitecture. */ + public static final ProcessorArchitecture X86 = fromString("X86"); + + /** + * Creates or finds a ProcessorArchitecture from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProcessorArchitecture. + */ + @JsonCreator + public static ProcessorArchitecture fromString(String name) { + return fromString(name, ProcessorArchitecture.class); + } + + /** @return known ProcessorArchitecture values. */ + public static Collection values() { + return values(ProcessorArchitecture.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PropagatedRouteTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PropagatedRouteTable.java new file mode 100644 index 0000000000000..9dbd335e0c0ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PropagatedRouteTable.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of RouteTables to advertise the routes to. */ +@Fluent +public final class PropagatedRouteTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PropagatedRouteTable.class); + + /* + * The list of labels. + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * The list of resource ids of all the RouteTables. + */ + @JsonProperty(value = "ids") + private List ids; + + /** + * Get the labels property: The list of labels. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: The list of labels. + * + * @param labels the labels value to set. + * @return the PropagatedRouteTable object itself. + */ + public PropagatedRouteTable withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the ids property: The list of resource ids of all the RouteTables. + * + * @return the ids value. + */ + public List ids() { + return this.ids; + } + + /** + * Set the ids property: The list of resource ids of all the RouteTables. + * + * @param ids the ids value to set. + * @return the PropagatedRouteTable object itself. + */ + public PropagatedRouteTable withIds(List ids) { + this.ids = ids; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Protocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Protocol.java new file mode 100644 index 0000000000000..1d4494e933e33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Protocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Protocol. */ +public final class Protocol extends ExpandableStringEnum { + /** Static value Tcp for Protocol. */ + public static final Protocol TCP = fromString("Tcp"); + + /** Static value Http for Protocol. */ + public static final Protocol HTTP = fromString("Http"); + + /** Static value Https for Protocol. */ + public static final Protocol HTTPS = fromString("Https"); + + /** Static value Icmp for Protocol. */ + public static final Protocol ICMP = fromString("Icmp"); + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** @return known Protocol values. */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolConfiguration.java new file mode 100644 index 0000000000000..4adbd0b788a64 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolConfiguration.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.network.generated.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; + +/** Configuration of the protocol. */ +@Fluent +public final class ProtocolConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtocolConfiguration.class); + + /* + * HTTP configuration of the connectivity check. + */ + @JsonProperty(value = "HTTPConfiguration") + private HttpConfiguration httpConfiguration; + + /** + * Get the httpConfiguration property: HTTP configuration of the connectivity check. + * + * @return the httpConfiguration value. + */ + public HttpConfiguration httpConfiguration() { + return this.httpConfiguration; + } + + /** + * Set the httpConfiguration property: HTTP configuration of the connectivity check. + * + * @param httpConfiguration the httpConfiguration value to set. + * @return the ProtocolConfiguration object itself. + */ + public ProtocolConfiguration withHttpConfiguration(HttpConfiguration httpConfiguration) { + this.httpConfiguration = httpConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (httpConfiguration() != null) { + httpConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolCustomSettingsFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolCustomSettingsFormat.java new file mode 100644 index 0000000000000..bd593e1dc3653 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolCustomSettingsFormat.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.network.generated.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; + +/** DDoS custom policy properties. */ +@Fluent +public final class ProtocolCustomSettingsFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtocolCustomSettingsFormat.class); + + /* + * The protocol for which the DDoS protection policy is being customized. + */ + @JsonProperty(value = "protocol") + private DdosCustomPolicyProtocol protocol; + + /* + * The customized DDoS protection trigger rate. + */ + @JsonProperty(value = "triggerRateOverride") + private String triggerRateOverride; + + /* + * The customized DDoS protection source rate. + */ + @JsonProperty(value = "sourceRateOverride") + private String sourceRateOverride; + + /* + * The customized DDoS protection trigger rate sensitivity degrees. High: + * Trigger rate set with most sensitivity w.r.t. normal traffic. Default: + * Trigger rate set with moderate sensitivity w.r.t. normal traffic. Low: + * Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: + * Trigger rate set with least sensitivity w.r.t. normal traffic. + */ + @JsonProperty(value = "triggerSensitivityOverride") + private DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride; + + /** + * Get the protocol property: The protocol for which the DDoS protection policy is being customized. + * + * @return the protocol value. + */ + public DdosCustomPolicyProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol for which the DDoS protection policy is being customized. + * + * @param protocol the protocol value to set. + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withProtocol(DdosCustomPolicyProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the triggerRateOverride property: The customized DDoS protection trigger rate. + * + * @return the triggerRateOverride value. + */ + public String triggerRateOverride() { + return this.triggerRateOverride; + } + + /** + * Set the triggerRateOverride property: The customized DDoS protection trigger rate. + * + * @param triggerRateOverride the triggerRateOverride value to set. + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withTriggerRateOverride(String triggerRateOverride) { + this.triggerRateOverride = triggerRateOverride; + return this; + } + + /** + * Get the sourceRateOverride property: The customized DDoS protection source rate. + * + * @return the sourceRateOverride value. + */ + public String sourceRateOverride() { + return this.sourceRateOverride; + } + + /** + * Set the sourceRateOverride property: The customized DDoS protection source rate. + * + * @param sourceRateOverride the sourceRateOverride value to set. + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withSourceRateOverride(String sourceRateOverride) { + this.sourceRateOverride = sourceRateOverride; + return this; + } + + /** + * Get the triggerSensitivityOverride property: The customized DDoS protection trigger rate sensitivity degrees. + * High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate + * sensitivity w.r.t. normal traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: + * Trigger rate set with least sensitivity w.r.t. normal traffic. + * + * @return the triggerSensitivityOverride value. + */ + public DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride() { + return this.triggerSensitivityOverride; + } + + /** + * Set the triggerSensitivityOverride property: The customized DDoS protection trigger rate sensitivity degrees. + * High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate + * sensitivity w.r.t. normal traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: + * Trigger rate set with least sensitivity w.r.t. normal traffic. + * + * @param triggerSensitivityOverride the triggerSensitivityOverride value to set. + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withTriggerSensitivityOverride( + DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride) { + this.triggerSensitivityOverride = triggerSensitivityOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolType.java new file mode 100644 index 0000000000000..f6a7be29d8418 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProtocolType. */ +public final class ProtocolType extends ExpandableStringEnum { + /** Static value DoNotUse for ProtocolType. */ + public static final ProtocolType DO_NOT_USE = fromString("DoNotUse"); + + /** Static value Icmp for ProtocolType. */ + public static final ProtocolType ICMP = fromString("Icmp"); + + /** Static value Tcp for ProtocolType. */ + public static final ProtocolType TCP = fromString("Tcp"); + + /** Static value Udp for ProtocolType. */ + public static final ProtocolType UDP = fromString("Udp"); + + /** Static value Gre for ProtocolType. */ + public static final ProtocolType GRE = fromString("Gre"); + + /** Static value Esp for ProtocolType. */ + public static final ProtocolType ESP = fromString("Esp"); + + /** Static value Ah for ProtocolType. */ + public static final ProtocolType AH = fromString("Ah"); + + /** Static value Vxlan for ProtocolType. */ + public static final ProtocolType VXLAN = fromString("Vxlan"); + + /** Static value All for ProtocolType. */ + public static final ProtocolType ALL = fromString("All"); + + /** + * Creates or finds a ProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtocolType. + */ + @JsonCreator + public static ProtocolType fromString(String name) { + return fromString(name, ProtocolType.class); + } + + /** @return known ProtocolType values. */ + public static Collection values() { + return values(ProtocolType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProvisioningState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..997eceaebcc15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProvisioningState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddress.java new file mode 100644 index 0000000000000..af8f8243b3410 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddress.java @@ -0,0 +1,519 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PublicIpAddress. */ +public interface PublicIpAddress { + /** + * 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 extendedLocation property: The extended location of the public ip address. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the sku property: The public IP address SKU. + * + * @return the sku value. + */ + PublicIpAddressSku sku(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the publicIpAllocationMethod property: The public IP address allocation method. + * + * @return the publicIpAllocationMethod value. + */ + IpAllocationMethod publicIpAllocationMethod(); + + /** + * Gets the publicIpAddressVersion property: The public IP address version. + * + * @return the publicIpAddressVersion value. + */ + IpVersion publicIpAddressVersion(); + + /** + * Gets the ipConfiguration property: The IP configuration associated with the public IP address. + * + * @return the ipConfiguration value. + */ + IpConfiguration ipConfiguration(); + + /** + * Gets the dnsSettings property: The FQDN of the DNS record associated with the public IP address. + * + * @return the dnsSettings value. + */ + PublicIpAddressDnsSettings dnsSettings(); + + /** + * Gets the ddosSettings property: The DDoS protection custom policy associated with the public IP address. + * + * @return the ddosSettings value. + */ + DdosSettings ddosSettings(); + + /** + * Gets the ipTags property: The list of tags associated with the public IP address. + * + * @return the ipTags value. + */ + List ipTags(); + + /** + * Gets the ipAddress property: The IP address associated with the public IP address resource. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated from. + * + * @return the publicIpPrefix value. + */ + SubResource publicIpPrefix(); + + /** + * Gets the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * Gets the resourceGuid property: The resource GUID property of the public IP address resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the public IP address resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the servicePublicIpAddress property: The service public IP address of the public IP address resource. + * + * @return the servicePublicIpAddress value. + */ + PublicIpAddress servicePublicIpAddress(); + + /** + * Gets the natGateway property: The NatGateway for the Public IP address. + * + * @return the natGateway value. + */ + NatGateway natGateway(); + + /** + * Gets the migrationPhase property: Migration phase of Public IP Address. + * + * @return the migrationPhase value. + */ + PublicIpAddressMigrationPhase migrationPhase(); + + /** + * Gets the linkedPublicIpAddress property: The linked public IP address of the public IP address resource. + * + * @return the linkedPublicIpAddress value. + */ + PublicIpAddress linkedPublicIpAddress(); + + /** + * Gets the deleteOption property: Specify what happens to the public IP address when the VM using it is deleted. + * + * @return the deleteOption value. + */ + DeleteOptions deleteOption(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.PublicIpAddressInner object. + * + * @return the inner object. + */ + PublicIpAddressInner innerModel(); + + /** The entirety of the PublicIpAddress definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PublicIpAddress definition stages. */ + interface DefinitionStages { + /** The first stage of the PublicIpAddress definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PublicIpAddress 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 PublicIpAddress definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PublicIpAddress 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.WithExtendedLocation, + DefinitionStages.WithSku, + DefinitionStages.WithZones, + DefinitionStages.WithPublicIpAllocationMethod, + DefinitionStages.WithPublicIpAddressVersion, + DefinitionStages.WithDnsSettings, + DefinitionStages.WithDdosSettings, + DefinitionStages.WithIpTags, + DefinitionStages.WithIpAddress, + DefinitionStages.WithPublicIpPrefix, + DefinitionStages.WithIdleTimeoutInMinutes, + DefinitionStages.WithServicePublicIpAddress, + DefinitionStages.WithNatGateway, + DefinitionStages.WithMigrationPhase, + DefinitionStages.WithLinkedPublicIpAddress, + DefinitionStages.WithDeleteOption { + /** + * Executes the create request. + * + * @return the created resource. + */ + PublicIpAddress create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PublicIpAddress create(Context context); + } + /** The stage of the PublicIpAddress 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 PublicIpAddress definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the public ip address.. + * + * @param extendedLocation The extended location of the public ip address. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PublicIpAddress definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The public IP address SKU.. + * + * @param sku The public IP address SKU. + * @return the next definition stage. + */ + WithCreate withSku(PublicIpAddressSku sku); + } + /** The stage of the PublicIpAddress definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting the IP allocated for the resource + * needs to come from.. + * + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the PublicIpAddress definition allowing to specify publicIpAllocationMethod. */ + interface WithPublicIpAllocationMethod { + /** + * Specifies the publicIpAllocationMethod property: The public IP address allocation method.. + * + * @param publicIpAllocationMethod The public IP address allocation method. + * @return the next definition stage. + */ + WithCreate withPublicIpAllocationMethod(IpAllocationMethod publicIpAllocationMethod); + } + /** The stage of the PublicIpAddress definition allowing to specify publicIpAddressVersion. */ + interface WithPublicIpAddressVersion { + /** + * Specifies the publicIpAddressVersion property: The public IP address version.. + * + * @param publicIpAddressVersion The public IP address version. + * @return the next definition stage. + */ + WithCreate withPublicIpAddressVersion(IpVersion publicIpAddressVersion); + } + /** The stage of the PublicIpAddress definition allowing to specify dnsSettings. */ + interface WithDnsSettings { + /** + * Specifies the dnsSettings property: The FQDN of the DNS record associated with the public IP address.. + * + * @param dnsSettings The FQDN of the DNS record associated with the public IP address. + * @return the next definition stage. + */ + WithCreate withDnsSettings(PublicIpAddressDnsSettings dnsSettings); + } + /** The stage of the PublicIpAddress definition allowing to specify ddosSettings. */ + interface WithDdosSettings { + /** + * Specifies the ddosSettings property: The DDoS protection custom policy associated with the public IP + * address.. + * + * @param ddosSettings The DDoS protection custom policy associated with the public IP address. + * @return the next definition stage. + */ + WithCreate withDdosSettings(DdosSettings ddosSettings); + } + /** The stage of the PublicIpAddress definition allowing to specify ipTags. */ + interface WithIpTags { + /** + * Specifies the ipTags property: The list of tags associated with the public IP address.. + * + * @param ipTags The list of tags associated with the public IP address. + * @return the next definition stage. + */ + WithCreate withIpTags(List ipTags); + } + /** The stage of the PublicIpAddress definition allowing to specify ipAddress. */ + interface WithIpAddress { + /** + * Specifies the ipAddress property: The IP address associated with the public IP address resource.. + * + * @param ipAddress The IP address associated with the public IP address resource. + * @return the next definition stage. + */ + WithCreate withIpAddress(String ipAddress); + } + /** The stage of the PublicIpAddress definition allowing to specify publicIpPrefix. */ + interface WithPublicIpPrefix { + /** + * Specifies the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated + * from.. + * + * @param publicIpPrefix The Public IP Prefix this Public IP Address should be allocated from. + * @return the next definition stage. + */ + WithCreate withPublicIpPrefix(SubResource publicIpPrefix); + } + /** The stage of the PublicIpAddress definition allowing to specify idleTimeoutInMinutes. */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies the idleTimeoutInMinutes property: The idle timeout of the public IP address.. + * + * @param idleTimeoutInMinutes The idle timeout of the public IP address. + * @return the next definition stage. + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + /** The stage of the PublicIpAddress definition allowing to specify servicePublicIpAddress. */ + interface WithServicePublicIpAddress { + /** + * Specifies the servicePublicIpAddress property: The service public IP address of the public IP address + * resource.. + * + * @param servicePublicIpAddress The service public IP address of the public IP address resource. + * @return the next definition stage. + */ + WithCreate withServicePublicIpAddress(PublicIpAddressInner servicePublicIpAddress); + } + /** The stage of the PublicIpAddress definition allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: The NatGateway for the Public IP address.. + * + * @param natGateway The NatGateway for the Public IP address. + * @return the next definition stage. + */ + WithCreate withNatGateway(NatGatewayInner natGateway); + } + /** The stage of the PublicIpAddress definition allowing to specify migrationPhase. */ + interface WithMigrationPhase { + /** + * Specifies the migrationPhase property: Migration phase of Public IP Address.. + * + * @param migrationPhase Migration phase of Public IP Address. + * @return the next definition stage. + */ + WithCreate withMigrationPhase(PublicIpAddressMigrationPhase migrationPhase); + } + /** The stage of the PublicIpAddress definition allowing to specify linkedPublicIpAddress. */ + interface WithLinkedPublicIpAddress { + /** + * Specifies the linkedPublicIpAddress property: The linked public IP address of the public IP address + * resource.. + * + * @param linkedPublicIpAddress The linked public IP address of the public IP address resource. + * @return the next definition stage. + */ + WithCreate withLinkedPublicIpAddress(PublicIpAddressInner linkedPublicIpAddress); + } + /** The stage of the PublicIpAddress definition allowing to specify deleteOption. */ + interface WithDeleteOption { + /** + * Specifies the deleteOption property: Specify what happens to the public IP address when the VM using it + * is deleted. + * + * @param deleteOption Specify what happens to the public IP address when the VM using it is deleted. + * @return the next definition stage. + */ + WithCreate withDeleteOption(DeleteOptions deleteOption); + } + } + /** + * Begins update for the PublicIpAddress resource. + * + * @return the stage of resource update. + */ + PublicIpAddress.Update update(); + + /** The template for PublicIpAddress update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PublicIpAddress apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PublicIpAddress apply(Context context); + } + /** The PublicIpAddress update stages. */ + interface UpdateStages { + /** The stage of the PublicIpAddress 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PublicIpAddress refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PublicIpAddress refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettings.java new file mode 100644 index 0000000000000..06ec86e489fca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettings.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Contains FQDN of the DNS record associated with the public IP address. */ +@Fluent +public final class PublicIpAddressDnsSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressDnsSettings.class); + + /* + * The domain name label. The concatenation of the domain name label and + * the regionalized DNS zone make up the fully qualified domain name + * associated with the public IP address. If a domain name label is + * specified, an A DNS record is created for the public IP in the Microsoft + * Azure DNS system. + */ + @JsonProperty(value = "domainNameLabel") + private String domainNameLabel; + + /* + * The Fully Qualified Domain Name of the A DNS record associated with the + * public IP. This is the concatenation of the domainNameLabel and the + * regionalized DNS zone. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * The reverse FQDN. A user-visible, fully qualified domain name that + * resolves to this public IP address. If the reverseFqdn is specified, + * then a PTR DNS record is created pointing from the IP address in the + * in-addr.arpa domain to the reverse FQDN. + */ + @JsonProperty(value = "reverseFqdn") + private String reverseFqdn; + + /** + * Get the domainNameLabel property: The domain name label. The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain + * name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @return the domainNameLabel value. + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set the domainNameLabel property: The domain name label. The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain + * name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @param domainNameLabel the domainNameLabel value to set. + * @return the PublicIpAddressDnsSettings object itself. + */ + public PublicIpAddressDnsSettings withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Get the fqdn property: The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is + * the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is + * the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param fqdn the fqdn value to set. + * @return the PublicIpAddressDnsSettings object itself. + */ + public PublicIpAddressDnsSettings withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the reverseFqdn property: The reverse FQDN. A user-visible, fully qualified domain name that resolves to this + * public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address + * in the in-addr.arpa domain to the reverse FQDN. + * + * @return the reverseFqdn value. + */ + public String reverseFqdn() { + return this.reverseFqdn; + } + + /** + * Set the reverseFqdn property: The reverse FQDN. A user-visible, fully qualified domain name that resolves to this + * public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address + * in the in-addr.arpa domain to the reverse FQDN. + * + * @param reverseFqdn the reverseFqdn value to set. + * @return the PublicIpAddressDnsSettings object itself. + */ + public PublicIpAddressDnsSettings withReverseFqdn(String reverseFqdn) { + this.reverseFqdn = reverseFqdn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java new file mode 100644 index 0000000000000..a8445c231850e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPublicIpAddresses API service call. */ +@Fluent +public final class PublicIpAddressListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressListResult.class); + + /* + * A list of public IP addresses that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of public IP addresses that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of public IP addresses that exists in a resource group. + * + * @param value the value value to set. + * @return the PublicIpAddressListResult object itself. + */ + public PublicIpAddressListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the PublicIpAddressListResult object itself. + */ + public PublicIpAddressListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressMigrationPhase.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressMigrationPhase.java new file mode 100644 index 0000000000000..5acb713a217e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressMigrationPhase.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpAddressMigrationPhase. */ +public final class PublicIpAddressMigrationPhase extends ExpandableStringEnum { + /** Static value None for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase NONE = fromString("None"); + + /** Static value Prepare for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase PREPARE = fromString("Prepare"); + + /** Static value Commit for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase COMMIT = fromString("Commit"); + + /** Static value Abort for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase ABORT = fromString("Abort"); + + /** Static value Committed for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase COMMITTED = fromString("Committed"); + + /** + * Creates or finds a PublicIpAddressMigrationPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressMigrationPhase. + */ + @JsonCreator + public static PublicIpAddressMigrationPhase fromString(String name) { + return fromString(name, PublicIpAddressMigrationPhase.class); + } + + /** @return known PublicIpAddressMigrationPhase values. */ + public static Collection values() { + return values(PublicIpAddressMigrationPhase.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSku.java new file mode 100644 index 0000000000000..5009c5a039f02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSku.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.network.generated.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; + +/** SKU of a public IP address. */ +@Fluent +public final class PublicIpAddressSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressSku.class); + + /* + * Name of a public IP address SKU. + */ + @JsonProperty(value = "name") + private PublicIpAddressSkuName name; + + /* + * Tier of a public IP address SKU. + */ + @JsonProperty(value = "tier") + private PublicIpAddressSkuTier tier; + + /** + * Get the name property: Name of a public IP address SKU. + * + * @return the name value. + */ + public PublicIpAddressSkuName name() { + return this.name; + } + + /** + * Set the name property: Name of a public IP address SKU. + * + * @param name the name value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withName(PublicIpAddressSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of a public IP address SKU. + * + * @return the tier value. + */ + public PublicIpAddressSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of a public IP address SKU. + * + * @param tier the tier value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withTier(PublicIpAddressSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuName.java new file mode 100644 index 0000000000000..38305e6bc357e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuName.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpAddressSkuName. */ +public final class PublicIpAddressSkuName extends ExpandableStringEnum { + /** Static value Basic for PublicIpAddressSkuName. */ + public static final PublicIpAddressSkuName BASIC = fromString("Basic"); + + /** Static value Standard for PublicIpAddressSkuName. */ + public static final PublicIpAddressSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIpAddressSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuName. + */ + @JsonCreator + public static PublicIpAddressSkuName fromString(String name) { + return fromString(name, PublicIpAddressSkuName.class); + } + + /** @return known PublicIpAddressSkuName values. */ + public static Collection values() { + return values(PublicIpAddressSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuTier.java new file mode 100644 index 0000000000000..e1a840a9147a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuTier.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpAddressSkuTier. */ +public final class PublicIpAddressSkuTier extends ExpandableStringEnum { + /** Static value Regional for PublicIpAddressSkuTier. */ + public static final PublicIpAddressSkuTier REGIONAL = fromString("Regional"); + + /** Static value Global for PublicIpAddressSkuTier. */ + public static final PublicIpAddressSkuTier GLOBAL = fromString("Global"); + + /** + * Creates or finds a PublicIpAddressSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuTier. + */ + @JsonCreator + public static PublicIpAddressSkuTier fromString(String name) { + return fromString(name, PublicIpAddressSkuTier.class); + } + + /** @return known PublicIpAddressSkuTier values. */ + public static Collection values() { + return values(PublicIpAddressSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddresses.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddresses.java new file mode 100644 index 0000000000000..dcc06d27a58d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddresses.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 PublicIpAddresses. */ +public interface PublicIpAddresses { + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + PagedIterable listCloudServicePublicIpAddresses(String resourceGroupName, String cloudServiceName); + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud 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 information about all public IP addresses on a cloud service level. + */ + PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context); + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + PublicIpAddress getCloudServicePublicIpAddress( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName); + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + Response getCloudServicePublicIpAddressWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context); + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publicIpAddressName); + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publicIpAddressName, Context context); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + PublicIpAddress getByResourceGroup(String resourceGroupName, String publicIpAddressName); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpAddressName, String expand, Context context); + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the public IP addresses 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 all the public IP addresses in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP addresses in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName, Context context); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + PublicIpAddress getVirtualMachineScaleSetPublicIpAddress( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + Response getVirtualMachineScaleSetPublicIpAddressWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @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 the specified public IP address in a specified resource group. + */ + PublicIpAddress getById(String id); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified public IP address. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified public IP address. + * + * @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 PublicIpAddress resource. + * + * @param name resource name. + * @return the first stage of the new PublicIpAddress definition. + */ + PublicIpAddress.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefix.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefix.java new file mode 100644 index 0000000000000..08a1025a79b9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefix.java @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PublicIpPrefix. */ +public interface PublicIpPrefix { + /** + * 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 extendedLocation property: The extended location of the public ip address. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the sku property: The public IP prefix SKU. + * + * @return the sku value. + */ + PublicIpPrefixSku sku(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the publicIpAddressVersion property: The public IP address version. + * + * @return the publicIpAddressVersion value. + */ + IpVersion publicIpAddressVersion(); + + /** + * Gets the ipTags property: The list of tags associated with the public IP prefix. + * + * @return the ipTags value. + */ + List ipTags(); + + /** + * Gets the prefixLength property: The Length of the Public IP Prefix. + * + * @return the prefixLength value. + */ + Integer prefixLength(); + + /** + * Gets the ipPrefix property: The allocated Prefix. + * + * @return the ipPrefix value. + */ + String ipPrefix(); + + /** + * Gets the publicIpAddresses property: The list of all referenced PublicIPAddresses. + * + * @return the publicIpAddresses value. + */ + List publicIpAddresses(); + + /** + * Gets the loadBalancerFrontendIpConfiguration property: The reference to load balancer frontend IP configuration + * associated with the public IP prefix. + * + * @return the loadBalancerFrontendIpConfiguration value. + */ + SubResource loadBalancerFrontendIpConfiguration(); + + /** + * Gets the customIpPrefix property: The customIpPrefix that this prefix is associated with. + * + * @return the customIpPrefix value. + */ + SubResource customIpPrefix(); + + /** + * Gets the resourceGuid property: The resource GUID property of the public IP prefix resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the public IP prefix resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the natGateway property: NatGateway of Public IP Prefix. + * + * @return the natGateway value. + */ + NatGateway natGateway(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.PublicIpPrefixInner object. + * + * @return the inner object. + */ + PublicIpPrefixInner innerModel(); + + /** The entirety of the PublicIpPrefix definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PublicIpPrefix definition stages. */ + interface DefinitionStages { + /** The first stage of the PublicIpPrefix definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PublicIpPrefix 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 PublicIpPrefix definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PublicIpPrefix 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.WithExtendedLocation, + DefinitionStages.WithSku, + DefinitionStages.WithZones, + DefinitionStages.WithPublicIpAddressVersion, + DefinitionStages.WithIpTags, + DefinitionStages.WithPrefixLength, + DefinitionStages.WithCustomIpPrefix, + DefinitionStages.WithNatGateway { + /** + * Executes the create request. + * + * @return the created resource. + */ + PublicIpPrefix create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PublicIpPrefix create(Context context); + } + /** The stage of the PublicIpPrefix 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 PublicIpPrefix definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the public ip address.. + * + * @param extendedLocation The extended location of the public ip address. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PublicIpPrefix definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The public IP prefix SKU.. + * + * @param sku The public IP prefix SKU. + * @return the next definition stage. + */ + WithCreate withSku(PublicIpPrefixSku sku); + } + /** The stage of the PublicIpPrefix definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting the IP allocated for the resource + * needs to come from.. + * + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the PublicIpPrefix definition allowing to specify publicIpAddressVersion. */ + interface WithPublicIpAddressVersion { + /** + * Specifies the publicIpAddressVersion property: The public IP address version.. + * + * @param publicIpAddressVersion The public IP address version. + * @return the next definition stage. + */ + WithCreate withPublicIpAddressVersion(IpVersion publicIpAddressVersion); + } + /** The stage of the PublicIpPrefix definition allowing to specify ipTags. */ + interface WithIpTags { + /** + * Specifies the ipTags property: The list of tags associated with the public IP prefix.. + * + * @param ipTags The list of tags associated with the public IP prefix. + * @return the next definition stage. + */ + WithCreate withIpTags(List ipTags); + } + /** The stage of the PublicIpPrefix definition allowing to specify prefixLength. */ + interface WithPrefixLength { + /** + * Specifies the prefixLength property: The Length of the Public IP Prefix.. + * + * @param prefixLength The Length of the Public IP Prefix. + * @return the next definition stage. + */ + WithCreate withPrefixLength(Integer prefixLength); + } + /** The stage of the PublicIpPrefix definition allowing to specify customIpPrefix. */ + interface WithCustomIpPrefix { + /** + * Specifies the customIpPrefix property: The customIpPrefix that this prefix is associated with.. + * + * @param customIpPrefix The customIpPrefix that this prefix is associated with. + * @return the next definition stage. + */ + WithCreate withCustomIpPrefix(SubResource customIpPrefix); + } + /** The stage of the PublicIpPrefix definition allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: NatGateway of Public IP Prefix.. + * + * @param natGateway NatGateway of Public IP Prefix. + * @return the next definition stage. + */ + WithCreate withNatGateway(NatGatewayInner natGateway); + } + } + /** + * Begins update for the PublicIpPrefix resource. + * + * @return the stage of resource update. + */ + PublicIpPrefix.Update update(); + + /** The template for PublicIpPrefix update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PublicIpPrefix apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PublicIpPrefix apply(Context context); + } + /** The PublicIpPrefix update stages. */ + interface UpdateStages { + /** The stage of the PublicIpPrefix 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PublicIpPrefix refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PublicIpPrefix refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixListResult.java new file mode 100644 index 0000000000000..b4e6bac96ae59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPublicIpPrefixes API service call. */ +@Fluent +public final class PublicIpPrefixListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixListResult.class); + + /* + * A list of public IP prefixes that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of public IP prefixes that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of public IP prefixes that exists in a resource group. + * + * @param value the value value to set. + * @return the PublicIpPrefixListResult object itself. + */ + public PublicIpPrefixListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the PublicIpPrefixListResult object itself. + */ + public PublicIpPrefixListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSku.java new file mode 100644 index 0000000000000..fb2734dd6c015 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSku.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.network.generated.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; + +/** SKU of a public IP prefix. */ +@Fluent +public final class PublicIpPrefixSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixSku.class); + + /* + * Name of a public IP prefix SKU. + */ + @JsonProperty(value = "name") + private PublicIpPrefixSkuName name; + + /* + * Tier of a public IP prefix SKU. + */ + @JsonProperty(value = "tier") + private PublicIpPrefixSkuTier tier; + + /** + * Get the name property: Name of a public IP prefix SKU. + * + * @return the name value. + */ + public PublicIpPrefixSkuName name() { + return this.name; + } + + /** + * Set the name property: Name of a public IP prefix SKU. + * + * @param name the name value to set. + * @return the PublicIpPrefixSku object itself. + */ + public PublicIpPrefixSku withName(PublicIpPrefixSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of a public IP prefix SKU. + * + * @return the tier value. + */ + public PublicIpPrefixSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of a public IP prefix SKU. + * + * @param tier the tier value to set. + * @return the PublicIpPrefixSku object itself. + */ + public PublicIpPrefixSku withTier(PublicIpPrefixSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuName.java new file mode 100644 index 0000000000000..274dd3ec0f0e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuName.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpPrefixSkuName. */ +public final class PublicIpPrefixSkuName extends ExpandableStringEnum { + /** Static value Standard for PublicIpPrefixSkuName. */ + public static final PublicIpPrefixSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIpPrefixSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpPrefixSkuName. + */ + @JsonCreator + public static PublicIpPrefixSkuName fromString(String name) { + return fromString(name, PublicIpPrefixSkuName.class); + } + + /** @return known PublicIpPrefixSkuName values. */ + public static Collection values() { + return values(PublicIpPrefixSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuTier.java new file mode 100644 index 0000000000000..733b33d3c6286 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuTier.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpPrefixSkuTier. */ +public final class PublicIpPrefixSkuTier extends ExpandableStringEnum { + /** Static value Regional for PublicIpPrefixSkuTier. */ + public static final PublicIpPrefixSkuTier REGIONAL = fromString("Regional"); + + /** Static value Global for PublicIpPrefixSkuTier. */ + public static final PublicIpPrefixSkuTier GLOBAL = fromString("Global"); + + /** + * Creates or finds a PublicIpPrefixSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpPrefixSkuTier. + */ + @JsonCreator + public static PublicIpPrefixSkuTier fromString(String name) { + return fromString(name, PublicIpPrefixSkuTier.class); + } + + /** @return known PublicIpPrefixSkuTier values. */ + public static Collection values() { + return values(PublicIpPrefixSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixes.java new file mode 100644 index 0000000000000..11f9269777735 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixes.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 PublicIpPrefixes. */ +public interface PublicIpPrefixes { + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publicIpPrefixName); + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 publicIpPrefixName, Context context); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + PublicIpPrefix getByResourceGroup(String resourceGroupName, String publicIpPrefixName); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpPrefixName, String expand, Context context); + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the public IP prefixes 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 all the public IP prefixes in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource 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 all public IP prefixes in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @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 the specified public IP prefix in a specified resource group. + */ + PublicIpPrefix getById(String id); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified public IP prefix. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified public IP prefix. + * + * @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 PublicIpPrefix resource. + * + * @param name resource name. + * @return the first stage of the new PublicIpPrefix definition. + */ + PublicIpPrefix.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosIpRange.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosIpRange.java new file mode 100644 index 0000000000000..6e51697cfd3bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosIpRange.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.network.generated.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; + +/** Qos Traffic Profiler IP Range properties. */ +@Fluent +public final class QosIpRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QosIpRange.class); + + /* + * Start IP Address. + */ + @JsonProperty(value = "startIP") + private String startIp; + + /* + * End IP Address. + */ + @JsonProperty(value = "endIP") + private String endIp; + + /** + * Get the startIp property: Start IP Address. + * + * @return the startIp value. + */ + public String startIp() { + return this.startIp; + } + + /** + * Set the startIp property: Start IP Address. + * + * @param startIp the startIp value to set. + * @return the QosIpRange object itself. + */ + public QosIpRange withStartIp(String startIp) { + this.startIp = startIp; + return this; + } + + /** + * Get the endIp property: End IP Address. + * + * @return the endIp value. + */ + public String endIp() { + return this.endIp; + } + + /** + * Set the endIp property: End IP Address. + * + * @param endIp the endIp value to set. + * @return the QosIpRange object itself. + */ + public QosIpRange withEndIp(String endIp) { + this.endIp = endIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosPortRange.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosPortRange.java new file mode 100644 index 0000000000000..f0cc81a5a7e5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosPortRange.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.network.generated.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; + +/** Qos Traffic Profiler Port range properties. */ +@Fluent +public final class QosPortRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QosPortRange.class); + + /* + * Qos Port Range start. + */ + @JsonProperty(value = "start") + private Integer start; + + /* + * Qos Port Range end. + */ + @JsonProperty(value = "end") + private Integer end; + + /** + * Get the start property: Qos Port Range start. + * + * @return the start value. + */ + public Integer start() { + return this.start; + } + + /** + * Set the start property: Qos Port Range start. + * + * @param start the start value to set. + * @return the QosPortRange object itself. + */ + public QosPortRange withStart(Integer start) { + this.start = start; + return this; + } + + /** + * Get the end property: Qos Port Range end. + * + * @return the end value. + */ + public Integer end() { + return this.end; + } + + /** + * Set the end property: Qos Port Range end. + * + * @param end the end value to set. + * @return the QosPortRange object itself. + */ + public QosPortRange withEnd(Integer end) { + this.end = end; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryTroubleshootingParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryTroubleshootingParameters.java new file mode 100644 index 0000000000000..b7f929491f597 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryTroubleshootingParameters.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.network.generated.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; + +/** Parameters that define the resource to query the troubleshooting result. */ +@Fluent +public final class QueryTroubleshootingParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryTroubleshootingParameters.class); + + /* + * The target resource ID to query the troubleshooting result. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the targetResourceId property: The target resource ID to query the troubleshooting result. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The target resource ID to query the troubleshooting result. + * + * @param targetResourceId the targetResourceId value to set. + * @return the QueryTroubleshootingParameters object itself. + */ + public QueryTroubleshootingParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model QueryTroubleshootingParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RadiusServer.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RadiusServer.java new file mode 100644 index 0000000000000..23a5ba9b89bd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RadiusServer.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Radius Server Settings. */ +@Fluent +public final class RadiusServer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RadiusServer.class); + + /* + * The address of this radius server. + */ + @JsonProperty(value = "radiusServerAddress", required = true) + private String radiusServerAddress; + + /* + * The initial score assigned to this radius server. + */ + @JsonProperty(value = "radiusServerScore") + private Long radiusServerScore; + + /* + * The secret used for this radius server. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /** + * Get the radiusServerAddress property: The address of this radius server. + * + * @return the radiusServerAddress value. + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radiusServerAddress property: The address of this radius server. + * + * @param radiusServerAddress the radiusServerAddress value to set. + * @return the RadiusServer object itself. + */ + public RadiusServer withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radiusServerScore property: The initial score assigned to this radius server. + * + * @return the radiusServerScore value. + */ + public Long radiusServerScore() { + return this.radiusServerScore; + } + + /** + * Set the radiusServerScore property: The initial score assigned to this radius server. + * + * @param radiusServerScore the radiusServerScore value to set. + * @return the RadiusServer object itself. + */ + public RadiusServer withRadiusServerScore(Long radiusServerScore) { + this.radiusServerScore = radiusServerScore; + return this; + } + + /** + * Get the radiusServerSecret property: The secret used for this radius server. + * + * @return the radiusServerSecret value. + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radiusServerSecret property: The secret used for this radius server. + * + * @param radiusServerSecret the radiusServerSecret value to set. + * @return the RadiusServer object itself. + */ + public RadiusServer withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (radiusServerAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property radiusServerAddress in model RadiusServer")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RecordSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RecordSet.java new file mode 100644 index 0000000000000..cb7be0511182f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RecordSet.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** A collective group of information about the record set information. */ +@Fluent +public final class RecordSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecordSet.class); + + /* + * Resource record type. + */ + @JsonProperty(value = "recordType") + private String recordType; + + /* + * Recordset name. + */ + @JsonProperty(value = "recordSetName") + private String recordSetName; + + /* + * Fqdn that resolves to private endpoint ip address. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * The provisioning state of the recordset. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Recordset time to live. + */ + @JsonProperty(value = "ttl") + private Integer ttl; + + /* + * The private ip address of the private endpoint. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /** + * Get the recordType property: Resource record type. + * + * @return the recordType value. + */ + public String recordType() { + return this.recordType; + } + + /** + * Set the recordType property: Resource record type. + * + * @param recordType the recordType value to set. + * @return the RecordSet object itself. + */ + public RecordSet withRecordType(String recordType) { + this.recordType = recordType; + return this; + } + + /** + * Get the recordSetName property: Recordset name. + * + * @return the recordSetName value. + */ + public String recordSetName() { + return this.recordSetName; + } + + /** + * Set the recordSetName property: Recordset name. + * + * @param recordSetName the recordSetName value to set. + * @return the RecordSet object itself. + */ + public RecordSet withRecordSetName(String recordSetName) { + this.recordSetName = recordSetName; + return this; + } + + /** + * Get the fqdn property: Fqdn that resolves to private endpoint ip address. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Fqdn that resolves to private endpoint ip address. + * + * @param fqdn the fqdn value to set. + * @return the RecordSet object itself. + */ + public RecordSet withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the recordset. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ttl property: Recordset time to live. + * + * @return the ttl value. + */ + public Integer ttl() { + return this.ttl; + } + + /** + * Set the ttl property: Recordset time to live. + * + * @param ttl the ttl value to set. + * @return the RecordSet object itself. + */ + public RecordSet withTtl(Integer ttl) { + this.ttl = ttl; + return this; + } + + /** + * Get the ipAddresses property: The private ip address of the private endpoint. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set the ipAddresses property: The private ip address of the private endpoint. + * + * @param ipAddresses the ipAddresses value to set. + * @return the RecordSet object itself. + */ + public RecordSet withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ReferencedPublicIpAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ReferencedPublicIpAddress.java new file mode 100644 index 0000000000000..6a1d039d6c308 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ReferencedPublicIpAddress.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.network.generated.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; + +/** Reference to a public IP address. */ +@Fluent +public final class ReferencedPublicIpAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReferencedPublicIpAddress.class); + + /* + * The PublicIPAddress Reference. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The PublicIPAddress Reference. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The PublicIPAddress Reference. + * + * @param id the id value to set. + * @return the ReferencedPublicIpAddress object itself. + */ + public ReferencedPublicIpAddress withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceIdentityType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..2776c96213453 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceIdentityType.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.network.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.java new file mode 100644 index 0000000000000..ae2de68995f08 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ResourceNavigationLink resource. */ +@JsonFlatten +@Fluent +public class ResourceNavigationLink extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNavigationLink.class); + + /* + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource type of the linked resource. + */ + @JsonProperty(value = "properties.linkedResourceType") + private String linkedResourceType; + + /* + * Link to the external resource. + */ + @JsonProperty(value = "properties.link") + private String link; + + /* + * The provisioning state of the resource navigation link resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the linkedResourceType property: Resource type of the linked resource. + * + * @return the linkedResourceType value. + */ + public String linkedResourceType() { + return this.linkedResourceType; + } + + /** + * Set the linkedResourceType property: Resource type of the linked resource. + * + * @param linkedResourceType the linkedResourceType value to set. + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLinkedResourceType(String linkedResourceType) { + this.linkedResourceType = linkedResourceType; + return this; + } + + /** + * Get the link property: Link to the external resource. + * + * @return the link value. + */ + public String link() { + return this.link; + } + + /** + * Set the link property: Link to the external resource. + * + * @param link the link value to set. + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLink(String link) { + this.link = link; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource navigation link resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ResourceNavigationLink withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinks.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinks.java new file mode 100644 index 0000000000000..f2a9c7b6dc901 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinks.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceNavigationLinks. */ +public interface ResourceNavigationLinks { + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resource navigation links for a subnet. + */ + ResourceNavigationLinksListResult list(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resource navigation links for a subnet. + */ + Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinksListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinksListResult.java new file mode 100644 index 0000000000000..8ba08d898b2f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinksListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import java.util.List; + +/** An immutable client-side representation of ResourceNavigationLinksListResult. */ +public interface ResourceNavigationLinksListResult { + /** + * Gets the value property: The resource navigation links in a subnet. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner + * object. + * + * @return the inner object. + */ + ResourceNavigationLinksListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java new file mode 100644 index 0000000000000..d8dcc7092f870 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 ResourceProviders. */ +public interface ResourceProviders { + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + PagedIterable getActiveSessions(String resourceGroupName, String bastionHostname); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname, Context context); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context); + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + DnsNameAvailabilityResult checkDnsNameAvailability(String location, String domainNameLabel); + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + Response checkDnsNameAvailabilityWithResponse( + String location, String domainNameLabel, Context context); + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + VirtualWanSecurityProviders supportedSecurityProviders(String resourceGroupName, String virtualWanName); + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + Response supportedSecurityProvidersWithResponse( + String resourceGroupName, String virtualWanName, Context context); + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams); + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceSet.java new file mode 100644 index 0000000000000..18a397ee0ad23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceSet.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 base resource set for visibility and auto-approval. */ +@Fluent +public class ResourceSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSet.class); + + /* + * The list of subscriptions. + */ + @JsonProperty(value = "subscriptions") + private List subscriptions; + + /** + * Get the subscriptions property: The list of subscriptions. + * + * @return the subscriptions value. + */ + public List subscriptions() { + return this.subscriptions; + } + + /** + * Set the subscriptions property: The list of subscriptions. + * + * @param subscriptions the subscriptions value to set. + * @return the ResourceSet object itself. + */ + public ResourceSet withSubscriptions(List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RetentionPolicyParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RetentionPolicyParameters.java new file mode 100644 index 0000000000000..71d0a480667d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RetentionPolicyParameters.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.network.generated.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; + +/** Parameters that define the retention policy for flow log. */ +@Fluent +public final class RetentionPolicyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionPolicyParameters.class); + + /* + * Number of days to retain flow log records. + */ + @JsonProperty(value = "days") + private Integer days; + + /* + * Flag to enable/disable retention. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the days property: Number of days to retain flow log records. + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: Number of days to retain flow log records. + * + * @param days the days value to set. + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the enabled property: Flag to enable/disable retention. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Flag to enable/disable retention. + * + * @param enabled the enabled value to set. + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Route.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Route.java new file mode 100644 index 0000000000000..01642031b1856 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Route.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.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; + +/** An immutable client-side representation of Route. */ +public interface Route { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the addressPrefix property: The destination CIDR to which the route applies. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the nextHopType property: The type of Azure hop the packet should be sent to. + * + * @return the nextHopType value. + */ + RouteNextHopType nextHopType(); + + /** + * Gets the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values are only + * allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the route resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP routes + * regardless of LPM. + * + * @return the hasBgpOverride value. + */ + Boolean hasBgpOverride(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.RouteInner object. + * + * @return the inner object. + */ + RouteInner innerModel(); + + /** The entirety of the Route definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Route definition stages. */ + interface DefinitionStages { + /** The first stage of the Route definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Route definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, routeTableName. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @return the next definition stage. + */ + WithCreate withExistingRouteTable(String resourceGroupName, String routeTableName); + } + /** + * The stage of the Route 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.WithName, + DefinitionStages.WithType, + DefinitionStages.WithAddressPrefix, + DefinitionStages.WithNextHopType, + DefinitionStages.WithNextHopIpAddress, + DefinitionStages.WithHasBgpOverride { + /** + * Executes the create request. + * + * @return the created resource. + */ + Route create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Route create(Context context); + } + /** The stage of the Route definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the Route definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the Route definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The destination CIDR to which the route applies.. + * + * @param addressPrefix The destination CIDR to which the route applies. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the Route definition allowing to specify nextHopType. */ + interface WithNextHopType { + /** + * Specifies the nextHopType property: The type of Azure hop the packet should be sent to.. + * + * @param nextHopType The type of Azure hop the packet should be sent to. + * @return the next definition stage. + */ + WithCreate withNextHopType(RouteNextHopType nextHopType); + } + /** The stage of the Route definition allowing to specify nextHopIpAddress. */ + interface WithNextHopIpAddress { + /** + * Specifies the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values + * are only allowed in routes where the next hop type is VirtualAppliance.. + * + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed + * in routes where the next hop type is VirtualAppliance. + * @return the next definition stage. + */ + WithCreate withNextHopIpAddress(String nextHopIpAddress); + } + /** The stage of the Route definition allowing to specify hasBgpOverride. */ + interface WithHasBgpOverride { + /** + * Specifies the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP + * routes regardless of LPM.. + * + * @param hasBgpOverride A value indicating whether this route overrides overlapping BGP routes regardless + * of LPM. + * @return the next definition stage. + */ + WithCreate withHasBgpOverride(Boolean hasBgpOverride); + } + } + /** + * Begins update for the Route resource. + * + * @return the stage of resource update. + */ + Route.Update update(); + + /** The template for Route update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithAddressPrefix, + UpdateStages.WithNextHopType, + UpdateStages.WithNextHopIpAddress, + UpdateStages.WithHasBgpOverride { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Route apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Route apply(Context context); + } + /** The Route update stages. */ + interface UpdateStages { + /** The stage of the Route update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the Route update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the Route update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The destination CIDR to which the route applies.. + * + * @param addressPrefix The destination CIDR to which the route applies. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the Route update allowing to specify nextHopType. */ + interface WithNextHopType { + /** + * Specifies the nextHopType property: The type of Azure hop the packet should be sent to.. + * + * @param nextHopType The type of Azure hop the packet should be sent to. + * @return the next definition stage. + */ + Update withNextHopType(RouteNextHopType nextHopType); + } + /** The stage of the Route update allowing to specify nextHopIpAddress. */ + interface WithNextHopIpAddress { + /** + * Specifies the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values + * are only allowed in routes where the next hop type is VirtualAppliance.. + * + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed + * in routes where the next hop type is VirtualAppliance. + * @return the next definition stage. + */ + Update withNextHopIpAddress(String nextHopIpAddress); + } + /** The stage of the Route update allowing to specify hasBgpOverride. */ + interface WithHasBgpOverride { + /** + * Specifies the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP + * routes regardless of LPM.. + * + * @param hasBgpOverride A value indicating whether this route overrides overlapping BGP routes regardless + * of LPM. + * @return the next definition stage. + */ + Update withHasBgpOverride(Boolean hasBgpOverride); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Route refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Route refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.java new file mode 100644 index 0000000000000..de3eb13918838 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RouteFilter. */ +public interface RouteFilter { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the rules property: Collection of RouteFilterRules contained within a route filter. + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the peerings property: A collection of references to express route circuit peerings. + * + * @return the peerings value. + */ + List peerings(); + + /** + * Gets the ipv6Peerings property: A collection of references to express route circuit ipv6 peerings. + * + * @return the ipv6Peerings value. + */ + List ipv6Peerings(); + + /** + * Gets the provisioningState property: The provisioning state of the route filter resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.RouteFilterInner object. + * + * @return the inner object. + */ + RouteFilterInner innerModel(); + + /** The entirety of the RouteFilter definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The RouteFilter definition stages. */ + interface DefinitionStages { + /** The first stage of the RouteFilter definition. */ + interface Blank extends WithLocation { + } + /** The stage of the RouteFilter 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 RouteFilter definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the RouteFilter 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.WithRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + RouteFilter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RouteFilter create(Context context); + } + /** The stage of the RouteFilter 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 RouteFilter definition allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: Collection of RouteFilterRules contained within a route filter.. + * + * @param rules Collection of RouteFilterRules contained within a route filter. + * @return the next definition stage. + */ + WithCreate withRules(List rules); + } + } + /** + * Begins update for the RouteFilter resource. + * + * @return the stage of resource update. + */ + RouteFilter.Update update(); + + /** The template for RouteFilter update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RouteFilter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RouteFilter apply(Context context); + } + /** The RouteFilter update stages. */ + interface UpdateStages { + /** The stage of the RouteFilter 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RouteFilter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RouteFilter refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterListResult.java new file mode 100644 index 0000000000000..14f3d575e52dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRouteFilters API service call. */ +@Fluent +public final class RouteFilterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterListResult.class); + + /* + * A list of route filters in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of route filters in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of route filters in a resource group. + * + * @param value the value value to set. + * @return the RouteFilterListResult object itself. + */ + public RouteFilterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the RouteFilterListResult object itself. + */ + public RouteFilterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.java new file mode 100644 index 0000000000000..00b9e209e89c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import java.util.List; + +/** An immutable client-side representation of RouteFilterRule. */ +public interface RouteFilterRule { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the access property: The access type of the rule. + * + * @return the access value. + */ + Access access(); + + /** + * Gets the routeFilterRuleType property: The rule type of the rule. + * + * @return the routeFilterRuleType value. + */ + RouteFilterRuleType routeFilterRuleType(); + + /** + * Gets the communities property: The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + * + * @return the communities value. + */ + List communities(); + + /** + * Gets the provisioningState property: The provisioning state of the route filter rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner object. + * + * @return the inner object. + */ + RouteFilterRuleInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java new file mode 100644 index 0000000000000..562aa13d4e6c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRouteFilterRules API service call. */ +@Fluent +public final class RouteFilterRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRuleListResult.class); + + /* + * A list of RouteFilterRules in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of RouteFilterRules in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of RouteFilterRules in a resource group. + * + * @param value the value value to set. + * @return the RouteFilterRuleListResult object itself. + */ + public RouteFilterRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the RouteFilterRuleListResult object itself. + */ + public RouteFilterRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleType.java new file mode 100644 index 0000000000000..fd0f32c47cb33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RouteFilterRuleType. */ +public final class RouteFilterRuleType extends ExpandableStringEnum { + /** Static value Community for RouteFilterRuleType. */ + public static final RouteFilterRuleType COMMUNITY = fromString("Community"); + + /** + * Creates or finds a RouteFilterRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RouteFilterRuleType. + */ + @JsonCreator + public static RouteFilterRuleType fromString(String name) { + return fromString(name, RouteFilterRuleType.class); + } + + /** @return known RouteFilterRuleType values. */ + public static Collection values() { + return values(RouteFilterRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRules.java new file mode 100644 index 0000000000000..31d457dcc8837 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRules.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; + +/** Resource collection API of RouteFilterRules. */ +public interface RouteFilterRules { + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeFilterName, String ruleName); + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeFilterName, String ruleName, Context context); + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + RouteFilterRule get(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + Response getWithResponse( + String resourceGroupName, String routeFilterName, String ruleName, Context context); + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + RouteFilterRule createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters); + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + RouteFilterRule createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilters.java new file mode 100644 index 0000000000000..d48bdf97dd118 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilters.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 RouteFilters. */ +public interface RouteFilters { + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeFilterName); + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeFilterName, Context context); + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + RouteFilter getByResourceGroup(String resourceGroupName, String routeFilterName); + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String routeFilterName, String expand, Context context); + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route filters in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route filters in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + PagedIterable list(); + + /** + * Gets all route filters 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 all route filters in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified route filter. + * + * @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 the specified route filter. + */ + RouteFilter getById(String id); + + /** + * Gets the specified route filter. + * + * @param id the resource ID. + * @param expand Expands referenced express route bgp peering resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified route filter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified route filter. + * + * @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 RouteFilter resource. + * + * @param name resource name. + * @return the first stage of the new RouteFilter definition. + */ + RouteFilter.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteListResult.java new file mode 100644 index 0000000000000..40ccc3f827008 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRoute API service call. */ +@Fluent +public final class RouteListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteListResult.class); + + /* + * A list of routes in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of routes in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of routes in a resource group. + * + * @param value the value value to set. + * @return the RouteListResult object itself. + */ + public RouteListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the RouteListResult object itself. + */ + public RouteListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteNextHopType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteNextHopType.java new file mode 100644 index 0000000000000..b337e88d62d9b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteNextHopType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RouteNextHopType. */ +public final class RouteNextHopType extends ExpandableStringEnum { + /** Static value VirtualNetworkGateway for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for RouteNextHopType. */ + public static final RouteNextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value Internet for RouteNextHopType. */ + public static final RouteNextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value None for RouteNextHopType. */ + public static final RouteNextHopType NONE = fromString("None"); + + /** + * Creates or finds a RouteNextHopType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RouteNextHopType. + */ + @JsonCreator + public static RouteNextHopType fromString(String name) { + return fromString(name, RouteNextHopType.class); + } + + /** @return known RouteNextHopType values. */ + public static Collection values() { + return values(RouteNextHopType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTable.java new file mode 100644 index 0000000000000..eeaaf8993bfd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTable.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RouteTable. */ +public interface RouteTable { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the routes property: Collection of routes contained within a route table. + * + * @return the routes value. + */ + List routes(); + + /** + * Gets the subnets property: A collection of references to subnets. + * + * @return the subnets value. + */ + List subnets(); + + /** + * Gets the disableBgpRoutePropagation property: Whether to disable the routes learned by BGP on that route table. + * True means disable. + * + * @return the disableBgpRoutePropagation value. + */ + Boolean disableBgpRoutePropagation(); + + /** + * Gets the provisioningState property: The provisioning state of the route table resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: The resource GUID property of the route table. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.RouteTableInner object. + * + * @return the inner object. + */ + RouteTableInner innerModel(); + + /** The entirety of the RouteTable definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The RouteTable definition stages. */ + interface DefinitionStages { + /** The first stage of the RouteTable definition. */ + interface Blank extends WithLocation { + } + /** The stage of the RouteTable 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 RouteTable definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the RouteTable 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.WithRoutes, + DefinitionStages.WithDisableBgpRoutePropagation { + /** + * Executes the create request. + * + * @return the created resource. + */ + RouteTable create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RouteTable create(Context context); + } + /** The stage of the RouteTable 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 RouteTable definition allowing to specify routes. */ + interface WithRoutes { + /** + * Specifies the routes property: Collection of routes contained within a route table.. + * + * @param routes Collection of routes contained within a route table. + * @return the next definition stage. + */ + WithCreate withRoutes(List routes); + } + /** The stage of the RouteTable definition allowing to specify disableBgpRoutePropagation. */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies the disableBgpRoutePropagation property: Whether to disable the routes learned by BGP on that + * route table. True means disable.. + * + * @param disableBgpRoutePropagation Whether to disable the routes learned by BGP on that route table. True + * means disable. + * @return the next definition stage. + */ + WithCreate withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + } + /** + * Begins update for the RouteTable resource. + * + * @return the stage of resource update. + */ + RouteTable.Update update(); + + /** The template for RouteTable update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RouteTable apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RouteTable apply(Context context); + } + /** The RouteTable update stages. */ + interface UpdateStages { + /** The stage of the RouteTable 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RouteTable refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RouteTable refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTableListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTableListResult.java new file mode 100644 index 0000000000000..92787f1e08d5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTableListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRouteTable API service call. */ +@Fluent +public final class RouteTableListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTableListResult.class); + + /* + * A list of route tables in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of route tables in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of route tables in a resource group. + * + * @param value the value value to set. + * @return the RouteTableListResult object itself. + */ + public RouteTableListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the RouteTableListResult object itself. + */ + public RouteTableListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTables.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTables.java new file mode 100644 index 0000000000000..656e9007d82c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTables.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 RouteTables. */ +public interface RouteTables { + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeTableName); + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeTableName, Context context); + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + RouteTable getByResourceGroup(String resourceGroupName, String routeTableName); + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String routeTableName, String expand, Context context); + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource 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 all route tables in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route tables in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + PagedIterable list(); + + /** + * Gets all route tables 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 all route tables in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified route table. + * + * @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 the specified route table. + */ + RouteTable getById(String id); + + /** + * Gets the specified route table. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified route table. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified route table. + * + * @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 RouteTable resource. + * + * @param name resource name. + * @return the first stage of the new RouteTable definition. + */ + RouteTable.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Routes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Routes.java new file mode 100644 index 0000000000000..588ddb0161e39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Routes.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.network.generated.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 Routes. */ +public interface Routes { + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeTableName, String routeName); + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeTableName, String routeName, Context context); + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + Route get(String resourceGroupName, String routeTableName, String routeName); + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + Response getWithResponse(String resourceGroupName, String routeTableName, String routeName, Context context); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + PagedIterable list(String resourceGroupName, String routeTableName); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + PagedIterable list(String resourceGroupName, String routeTableName, Context context); + + /** + * Gets the specified route from a route table. + * + * @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 the specified route from a route table. + */ + Route getById(String id); + + /** + * Gets the specified route from a route table. + * + * @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 specified route from a route table. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified route from a route table. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified route from a route table. + * + * @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 Route resource. + * + * @param name resource name. + * @return the first stage of the new Route definition. + */ + Route.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingConfiguration.java new file mode 100644 index 0000000000000..8806d521cf6a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingConfiguration.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Routing Configuration indicating the associated and propagated route tables for this connection. */ +@Fluent +public final class RoutingConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingConfiguration.class); + + /* + * The resource id RouteTable associated with this RoutingConfiguration. + */ + @JsonProperty(value = "associatedRouteTable") + private SubResource associatedRouteTable; + + /* + * The list of RouteTables to advertise the routes to. + */ + @JsonProperty(value = "propagatedRouteTables") + private PropagatedRouteTable propagatedRouteTables; + + /* + * List of routes that control routing from VirtualHub into a virtual + * network connection. + */ + @JsonProperty(value = "vnetRoutes") + private VnetRoute vnetRoutes; + + /** + * Get the associatedRouteTable property: The resource id RouteTable associated with this RoutingConfiguration. + * + * @return the associatedRouteTable value. + */ + public SubResource associatedRouteTable() { + return this.associatedRouteTable; + } + + /** + * Set the associatedRouteTable property: The resource id RouteTable associated with this RoutingConfiguration. + * + * @param associatedRouteTable the associatedRouteTable value to set. + * @return the RoutingConfiguration object itself. + */ + public RoutingConfiguration withAssociatedRouteTable(SubResource associatedRouteTable) { + this.associatedRouteTable = associatedRouteTable; + return this; + } + + /** + * Get the propagatedRouteTables property: The list of RouteTables to advertise the routes to. + * + * @return the propagatedRouteTables value. + */ + public PropagatedRouteTable propagatedRouteTables() { + return this.propagatedRouteTables; + } + + /** + * Set the propagatedRouteTables property: The list of RouteTables to advertise the routes to. + * + * @param propagatedRouteTables the propagatedRouteTables value to set. + * @return the RoutingConfiguration object itself. + */ + public RoutingConfiguration withPropagatedRouteTables(PropagatedRouteTable propagatedRouteTables) { + this.propagatedRouteTables = propagatedRouteTables; + return this; + } + + /** + * Get the vnetRoutes property: List of routes that control routing from VirtualHub into a virtual network + * connection. + * + * @return the vnetRoutes value. + */ + public VnetRoute vnetRoutes() { + return this.vnetRoutes; + } + + /** + * Set the vnetRoutes property: List of routes that control routing from VirtualHub into a virtual network + * connection. + * + * @param vnetRoutes the vnetRoutes value to set. + * @return the RoutingConfiguration object itself. + */ + public RoutingConfiguration withVnetRoutes(VnetRoute vnetRoutes) { + this.vnetRoutes = vnetRoutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (propagatedRouteTables() != null) { + propagatedRouteTables().validate(); + } + if (vnetRoutes() != null) { + vnetRoutes().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingState.java new file mode 100644 index 0000000000000..a9cb1ac92cde0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RoutingState. */ +public final class RoutingState extends ExpandableStringEnum { + /** Static value None for RoutingState. */ + public static final RoutingState NONE = fromString("None"); + + /** Static value Provisioned for RoutingState. */ + public static final RoutingState PROVISIONED = fromString("Provisioned"); + + /** Static value Provisioning for RoutingState. */ + public static final RoutingState PROVISIONING = fromString("Provisioning"); + + /** Static value Failed for RoutingState. */ + public static final RoutingState FAILED = fromString("Failed"); + + /** + * Creates or finds a RoutingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingState. + */ + @JsonCreator + public static RoutingState fromString(String name) { + return fromString(name, RoutingState.class); + } + + /** @return known RoutingState values. */ + public static Collection values() { + return values(RoutingState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupNetworkInterface.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupNetworkInterface.java new file mode 100644 index 0000000000000..fe9c7e42188f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupNetworkInterface.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Network interface and all its associated security rules. */ +@Fluent +public final class SecurityGroupNetworkInterface { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupNetworkInterface.class); + + /* + * ID of the network interface. + */ + @JsonProperty(value = "id") + private String id; + + /* + * All security rules associated with the network interface. + */ + @JsonProperty(value = "securityRuleAssociations") + private SecurityRuleAssociations securityRuleAssociations; + + /** + * Get the id property: ID of the network interface. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID of the network interface. + * + * @param id the id value to set. + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withId(String id) { + this.id = id; + return this; + } + + /** + * Get the securityRuleAssociations property: All security rules associated with the network interface. + * + * @return the securityRuleAssociations value. + */ + public SecurityRuleAssociations securityRuleAssociations() { + return this.securityRuleAssociations; + } + + /** + * Set the securityRuleAssociations property: All security rules associated with the network interface. + * + * @param securityRuleAssociations the securityRuleAssociations value to set. + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withSecurityRuleAssociations( + SecurityRuleAssociations securityRuleAssociations) { + this.securityRuleAssociations = securityRuleAssociations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityRuleAssociations() != null) { + securityRuleAssociations().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewParameters.java new file mode 100644 index 0000000000000..63fb7885cd0eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewParameters.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.network.generated.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; + +/** Parameters that define the VM to check security groups for. */ +@Fluent +public final class SecurityGroupViewParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupViewParameters.class); + + /* + * ID of the target VM. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the targetResourceId property: ID of the target VM. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: ID of the target VM. + * + * @param targetResourceId the targetResourceId value to set. + * @return the SecurityGroupViewParameters object itself. + */ + public SecurityGroupViewParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model SecurityGroupViewParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java new file mode 100644 index 0000000000000..363f7178b5daa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import java.util.List; + +/** An immutable client-side representation of SecurityGroupViewResult. */ +public interface SecurityGroupViewResult { + /** + * Gets the networkInterfaces property: List of network interfaces on the specified VM. + * + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner object. + * + * @return the inner object. + */ + SecurityGroupViewResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.java new file mode 100644 index 0000000000000..f35e061726b4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import java.util.Map; + +/** An immutable client-side representation of SecurityPartnerProvider. */ +public interface SecurityPartnerProvider { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the provisioningState property: The provisioning state of the Security Partner Provider resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the securityProviderName property: The security provider name. + * + * @return the securityProviderName value. + */ + SecurityProviderName securityProviderName(); + + /** + * Gets the connectionStatus property: The connection status with the Security Partner Provider. + * + * @return the connectionStatus value. + */ + SecurityPartnerProviderConnectionStatus connectionStatus(); + + /** + * Gets the virtualHub property: The virtualHub to which the Security Partner Provider belongs. + * + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.SecurityPartnerProviderInner object. + * + * @return the inner object. + */ + SecurityPartnerProviderInner innerModel(); + + /** The entirety of the SecurityPartnerProvider definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SecurityPartnerProvider definition stages. */ + interface DefinitionStages { + /** The first stage of the SecurityPartnerProvider definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SecurityPartnerProvider 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 SecurityPartnerProvider definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SecurityPartnerProvider 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.WithSecurityProviderName, + DefinitionStages.WithVirtualHub { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityPartnerProvider create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityPartnerProvider create(Context context); + } + /** The stage of the SecurityPartnerProvider 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 SecurityPartnerProvider definition allowing to specify securityProviderName. */ + interface WithSecurityProviderName { + /** + * Specifies the securityProviderName property: The security provider name.. + * + * @param securityProviderName The security provider name. + * @return the next definition stage. + */ + WithCreate withSecurityProviderName(SecurityProviderName securityProviderName); + } + /** The stage of the SecurityPartnerProvider definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The virtualHub to which the Security Partner Provider belongs.. + * + * @param virtualHub The virtualHub to which the Security Partner Provider belongs. + * @return the next definition stage. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + } + /** + * Begins update for the SecurityPartnerProvider resource. + * + * @return the stage of resource update. + */ + SecurityPartnerProvider.Update update(); + + /** The template for SecurityPartnerProvider update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityPartnerProvider apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityPartnerProvider apply(Context context); + } + /** The SecurityPartnerProvider update stages. */ + interface UpdateStages { + /** The stage of the SecurityPartnerProvider 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityPartnerProvider refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityPartnerProvider refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderConnectionStatus.java new file mode 100644 index 0000000000000..7d1e741915dd3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderConnectionStatus.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityPartnerProviderConnectionStatus. */ +public final class SecurityPartnerProviderConnectionStatus + extends ExpandableStringEnum { + /** Static value Unknown for SecurityPartnerProviderConnectionStatus. */ + public static final SecurityPartnerProviderConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value PartiallyConnected for SecurityPartnerProviderConnectionStatus. */ + public static final SecurityPartnerProviderConnectionStatus PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** Static value Connected for SecurityPartnerProviderConnectionStatus. */ + public static final SecurityPartnerProviderConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for SecurityPartnerProviderConnectionStatus. */ + public static final SecurityPartnerProviderConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a SecurityPartnerProviderConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityPartnerProviderConnectionStatus. + */ + @JsonCreator + public static SecurityPartnerProviderConnectionStatus fromString(String name) { + return fromString(name, SecurityPartnerProviderConnectionStatus.class); + } + + /** @return known SecurityPartnerProviderConnectionStatus values. */ + public static Collection values() { + return values(SecurityPartnerProviderConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderListResult.java new file mode 100644 index 0000000000000..ffff66b8664ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListSecurityPartnerProviders API service call. */ +@Fluent +public final class SecurityPartnerProviderListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPartnerProviderListResult.class); + + /* + * List of Security Partner Providers in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Security Partner Providers in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Security Partner Providers in a resource group. + * + * @param value the value value to set. + * @return the SecurityPartnerProviderListResult object itself. + */ + public SecurityPartnerProviderListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the SecurityPartnerProviderListResult object itself. + */ + public SecurityPartnerProviderListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviders.java new file mode 100644 index 0000000000000..752e2bcc8e2e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviders.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 SecurityPartnerProviders. */ +public interface SecurityPartnerProviders { + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 securityPartnerProviderName); + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String securityPartnerProviderName, Context context); + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + SecurityPartnerProvider getByResourceGroup(String resourceGroupName, String securityPartnerProviderName); + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String securityPartnerProviderName, Context context); + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource 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 response for ListSecurityPartnerProviders API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Security Partner Providers 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 all the Security Partner Providers in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Security Partner Provider. + * + * @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 the specified Security Partner Provider. + */ + SecurityPartnerProvider getById(String id); + + /** + * Gets the specified Security Partner Provider. + * + * @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 specified Security Partner Provider. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified Security Partner Provider. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Security Partner Provider. + * + * @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 SecurityPartnerProvider resource. + * + * @param name resource name. + * @return the first stage of the new SecurityPartnerProvider definition. + */ + SecurityPartnerProvider.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityProviderName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityProviderName.java new file mode 100644 index 0000000000000..8443a51d3a6e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityProviderName.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityProviderName. */ +public final class SecurityProviderName extends ExpandableStringEnum { + /** Static value ZScaler for SecurityProviderName. */ + public static final SecurityProviderName ZSCALER = fromString("ZScaler"); + + /** Static value IBoss for SecurityProviderName. */ + public static final SecurityProviderName IBOSS = fromString("IBoss"); + + /** Static value Checkpoint for SecurityProviderName. */ + public static final SecurityProviderName CHECKPOINT = fromString("Checkpoint"); + + /** + * Creates or finds a SecurityProviderName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityProviderName. + */ + @JsonCreator + public static SecurityProviderName fromString(String name) { + return fromString(name, SecurityProviderName.class); + } + + /** @return known SecurityProviderName values. */ + public static Collection values() { + return values(SecurityProviderName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRule.java new file mode 100644 index 0000000000000..5d1bc7d166ef0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRule.java @@ -0,0 +1,677 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import java.util.List; + +/** An immutable client-side representation of SecurityRule. */ +public interface SecurityRule { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + String description(); + + /** + * Gets the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * Gets the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisk '*' + * can also be used to match all ports. + * + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * Gets the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports. + * + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * Gets the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this + * is an ingress rule, specifies where network traffic originates from. + * + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * Gets the sourceAddressPrefixes property: The CIDR or source IP ranges. + * + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * Gets the sourceApplicationSecurityGroups property: The application security group specified as source. + * + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * Gets the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. + * Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' + * and 'Internet' can also be used. + * + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * Gets the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * Gets the destinationApplicationSecurityGroups property: The application security group specified as destination. + * + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * Gets the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + + /** + * Gets the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * Gets the access property: The network traffic is allowed or denied. + * + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * Gets the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number + * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the + * rule. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the direction property: The direction of the rule. The direction specifies if rule will be evaluated on + * incoming or outgoing traffic. + * + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * Gets the provisioningState property: The provisioning state of the security rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner object. + * + * @return the inner object. + */ + SecurityRuleInner innerModel(); + + /** The entirety of the SecurityRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SecurityRule definition stages. */ + interface DefinitionStages { + /** The first stage of the SecurityRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SecurityRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkSecurityGroupName. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @return the next definition stage. + */ + WithCreate withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName); + } + /** + * The stage of the SecurityRule 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.WithName, + DefinitionStages.WithType, + DefinitionStages.WithDescription, + DefinitionStages.WithProtocol, + DefinitionStages.WithSourcePortRange, + DefinitionStages.WithDestinationPortRange, + DefinitionStages.WithSourceAddressPrefix, + DefinitionStages.WithSourceAddressPrefixes, + DefinitionStages.WithSourceApplicationSecurityGroups, + DefinitionStages.WithDestinationAddressPrefix, + DefinitionStages.WithDestinationAddressPrefixes, + DefinitionStages.WithDestinationApplicationSecurityGroups, + DefinitionStages.WithSourcePortRanges, + DefinitionStages.WithDestinationPortRanges, + DefinitionStages.WithAccess, + DefinitionStages.WithPriority, + DefinitionStages.WithDirection { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityRule create(Context context); + } + /** The stage of the SecurityRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the SecurityRule definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the SecurityRule definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description for this rule. Restricted to 140 chars.. + * + * @param description A description for this rule. Restricted to 140 chars. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the SecurityRule definition allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: Network protocol this rule applies to.. + * + * @param protocol Network protocol this rule applies to. + * @return the next definition stage. + */ + WithCreate withProtocol(SecurityRuleProtocol protocol); + } + /** The stage of the SecurityRule definition allowing to specify sourcePortRange. */ + interface WithSourcePortRange { + /** + * Specifies the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports.. + * + * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterisk '*' can + * also be used to match all ports. + * @return the next definition stage. + */ + WithCreate withSourcePortRange(String sourcePortRange); + } + /** The stage of the SecurityRule definition allowing to specify destinationPortRange. */ + interface WithDestinationPortRange { + /** + * Specifies the destinationPortRange property: The destination port or range. Integer or range between 0 + * and 65535. Asterisk '*' can also be used to match all ports.. + * + * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterisk + * '*' can also be used to match all ports. + * @return the next definition stage. + */ + WithCreate withDestinationPortRange(String destinationPortRange); + } + /** The stage of the SecurityRule definition allowing to specify sourceAddressPrefix. */ + interface WithSourceAddressPrefix { + /** + * Specifies the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to + * match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also + * be used. If this is an ingress rule, specifies where network traffic originates from.. + * + * @param sourceAddressPrefix The CIDR or source IP range. Asterisk '*' can also be used to match all source + * IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + * this is an ingress rule, specifies where network traffic originates from. + * @return the next definition stage. + */ + WithCreate withSourceAddressPrefix(String sourceAddressPrefix); + } + /** The stage of the SecurityRule definition allowing to specify sourceAddressPrefixes. */ + interface WithSourceAddressPrefixes { + /** + * Specifies the sourceAddressPrefixes property: The CIDR or source IP ranges.. + * + * @param sourceAddressPrefixes The CIDR or source IP ranges. + * @return the next definition stage. + */ + WithCreate withSourceAddressPrefixes(List sourceAddressPrefixes); + } + /** The stage of the SecurityRule definition allowing to specify sourceApplicationSecurityGroups. */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies the sourceApplicationSecurityGroups property: The application security group specified as + * source.. + * + * @param sourceApplicationSecurityGroups The application security group specified as source. + * @return the next definition stage. + */ + WithCreate withSourceApplicationSecurityGroups( + List sourceApplicationSecurityGroups); + } + /** The stage of the SecurityRule definition allowing to specify destinationAddressPrefix. */ + interface WithDestinationAddressPrefix { + /** + * Specifies the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP + * range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used.. + * + * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterisk + * '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * @return the next definition stage. + */ + WithCreate withDestinationAddressPrefix(String destinationAddressPrefix); + } + /** The stage of the SecurityRule definition allowing to specify destinationAddressPrefixes. */ + interface WithDestinationAddressPrefixes { + /** + * Specifies the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination + * IP ranges.. + * + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges. + * @return the next definition stage. + */ + WithCreate withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + /** The stage of the SecurityRule definition allowing to specify destinationApplicationSecurityGroups. */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies the destinationApplicationSecurityGroups property: The application security group specified as + * destination.. + * + * @param destinationApplicationSecurityGroups The application security group specified as destination. + * @return the next definition stage. + */ + WithCreate withDestinationApplicationSecurityGroups( + List destinationApplicationSecurityGroups); + } + /** The stage of the SecurityRule definition allowing to specify sourcePortRanges. */ + interface WithSourcePortRanges { + /** + * Specifies the sourcePortRanges property: The source port ranges.. + * + * @param sourcePortRanges The source port ranges. + * @return the next definition stage. + */ + WithCreate withSourcePortRanges(List sourcePortRanges); + } + /** The stage of the SecurityRule definition allowing to specify destinationPortRanges. */ + interface WithDestinationPortRanges { + /** + * Specifies the destinationPortRanges property: The destination port ranges.. + * + * @param destinationPortRanges The destination port ranges. + * @return the next definition stage. + */ + WithCreate withDestinationPortRanges(List destinationPortRanges); + } + /** The stage of the SecurityRule definition allowing to specify access. */ + interface WithAccess { + /** + * Specifies the access property: The network traffic is allowed or denied.. + * + * @param access The network traffic is allowed or denied. + * @return the next definition stage. + */ + WithCreate withAccess(SecurityRuleAccess access); + } + /** The stage of the SecurityRule definition allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: The priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The lower the priority number, the higher + * the priority of the rule.. + * + * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must + * be unique for each rule in the collection. The lower the priority number, the higher the priority of + * the rule. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + /** The stage of the SecurityRule definition allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outgoing traffic.. + * + * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming + * or outgoing traffic. + * @return the next definition stage. + */ + WithCreate withDirection(SecurityRuleDirection direction); + } + } + /** + * Begins update for the SecurityRule resource. + * + * @return the stage of resource update. + */ + SecurityRule.Update update(); + + /** The template for SecurityRule update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithDescription, + UpdateStages.WithProtocol, + UpdateStages.WithSourcePortRange, + UpdateStages.WithDestinationPortRange, + UpdateStages.WithSourceAddressPrefix, + UpdateStages.WithSourceAddressPrefixes, + UpdateStages.WithSourceApplicationSecurityGroups, + UpdateStages.WithDestinationAddressPrefix, + UpdateStages.WithDestinationAddressPrefixes, + UpdateStages.WithDestinationApplicationSecurityGroups, + UpdateStages.WithSourcePortRanges, + UpdateStages.WithDestinationPortRanges, + UpdateStages.WithAccess, + UpdateStages.WithPriority, + UpdateStages.WithDirection { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityRule apply(Context context); + } + /** The SecurityRule update stages. */ + interface UpdateStages { + /** The stage of the SecurityRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the SecurityRule update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the SecurityRule update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description for this rule. Restricted to 140 chars.. + * + * @param description A description for this rule. Restricted to 140 chars. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the SecurityRule update allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: Network protocol this rule applies to.. + * + * @param protocol Network protocol this rule applies to. + * @return the next definition stage. + */ + Update withProtocol(SecurityRuleProtocol protocol); + } + /** The stage of the SecurityRule update allowing to specify sourcePortRange. */ + interface WithSourcePortRange { + /** + * Specifies the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports.. + * + * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterisk '*' can + * also be used to match all ports. + * @return the next definition stage. + */ + Update withSourcePortRange(String sourcePortRange); + } + /** The stage of the SecurityRule update allowing to specify destinationPortRange. */ + interface WithDestinationPortRange { + /** + * Specifies the destinationPortRange property: The destination port or range. Integer or range between 0 + * and 65535. Asterisk '*' can also be used to match all ports.. + * + * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterisk + * '*' can also be used to match all ports. + * @return the next definition stage. + */ + Update withDestinationPortRange(String destinationPortRange); + } + /** The stage of the SecurityRule update allowing to specify sourceAddressPrefix. */ + interface WithSourceAddressPrefix { + /** + * Specifies the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to + * match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also + * be used. If this is an ingress rule, specifies where network traffic originates from.. + * + * @param sourceAddressPrefix The CIDR or source IP range. Asterisk '*' can also be used to match all source + * IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + * this is an ingress rule, specifies where network traffic originates from. + * @return the next definition stage. + */ + Update withSourceAddressPrefix(String sourceAddressPrefix); + } + /** The stage of the SecurityRule update allowing to specify sourceAddressPrefixes. */ + interface WithSourceAddressPrefixes { + /** + * Specifies the sourceAddressPrefixes property: The CIDR or source IP ranges.. + * + * @param sourceAddressPrefixes The CIDR or source IP ranges. + * @return the next definition stage. + */ + Update withSourceAddressPrefixes(List sourceAddressPrefixes); + } + /** The stage of the SecurityRule update allowing to specify sourceApplicationSecurityGroups. */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies the sourceApplicationSecurityGroups property: The application security group specified as + * source.. + * + * @param sourceApplicationSecurityGroups The application security group specified as source. + * @return the next definition stage. + */ + Update withSourceApplicationSecurityGroups( + List sourceApplicationSecurityGroups); + } + /** The stage of the SecurityRule update allowing to specify destinationAddressPrefix. */ + interface WithDestinationAddressPrefix { + /** + * Specifies the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP + * range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used.. + * + * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterisk + * '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * @return the next definition stage. + */ + Update withDestinationAddressPrefix(String destinationAddressPrefix); + } + /** The stage of the SecurityRule update allowing to specify destinationAddressPrefixes. */ + interface WithDestinationAddressPrefixes { + /** + * Specifies the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination + * IP ranges.. + * + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges. + * @return the next definition stage. + */ + Update withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + /** The stage of the SecurityRule update allowing to specify destinationApplicationSecurityGroups. */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies the destinationApplicationSecurityGroups property: The application security group specified as + * destination.. + * + * @param destinationApplicationSecurityGroups The application security group specified as destination. + * @return the next definition stage. + */ + Update withDestinationApplicationSecurityGroups( + List destinationApplicationSecurityGroups); + } + /** The stage of the SecurityRule update allowing to specify sourcePortRanges. */ + interface WithSourcePortRanges { + /** + * Specifies the sourcePortRanges property: The source port ranges.. + * + * @param sourcePortRanges The source port ranges. + * @return the next definition stage. + */ + Update withSourcePortRanges(List sourcePortRanges); + } + /** The stage of the SecurityRule update allowing to specify destinationPortRanges. */ + interface WithDestinationPortRanges { + /** + * Specifies the destinationPortRanges property: The destination port ranges.. + * + * @param destinationPortRanges The destination port ranges. + * @return the next definition stage. + */ + Update withDestinationPortRanges(List destinationPortRanges); + } + /** The stage of the SecurityRule update allowing to specify access. */ + interface WithAccess { + /** + * Specifies the access property: The network traffic is allowed or denied.. + * + * @param access The network traffic is allowed or denied. + * @return the next definition stage. + */ + Update withAccess(SecurityRuleAccess access); + } + /** The stage of the SecurityRule update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: The priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The lower the priority number, the higher + * the priority of the rule.. + * + * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must + * be unique for each rule in the collection. The lower the priority number, the higher the priority of + * the rule. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + /** The stage of the SecurityRule update allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outgoing traffic.. + * + * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming + * or outgoing traffic. + * @return the next definition stage. + */ + Update withDirection(SecurityRuleDirection direction); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.java new file mode 100644 index 0000000000000..2c24baab1569e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityRuleAccess. */ +public final class SecurityRuleAccess extends ExpandableStringEnum { + /** Static value Allow for SecurityRuleAccess. */ + public static final SecurityRuleAccess ALLOW = fromString("Allow"); + + /** Static value Deny for SecurityRuleAccess. */ + public static final SecurityRuleAccess DENY = fromString("Deny"); + + /** + * Creates or finds a SecurityRuleAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityRuleAccess. + */ + @JsonCreator + public static SecurityRuleAccess fromString(String name) { + return fromString(name, SecurityRuleAccess.class); + } + + /** @return known SecurityRuleAccess values. */ + public static Collection values() { + return values(SecurityRuleAccess.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAssociations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAssociations.java new file mode 100644 index 0000000000000..1931abf5ed0a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAssociations.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** All security rules associated with the network interface. */ +@Fluent +public final class SecurityRuleAssociations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRuleAssociations.class); + + /* + * Network interface and it's custom security rules. + */ + @JsonProperty(value = "networkInterfaceAssociation") + private NetworkInterfaceAssociation networkInterfaceAssociation; + + /* + * Subnet and it's custom security rules. + */ + @JsonProperty(value = "subnetAssociation") + private SubnetAssociation subnetAssociation; + + /* + * Collection of default security rules of the network security group. + */ + @JsonProperty(value = "defaultSecurityRules") + private List defaultSecurityRules; + + /* + * Collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Get the networkInterfaceAssociation property: Network interface and it's custom security rules. + * + * @return the networkInterfaceAssociation value. + */ + public NetworkInterfaceAssociation networkInterfaceAssociation() { + return this.networkInterfaceAssociation; + } + + /** + * Set the networkInterfaceAssociation property: Network interface and it's custom security rules. + * + * @param networkInterfaceAssociation the networkInterfaceAssociation value to set. + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withNetworkInterfaceAssociation( + NetworkInterfaceAssociation networkInterfaceAssociation) { + this.networkInterfaceAssociation = networkInterfaceAssociation; + return this; + } + + /** + * Get the subnetAssociation property: Subnet and it's custom security rules. + * + * @return the subnetAssociation value. + */ + public SubnetAssociation subnetAssociation() { + return this.subnetAssociation; + } + + /** + * Set the subnetAssociation property: Subnet and it's custom security rules. + * + * @param subnetAssociation the subnetAssociation value to set. + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withSubnetAssociation(SubnetAssociation subnetAssociation) { + this.subnetAssociation = subnetAssociation; + return this; + } + + /** + * Get the defaultSecurityRules property: Collection of default security rules of the network security group. + * + * @return the defaultSecurityRules value. + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set the defaultSecurityRules property: Collection of default security rules of the network security group. + * + * @param defaultSecurityRules the defaultSecurityRules value to set. + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withDefaultSecurityRules(List defaultSecurityRules) { + this.defaultSecurityRules = defaultSecurityRules; + return this; + } + + /** + * Get the effectiveSecurityRules property: Collection of effective security rules. + * + * @return the effectiveSecurityRules value. + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set the effectiveSecurityRules property: Collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set. + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withEffectiveSecurityRules( + List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaceAssociation() != null) { + networkInterfaceAssociation().validate(); + } + if (subnetAssociation() != null) { + subnetAssociation().validate(); + } + if (defaultSecurityRules() != null) { + defaultSecurityRules().forEach(e -> e.validate()); + } + if (effectiveSecurityRules() != null) { + effectiveSecurityRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleDirection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleDirection.java new file mode 100644 index 0000000000000..d1ade3eda5d59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleDirection.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityRuleDirection. */ +public final class SecurityRuleDirection extends ExpandableStringEnum { + /** Static value Inbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection INBOUND = fromString("Inbound"); + + /** Static value Outbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a SecurityRuleDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityRuleDirection. + */ + @JsonCreator + public static SecurityRuleDirection fromString(String name) { + return fromString(name, SecurityRuleDirection.class); + } + + /** @return known SecurityRuleDirection values. */ + public static Collection values() { + return values(SecurityRuleDirection.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleListResult.java new file mode 100644 index 0000000000000..cd0c0e1cc62d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security + * group. + */ +@Fluent +public final class SecurityRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRuleListResult.class); + + /* + * The security rules in a network security group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The security rules in a network security group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The security rules in a network security group. + * + * @param value the value value to set. + * @return the SecurityRuleListResult object itself. + */ + public SecurityRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the SecurityRuleListResult object itself. + */ + public SecurityRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleProtocol.java new file mode 100644 index 0000000000000..dc37004dc56dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityRuleProtocol. */ +public final class SecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value Icmp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol ICMP = fromString("Icmp"); + + /** Static value Esp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol ESP = fromString("Esp"); + + /** Static value * for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol ASTERISK = fromString("*"); + + /** Static value Ah for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol AH = fromString("Ah"); + + /** + * Creates or finds a SecurityRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityRuleProtocol. + */ + @JsonCreator + public static SecurityRuleProtocol fromString(String name) { + return fromString(name, SecurityRuleProtocol.class); + } + + /** @return known SecurityRuleProtocol values. */ + public static Collection values() { + return values(SecurityRuleProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRules.java new file mode 100644 index 0000000000000..3c7de628759b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRules.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.network.generated.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 SecurityRules. */ +public interface SecurityRules { + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkSecurityGroupName, String securityRuleName); + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkSecurityGroupName, String securityRuleName, Context context); + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + SecurityRule get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + PagedIterable list(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security 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 all security rules in a network security group. + */ + PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Get the specified network security rule. + * + * @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 the specified network security rule. + */ + SecurityRule getById(String id); + + /** + * Get the specified network security rule. + * + * @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 specified network security rule. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified network security rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified network security rule. + * + * @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 SecurityRule resource. + * + * @param name resource name. + * @return the first stage of the new SecurityRule definition. + */ + SecurityRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLink.java new file mode 100644 index 0000000000000..f1e39e3a06665 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLink.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ServiceAssociationLink resource. */ +@JsonFlatten +@Fluent +public class ServiceAssociationLink extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceAssociationLink.class); + + /* + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource type of the linked resource. + */ + @JsonProperty(value = "properties.linkedResourceType") + private String linkedResourceType; + + /* + * Link to the external resource. + */ + @JsonProperty(value = "properties.link") + private String link; + + /* + * The provisioning state of the service association link resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * If true, the resource can be deleted. + */ + @JsonProperty(value = "properties.allowDelete") + private Boolean allowDelete; + + /* + * A list of locations. + */ + @JsonProperty(value = "properties.locations") + private List locations; + + /** + * Get the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the linkedResourceType property: Resource type of the linked resource. + * + * @return the linkedResourceType value. + */ + public String linkedResourceType() { + return this.linkedResourceType; + } + + /** + * Set the linkedResourceType property: Resource type of the linked resource. + * + * @param linkedResourceType the linkedResourceType value to set. + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withLinkedResourceType(String linkedResourceType) { + this.linkedResourceType = linkedResourceType; + return this; + } + + /** + * Get the link property: Link to the external resource. + * + * @return the link value. + */ + public String link() { + return this.link; + } + + /** + * Set the link property: Link to the external resource. + * + * @param link the link value to set. + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withLink(String link) { + this.link = link; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the service association link resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the allowDelete property: If true, the resource can be deleted. + * + * @return the allowDelete value. + */ + public Boolean allowDelete() { + return this.allowDelete; + } + + /** + * Set the allowDelete property: If true, the resource can be deleted. + * + * @param allowDelete the allowDelete value to set. + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withAllowDelete(Boolean allowDelete) { + this.allowDelete = allowDelete; + return this; + } + + /** + * Get the locations property: A list of locations. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: A list of locations. + * + * @param locations the locations value to set. + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withLocations(List locations) { + this.locations = locations; + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceAssociationLink withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinks.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinks.java new file mode 100644 index 0000000000000..fbb6793728a52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinks.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ServiceAssociationLinks. */ +public interface ServiceAssociationLinks { + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 service association links for a subnet. + */ + ServiceAssociationLinksListResult list(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 service association links for a subnet. + */ + Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinksListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinksListResult.java new file mode 100644 index 0000000000000..673ba5c9acc07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinksListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import java.util.List; + +/** An immutable client-side representation of ServiceAssociationLinksListResult. */ +public interface ServiceAssociationLinksListResult { + /** + * Gets the value property: The service association links in a subnet. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner + * object. + * + * @return the inner object. + */ + ServiceAssociationLinksListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java new file mode 100644 index 0000000000000..4c844d61fb494 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 ServiceEndpointPolicies. */ +public interface ServiceEndpointPolicies { + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceEndpointPolicyName); + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceEndpointPolicyName, Context context); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + ServiceEndpointPolicy getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context); + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the service endpoint policies 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 all the service endpoint policies in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource 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 all service endpoint Policies in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @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 the specified service Endpoint Policies in a specified resource group. + */ + ServiceEndpointPolicy getById(String id); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified service endpoint policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified service endpoint policy. + * + * @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 ServiceEndpointPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ServiceEndpointPolicy definition. + */ + ServiceEndpointPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicy.java new file mode 100644 index 0000000000000..dac9e1248f7f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicy.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ServiceEndpointPolicy. */ +public interface ServiceEndpointPolicy { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the kind property: Kind of service endpoint policy. This is metadata used for the Azure portal experience. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the serviceEndpointPolicyDefinitions property: A collection of service endpoint policy definitions of the + * service endpoint policy. + * + * @return the serviceEndpointPolicyDefinitions value. + */ + List serviceEndpointPolicyDefinitions(); + + /** + * Gets the subnets property: A collection of references to subnets. + * + * @return the subnets value. + */ + List subnets(); + + /** + * Gets the resourceGuid property: The resource GUID property of the service endpoint policy resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the service endpoint policy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.ServiceEndpointPolicyInner object. + * + * @return the inner object. + */ + ServiceEndpointPolicyInner innerModel(); + + /** The entirety of the ServiceEndpointPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ServiceEndpointPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ServiceEndpointPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ServiceEndpointPolicy 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 ServiceEndpointPolicy definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ServiceEndpointPolicy 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.WithServiceEndpointPolicyDefinitions { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServiceEndpointPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServiceEndpointPolicy create(Context context); + } + /** The stage of the ServiceEndpointPolicy 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 ServiceEndpointPolicy definition allowing to specify serviceEndpointPolicyDefinitions. */ + interface WithServiceEndpointPolicyDefinitions { + /** + * Specifies the serviceEndpointPolicyDefinitions property: A collection of service endpoint policy + * definitions of the service endpoint policy.. + * + * @param serviceEndpointPolicyDefinitions A collection of service endpoint policy definitions of the + * service endpoint policy. + * @return the next definition stage. + */ + WithCreate withServiceEndpointPolicyDefinitions( + List serviceEndpointPolicyDefinitions); + } + } + /** + * Begins update for the ServiceEndpointPolicy resource. + * + * @return the stage of resource update. + */ + ServiceEndpointPolicy.Update update(); + + /** The template for ServiceEndpointPolicy update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServiceEndpointPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServiceEndpointPolicy apply(Context context); + } + /** The ServiceEndpointPolicy update stages. */ + interface UpdateStages { + /** The stage of the ServiceEndpointPolicy 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServiceEndpointPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServiceEndpointPolicy refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinition.java new file mode 100644 index 0000000000000..689399d0a0769 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinition.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import java.util.List; + +/** An immutable client-side representation of ServiceEndpointPolicyDefinition. */ +public interface ServiceEndpointPolicyDefinition { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + String description(); + + /** + * Gets the service property: Service endpoint name. + * + * @return the service value. + */ + String service(); + + /** + * Gets the serviceResources property: A list of service resources. + * + * @return the serviceResources value. + */ + List serviceResources(); + + /** + * Gets the provisioningState property: The provisioning state of the service endpoint policy definition resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner + * object. + * + * @return the inner object. + */ + ServiceEndpointPolicyDefinitionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitionListResult.java new file mode 100644 index 0000000000000..52267d28b7672 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitionListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service endpoint policy definition + * that belongs to a service endpoint policy. + */ +@Fluent +public final class ServiceEndpointPolicyDefinitionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionListResult.class); + + /* + * The service endpoint policy definition in a service endpoint policy. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The service endpoint policy definition in a service endpoint policy. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The service endpoint policy definition in a service endpoint policy. + * + * @param value the value value to set. + * @return the ServiceEndpointPolicyDefinitionListResult object itself. + */ + public ServiceEndpointPolicyDefinitionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ServiceEndpointPolicyDefinitionListResult object itself. + */ + public ServiceEndpointPolicyDefinitionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitions.java new file mode 100644 index 0000000000000..53d30a57cf0b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitions.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; + +/** Resource collection API of ServiceEndpointPolicyDefinitions. */ +public interface ServiceEndpointPolicyDefinitions { + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context); + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition 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 specified service endpoint policy definitions from service endpoint policy. + */ + ServiceEndpointPolicyDefinition get( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition 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 specified service endpoint policy definitions from service endpoint policy. + */ + Response getWithResponse( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context); + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + ServiceEndpointPolicyDefinition createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions); + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions. + */ + ServiceEndpointPolicyDefinition createOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyListResult.java new file mode 100644 index 0000000000000..49a35ea2664ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListServiceEndpointPolicies API service call. */ +@Fluent +public final class ServiceEndpointPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyListResult.class); + + /* + * A list of ServiceEndpointPolicy resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of ServiceEndpointPolicy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ServiceEndpointPolicy resources. + * + * @param value the value value to set. + * @return the ServiceEndpointPolicyListResult object itself. + */ + public ServiceEndpointPolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPropertiesFormat.java new file mode 100644 index 0000000000000..c038f71a57b27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPropertiesFormat.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 service endpoint properties. */ +@Fluent +public final class ServiceEndpointPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPropertiesFormat.class); + + /* + * The type of the endpoint service. + */ + @JsonProperty(value = "service") + private String service; + + /* + * A list of locations. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * The provisioning state of the service endpoint resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the service property: The type of the endpoint service. + * + * @return the service value. + */ + public String service() { + return this.service; + } + + /** + * Set the service property: The type of the endpoint service. + * + * @param service the service value to set. + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withService(String service) { + this.service = service; + return this; + } + + /** + * Get the locations property: A list of locations. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: A list of locations. + * + * @param locations the locations value to set. + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the service endpoint resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.java new file mode 100644 index 0000000000000..a0c2e8931ff31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceProviderProvisioningState. */ +public final class ServiceProviderProvisioningState extends ExpandableStringEnum { + /** Static value NotProvisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState NOT_PROVISIONED = fromString("NotProvisioned"); + + /** Static value Provisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONED = fromString("Provisioned"); + + /** Static value Deprovisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState DEPROVISIONING = fromString("Deprovisioning"); + + /** + * Creates or finds a ServiceProviderProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceProviderProvisioningState. + */ + @JsonCreator + public static ServiceProviderProvisioningState fromString(String name) { + return fromString(name, ServiceProviderProvisioningState.class); + } + + /** @return known ServiceProviderProvisioningState values. */ + public static Collection values() { + return values(ServiceProviderProvisioningState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformation.java new file mode 100644 index 0000000000000..ab69580667fd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformation.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** The service tag information. */ +@Immutable +public final class ServiceTagInformation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTagInformation.class); + + /* + * Properties of the service tag information. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ServiceTagInformationPropertiesFormat properties; + + /* + * The name of service tag. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The ID of service tag. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the properties property: Properties of the service tag information. + * + * @return the properties value. + */ + public ServiceTagInformationPropertiesFormat properties() { + return this.properties; + } + + /** + * Get the name property: The name of service tag. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: The ID of service tag. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationPropertiesFormat.java new file mode 100644 index 0000000000000..69e5bcffad736 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationPropertiesFormat.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; +import java.util.List; + +/** Properties of the service tag information. */ +@Immutable +public final class ServiceTagInformationPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTagInformationPropertiesFormat.class); + + /* + * The iteration number of service tag. + */ + @JsonProperty(value = "changeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String changeNumber; + + /* + * The region of service tag. + */ + @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) + private String region; + + /* + * The name of system service. + */ + @JsonProperty(value = "systemService", access = JsonProperty.Access.WRITE_ONLY) + private String systemService; + + /* + * The list of IP address prefixes. + */ + @JsonProperty(value = "addressPrefixes", access = JsonProperty.Access.WRITE_ONLY) + private List addressPrefixes; + + /* + * The state of the service tag. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the changeNumber property: The iteration number of service tag. + * + * @return the changeNumber value. + */ + public String changeNumber() { + return this.changeNumber; + } + + /** + * Get the region property: The region of service tag. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Get the systemService property: The name of system service. + * + * @return the systemService value. + */ + public String systemService() { + return this.systemService; + } + + /** + * Get the addressPrefixes property: The list of IP address prefixes. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Get the state property: The state of the service tag. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTags.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTags.java new file mode 100644 index 0000000000000..25b793a72482f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTags.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.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ServiceTags. */ +public interface ServiceTags { + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 service tag information resources. + */ + ServiceTagsListResult list(String location); + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + Response listWithResponse(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagsListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagsListResult.java new file mode 100644 index 0000000000000..96ad8929674a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagsListResult.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; +import java.util.List; + +/** An immutable client-side representation of ServiceTagsListResult. */ +public interface ServiceTagsListResult { + /** + * Gets the name property: The name of the cloud. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ID of the cloud. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The azure resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the changeNumber property: The iteration number. + * + * @return the changeNumber value. + */ + String changeNumber(); + + /** + * Gets the cloud property: The name of the cloud. + * + * @return the cloud value. + */ + String cloud(); + + /** + * Gets the values property: The list of service tag information resources. + * + * @return the values value. + */ + List values(); + + /** + * Gets the nextLink property: The URL to get next page of service tag information resources. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner object. + * + * @return the inner object. + */ + ServiceTagsListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java new file mode 100644 index 0000000000000..b8d77f35a8e95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** List of session IDs. */ +@Fluent +public final class SessionIds { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SessionIds.class); + + /* + * List of session IDs. + */ + @JsonProperty(value = "sessionIds") + private List sessionIds; + + /** + * Get the sessionIds property: List of session IDs. + * + * @return the sessionIds value. + */ + public List sessionIds() { + return this.sessionIds; + } + + /** + * Set the sessionIds property: List of session IDs. + * + * @param sessionIds the sessionIds value to set. + * @return the SessionIds object itself. + */ + public SessionIds withSessionIds(List sessionIds) { + this.sessionIds = sessionIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Severity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Severity.java new file mode 100644 index 0000000000000..f9fee8cb9b288 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Severity.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Severity. */ +public final class Severity extends ExpandableStringEnum { + /** Static value Error for Severity. */ + public static final Severity ERROR = fromString("Error"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** @return known Severity values. */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Sku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Sku.java new file mode 100644 index 0000000000000..23a3bdde25419 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Sku.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.network.generated.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 sku of this Bastion Host. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The name of this Bastion Host. + */ + @JsonProperty(value = "name") + private BastionHostSkuName name; + + /** + * Get the name property: The name of this Bastion Host. + * + * @return the name value. + */ + public BastionHostSkuName name() { + return this.name; + } + + /** + * Set the name property: The name of this Bastion Host. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(BastionHostSkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoute.java new file mode 100644 index 0000000000000..9ecd334e6554f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoute.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.network.generated.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; + +/** List of all Static Routes. */ +@Fluent +public final class StaticRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StaticRoute.class); + + /* + * The name of the StaticRoute that is unique within a VnetRoute. + */ + @JsonProperty(value = "name") + private String name; + + /* + * List of all address prefixes. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * The ip address of the next hop. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * Get the name property: The name of the StaticRoute that is unique within a VnetRoute. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the StaticRoute that is unique within a VnetRoute. + * + * @param name the name value to set. + * @return the StaticRoute object itself. + */ + public StaticRoute withName(String name) { + this.name = name; + return this; + } + + /** + * Get the addressPrefixes property: List of all address prefixes. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: List of all address prefixes. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the StaticRoute object itself. + */ + public StaticRoute withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the nextHopIpAddress property: The ip address of the next hop. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: The ip address of the next hop. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the StaticRoute object itself. + */ + public StaticRoute withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnet.java new file mode 100644 index 0000000000000..8ab525eff8a53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnet.java @@ -0,0 +1,650 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import java.util.List; + +/** An immutable client-side representation of Subnet. */ +public interface Subnet { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the addressPrefix property: The address prefix for the subnet. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the addressPrefixes property: List of address prefixes for the subnet. + * + * @return the addressPrefixes value. + */ + List addressPrefixes(); + + /** + * Gets the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * Gets the routeTable property: The reference to the RouteTable resource. + * + * @return the routeTable value. + */ + RouteTable routeTable(); + + /** + * Gets the natGateway property: Nat gateway associated with this subnet. + * + * @return the natGateway value. + */ + SubResource natGateway(); + + /** + * Gets the serviceEndpoints property: An array of service endpoints. + * + * @return the serviceEndpoints value. + */ + List serviceEndpoints(); + + /** + * Gets the serviceEndpointPolicies property: An array of service endpoint policies. + * + * @return the serviceEndpointPolicies value. + */ + List serviceEndpointPolicies(); + + /** + * Gets the privateEndpoints property: An array of references to private endpoints. + * + * @return the privateEndpoints value. + */ + List privateEndpoints(); + + /** + * Gets the ipConfigurations property: An array of references to the network interface IP configurations using + * subnet. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the ipConfigurationProfiles property: Array of IP configuration profiles which reference this subnet. + * + * @return the ipConfigurationProfiles value. + */ + List ipConfigurationProfiles(); + + /** + * Gets the ipAllocations property: Array of IpAllocation which reference this subnet. + * + * @return the ipAllocations value. + */ + List ipAllocations(); + + /** + * Gets the resourceNavigationLinks property: An array of references to the external resources using subnet. + * + * @return the resourceNavigationLinks value. + */ + List resourceNavigationLinks(); + + /** + * Gets the serviceAssociationLinks property: An array of references to services injecting into this subnet. + * + * @return the serviceAssociationLinks value. + */ + List serviceAssociationLinks(); + + /** + * Gets the delegations property: An array of references to the delegations on the subnet. + * + * @return the delegations value. + */ + List delegations(); + + /** + * Gets the purpose property: A read-only string identifying the intention of use for this subnet based on + * delegations and other user-defined properties. + * + * @return the purpose value. + */ + String purpose(); + + /** + * Gets the provisioningState property: The provisioning state of the subnet resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on private end point + * in the subnet. + * + * @return the privateEndpointNetworkPolicies value. + */ + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies(); + + /** + * Gets the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on private link + * service in the subnet. + * + * @return the privateLinkServiceNetworkPolicies value. + */ + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies(); + + /** + * Gets the applicationGatewayIpConfigurations property: Application gateway IP configurations of virtual network + * resource. + * + * @return the applicationGatewayIpConfigurations value. + */ + List applicationGatewayIpConfigurations(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SubnetInner object. + * + * @return the inner object. + */ + SubnetInner innerModel(); + + /** The entirety of the Subnet definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Subnet definition stages. */ + interface DefinitionStages { + /** The first stage of the Subnet definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Subnet definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualNetworkName. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the next definition stage. + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + /** + * The stage of the Subnet 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.WithName, + DefinitionStages.WithType, + DefinitionStages.WithAddressPrefix, + DefinitionStages.WithAddressPrefixes, + DefinitionStages.WithNetworkSecurityGroup, + DefinitionStages.WithRouteTable, + DefinitionStages.WithNatGateway, + DefinitionStages.WithServiceEndpoints, + DefinitionStages.WithServiceEndpointPolicies, + DefinitionStages.WithIpAllocations, + DefinitionStages.WithDelegations, + DefinitionStages.WithPrivateEndpointNetworkPolicies, + DefinitionStages.WithPrivateLinkServiceNetworkPolicies, + DefinitionStages.WithApplicationGatewayIpConfigurations { + /** + * Executes the create request. + * + * @return the created resource. + */ + Subnet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Subnet create(Context context); + } + /** The stage of the Subnet definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the Subnet definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the Subnet definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The address prefix for the subnet.. + * + * @param addressPrefix The address prefix for the subnet. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the Subnet definition allowing to specify addressPrefixes. */ + interface WithAddressPrefixes { + /** + * Specifies the addressPrefixes property: List of address prefixes for the subnet.. + * + * @param addressPrefixes List of address prefixes for the subnet. + * @return the next definition stage. + */ + WithCreate withAddressPrefixes(List addressPrefixes); + } + /** The stage of the Subnet definition allowing to specify networkSecurityGroup. */ + interface WithNetworkSecurityGroup { + /** + * Specifies the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource.. + * + * @param networkSecurityGroup The reference to the NetworkSecurityGroup resource. + * @return the next definition stage. + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + /** The stage of the Subnet definition allowing to specify routeTable. */ + interface WithRouteTable { + /** + * Specifies the routeTable property: The reference to the RouteTable resource.. + * + * @param routeTable The reference to the RouteTable resource. + * @return the next definition stage. + */ + WithCreate withRouteTable(RouteTableInner routeTable); + } + /** The stage of the Subnet definition allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: Nat gateway associated with this subnet.. + * + * @param natGateway Nat gateway associated with this subnet. + * @return the next definition stage. + */ + WithCreate withNatGateway(SubResource natGateway); + } + /** The stage of the Subnet definition allowing to specify serviceEndpoints. */ + interface WithServiceEndpoints { + /** + * Specifies the serviceEndpoints property: An array of service endpoints.. + * + * @param serviceEndpoints An array of service endpoints. + * @return the next definition stage. + */ + WithCreate withServiceEndpoints(List serviceEndpoints); + } + /** The stage of the Subnet definition allowing to specify serviceEndpointPolicies. */ + interface WithServiceEndpointPolicies { + /** + * Specifies the serviceEndpointPolicies property: An array of service endpoint policies.. + * + * @param serviceEndpointPolicies An array of service endpoint policies. + * @return the next definition stage. + */ + WithCreate withServiceEndpointPolicies(List serviceEndpointPolicies); + } + /** The stage of the Subnet definition allowing to specify ipAllocations. */ + interface WithIpAllocations { + /** + * Specifies the ipAllocations property: Array of IpAllocation which reference this subnet.. + * + * @param ipAllocations Array of IpAllocation which reference this subnet. + * @return the next definition stage. + */ + WithCreate withIpAllocations(List ipAllocations); + } + /** The stage of the Subnet definition allowing to specify delegations. */ + interface WithDelegations { + /** + * Specifies the delegations property: An array of references to the delegations on the subnet.. + * + * @param delegations An array of references to the delegations on the subnet. + * @return the next definition stage. + */ + WithCreate withDelegations(List delegations); + } + /** The stage of the Subnet definition allowing to specify privateEndpointNetworkPolicies. */ + interface WithPrivateEndpointNetworkPolicies { + /** + * Specifies the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on + * private end point in the subnet.. + * + * @param privateEndpointNetworkPolicies Enable or Disable apply network policies on private end point in + * the subnet. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies); + } + /** The stage of the Subnet definition allowing to specify privateLinkServiceNetworkPolicies. */ + interface WithPrivateLinkServiceNetworkPolicies { + /** + * Specifies the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on + * private link service in the subnet.. + * + * @param privateLinkServiceNetworkPolicies Enable or Disable apply network policies on private link service + * in the subnet. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies); + } + /** The stage of the Subnet definition allowing to specify applicationGatewayIpConfigurations. */ + interface WithApplicationGatewayIpConfigurations { + /** + * Specifies the applicationGatewayIpConfigurations property: Application gateway IP configurations of + * virtual network resource.. + * + * @param applicationGatewayIpConfigurations Application gateway IP configurations of virtual network + * resource. + * @return the next definition stage. + */ + WithCreate withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations); + } + } + /** + * Begins update for the Subnet resource. + * + * @return the stage of resource update. + */ + Subnet.Update update(); + + /** The template for Subnet update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithAddressPrefix, + UpdateStages.WithAddressPrefixes, + UpdateStages.WithNetworkSecurityGroup, + UpdateStages.WithRouteTable, + UpdateStages.WithNatGateway, + UpdateStages.WithServiceEndpoints, + UpdateStages.WithServiceEndpointPolicies, + UpdateStages.WithIpAllocations, + UpdateStages.WithDelegations, + UpdateStages.WithPrivateEndpointNetworkPolicies, + UpdateStages.WithPrivateLinkServiceNetworkPolicies, + UpdateStages.WithApplicationGatewayIpConfigurations { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Subnet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Subnet apply(Context context); + } + /** The Subnet update stages. */ + interface UpdateStages { + /** The stage of the Subnet update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the Subnet update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the Subnet update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The address prefix for the subnet.. + * + * @param addressPrefix The address prefix for the subnet. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the Subnet update allowing to specify addressPrefixes. */ + interface WithAddressPrefixes { + /** + * Specifies the addressPrefixes property: List of address prefixes for the subnet.. + * + * @param addressPrefixes List of address prefixes for the subnet. + * @return the next definition stage. + */ + Update withAddressPrefixes(List addressPrefixes); + } + /** The stage of the Subnet update allowing to specify networkSecurityGroup. */ + interface WithNetworkSecurityGroup { + /** + * Specifies the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource.. + * + * @param networkSecurityGroup The reference to the NetworkSecurityGroup resource. + * @return the next definition stage. + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + /** The stage of the Subnet update allowing to specify routeTable. */ + interface WithRouteTable { + /** + * Specifies the routeTable property: The reference to the RouteTable resource.. + * + * @param routeTable The reference to the RouteTable resource. + * @return the next definition stage. + */ + Update withRouteTable(RouteTableInner routeTable); + } + /** The stage of the Subnet update allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: Nat gateway associated with this subnet.. + * + * @param natGateway Nat gateway associated with this subnet. + * @return the next definition stage. + */ + Update withNatGateway(SubResource natGateway); + } + /** The stage of the Subnet update allowing to specify serviceEndpoints. */ + interface WithServiceEndpoints { + /** + * Specifies the serviceEndpoints property: An array of service endpoints.. + * + * @param serviceEndpoints An array of service endpoints. + * @return the next definition stage. + */ + Update withServiceEndpoints(List serviceEndpoints); + } + /** The stage of the Subnet update allowing to specify serviceEndpointPolicies. */ + interface WithServiceEndpointPolicies { + /** + * Specifies the serviceEndpointPolicies property: An array of service endpoint policies.. + * + * @param serviceEndpointPolicies An array of service endpoint policies. + * @return the next definition stage. + */ + Update withServiceEndpointPolicies(List serviceEndpointPolicies); + } + /** The stage of the Subnet update allowing to specify ipAllocations. */ + interface WithIpAllocations { + /** + * Specifies the ipAllocations property: Array of IpAllocation which reference this subnet.. + * + * @param ipAllocations Array of IpAllocation which reference this subnet. + * @return the next definition stage. + */ + Update withIpAllocations(List ipAllocations); + } + /** The stage of the Subnet update allowing to specify delegations. */ + interface WithDelegations { + /** + * Specifies the delegations property: An array of references to the delegations on the subnet.. + * + * @param delegations An array of references to the delegations on the subnet. + * @return the next definition stage. + */ + Update withDelegations(List delegations); + } + /** The stage of the Subnet update allowing to specify privateEndpointNetworkPolicies. */ + interface WithPrivateEndpointNetworkPolicies { + /** + * Specifies the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on + * private end point in the subnet.. + * + * @param privateEndpointNetworkPolicies Enable or Disable apply network policies on private end point in + * the subnet. + * @return the next definition stage. + */ + Update withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies); + } + /** The stage of the Subnet update allowing to specify privateLinkServiceNetworkPolicies. */ + interface WithPrivateLinkServiceNetworkPolicies { + /** + * Specifies the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on + * private link service in the subnet.. + * + * @param privateLinkServiceNetworkPolicies Enable or Disable apply network policies on private link service + * in the subnet. + * @return the next definition stage. + */ + Update withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies); + } + /** The stage of the Subnet update allowing to specify applicationGatewayIpConfigurations. */ + interface WithApplicationGatewayIpConfigurations { + /** + * Specifies the applicationGatewayIpConfigurations property: Application gateway IP configurations of + * virtual network resource.. + * + * @param applicationGatewayIpConfigurations Application gateway IP configurations of virtual network + * resource. + * @return the next definition stage. + */ + Update withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Subnet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Subnet refresh(Context context); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 prepareNetworkPolicies(PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 prepareNetworkPolicies(PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Context context); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 unprepareNetworkPolicies(UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 unprepareNetworkPolicies( + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java new file mode 100644 index 0000000000000..8138795c94b8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet and it's custom security rules. */ +@Fluent +public final class SubnetAssociation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetAssociation.class); + + /* + * Subnet ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get the id property: Subnet ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the securityRules property: Collection of custom security rules. + * + * @return the securityRules value. + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set the securityRules property: Collection of custom security rules. + * + * @param securityRules the securityRules value to set. + * @return the SubnetAssociation object itself. + */ + public SubnetAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityRules() != null) { + securityRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetListResult.java new file mode 100644 index 0000000000000..20a15a9964366 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. */ +@Fluent +public final class SubnetListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetListResult.class); + + /* + * The subnets in a virtual network. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The subnets in a virtual network. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The subnets in a virtual network. + * + * @param value the value value to set. + * @return the SubnetListResult object itself. + */ + public SubnetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the SubnetListResult object itself. + */ + public SubnetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnets.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnets.java new file mode 100644 index 0000000000000..7d30f3dda7d1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnets.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 Subnets. */ +public interface Subnets { + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String subnetName); + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String subnetName, Context context); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + Subnet get(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + PagedIterable list(String resourceGroupName, String virtualNetworkName); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @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 the specified subnet by virtual network and resource group. + */ + Subnet getById(String id); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified subnet. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified subnet. + * + * @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 Subnet resource. + * + * @param name resource name. + * @return the first stage of the new Subnet definition. + */ + Subnet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncRemoteAddressSpace.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncRemoteAddressSpace.java new file mode 100644 index 0000000000000..6d15a21080667 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncRemoteAddressSpace.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SyncRemoteAddressSpace. */ +public final class SyncRemoteAddressSpace extends ExpandableStringEnum { + /** Static value true for SyncRemoteAddressSpace. */ + public static final SyncRemoteAddressSpace TRUE = fromString("true"); + + /** + * Creates or finds a SyncRemoteAddressSpace from its string representation. + * + * @param name a name to look for. + * @return the corresponding SyncRemoteAddressSpace. + */ + @JsonCreator + public static SyncRemoteAddressSpace fromString(String name) { + return fromString(name, SyncRemoteAddressSpace.class); + } + + /** @return known SyncRemoteAddressSpace values. */ + public static Collection values() { + return values(SyncRemoteAddressSpace.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TagsObject.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TagsObject.java new file mode 100644 index 0000000000000..c6a9c40063b51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TagsObject.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.Map; + +/** Tags object for patch operations. */ +@Fluent +public final class TagsObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsObject.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java new file mode 100644 index 0000000000000..5cab2dbe7ab52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Topology. */ +public interface Topology { + /** + * Gets the id property: GUID representing the operation id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the createdDateTime property: The datetime when the topology was initially created for the resource group. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the lastModified property: The datetime when the topology was last modified. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the resources property: A list of topology resources. + * + * @return the resources value. + */ + List resources(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.TopologyInner object. + * + * @return the inner object. + */ + TopologyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.java new file mode 100644 index 0000000000000..145717c78ec14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.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.network.generated.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; + +/** Resources that have an association with the parent resource. */ +@Fluent +public final class TopologyAssociation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyAssociation.class); + + /* + * The name of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The association type of the child resource to the parent resource. + */ + @JsonProperty(value = "associationType") + private AssociationType associationType; + + /** + * Get the name property: The name of the resource that is associated with the parent resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is associated with the parent resource. + * + * @param name the name value to set. + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resourceId property: The ID of the resource that is associated with the parent resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource that is associated with the parent resource. + * + * @param resourceId the resourceId value to set. + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the associationType property: The association type of the child resource to the parent resource. + * + * @return the associationType value. + */ + public AssociationType associationType() { + return this.associationType; + } + + /** + * Set the associationType property: The association type of the child resource to the parent resource. + * + * @param associationType the associationType value to set. + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withAssociationType(AssociationType associationType) { + this.associationType = associationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyParameters.java new file mode 100644 index 0000000000000..6a92e8c2f962a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyParameters.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the representation of topology. */ +@Fluent +public final class TopologyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyParameters.class); + + /* + * The name of the target resource group to perform topology on. + */ + @JsonProperty(value = "targetResourceGroupName") + private String targetResourceGroupName; + + /* + * The reference to the Virtual Network resource. + */ + @JsonProperty(value = "targetVirtualNetwork") + private SubResource targetVirtualNetwork; + + /* + * The reference to the Subnet resource. + */ + @JsonProperty(value = "targetSubnet") + private SubResource targetSubnet; + + /** + * Get the targetResourceGroupName property: The name of the target resource group to perform topology on. + * + * @return the targetResourceGroupName value. + */ + public String targetResourceGroupName() { + return this.targetResourceGroupName; + } + + /** + * Set the targetResourceGroupName property: The name of the target resource group to perform topology on. + * + * @param targetResourceGroupName the targetResourceGroupName value to set. + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetResourceGroupName(String targetResourceGroupName) { + this.targetResourceGroupName = targetResourceGroupName; + return this; + } + + /** + * Get the targetVirtualNetwork property: The reference to the Virtual Network resource. + * + * @return the targetVirtualNetwork value. + */ + public SubResource targetVirtualNetwork() { + return this.targetVirtualNetwork; + } + + /** + * Set the targetVirtualNetwork property: The reference to the Virtual Network resource. + * + * @param targetVirtualNetwork the targetVirtualNetwork value to set. + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetVirtualNetwork(SubResource targetVirtualNetwork) { + this.targetVirtualNetwork = targetVirtualNetwork; + return this; + } + + /** + * Get the targetSubnet property: The reference to the Subnet resource. + * + * @return the targetSubnet value. + */ + public SubResource targetSubnet() { + return this.targetSubnet; + } + + /** + * Set the targetSubnet property: The reference to the Subnet resource. + * + * @param targetSubnet the targetSubnet value to set. + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetSubnet(SubResource targetSubnet) { + this.targetSubnet = targetSubnet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyResource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyResource.java new file mode 100644 index 0000000000000..8c5057604c6b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyResource.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 network resource topology information for the given resource group. */ +@Fluent +public final class TopologyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyResource.class); + + /* + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * ID of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Holds the associations the resource has with other resources in the + * resource group. + */ + @JsonProperty(value = "associations") + private List associations; + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource. + * + * @param name the name value to set. + * @return the TopologyResource object itself. + */ + public TopologyResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: ID of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID of the resource. + * + * @param id the id value to set. + * @return the TopologyResource object itself. + */ + public TopologyResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the TopologyResource object itself. + */ + public TopologyResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the associations property: Holds the associations the resource has with other resources in the resource + * group. + * + * @return the associations value. + */ + public List associations() { + return this.associations; + } + + /** + * Set the associations property: Holds the associations the resource has with other resources in the resource + * group. + * + * @param associations the associations value to set. + * @return the TopologyResource object itself. + */ + public TopologyResource withAssociations(List associations) { + this.associations = associations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (associations() != null) { + associations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsConfigurationProperties.java new file mode 100644 index 0000000000000..d35f90884f7d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsConfigurationProperties.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.network.generated.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; + +/** Parameters that define the configuration of traffic analytics. */ +@Fluent +public final class TrafficAnalyticsConfigurationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficAnalyticsConfigurationProperties.class); + + /* + * Flag to enable/disable traffic analytics. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The resource guid of the attached workspace. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /* + * The location of the attached workspace. + */ + @JsonProperty(value = "workspaceRegion") + private String workspaceRegion; + + /* + * Resource Id of the attached workspace. + */ + @JsonProperty(value = "workspaceResourceId") + private String workspaceResourceId; + + /* + * The interval in minutes which would decide how frequently TA service + * should do flow analytics. + */ + @JsonProperty(value = "trafficAnalyticsInterval") + private Integer trafficAnalyticsInterval; + + /** + * Get the enabled property: Flag to enable/disable traffic analytics. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Flag to enable/disable traffic analytics. + * + * @param enabled the enabled value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the workspaceId property: The resource guid of the attached workspace. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The resource guid of the attached workspace. + * + * @param workspaceId the workspaceId value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the workspaceRegion property: The location of the attached workspace. + * + * @return the workspaceRegion value. + */ + public String workspaceRegion() { + return this.workspaceRegion; + } + + /** + * Set the workspaceRegion property: The location of the attached workspace. + * + * @param workspaceRegion the workspaceRegion value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceRegion(String workspaceRegion) { + this.workspaceRegion = workspaceRegion; + return this; + } + + /** + * Get the workspaceResourceId property: Resource Id of the attached workspace. + * + * @return the workspaceResourceId value. + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set the workspaceResourceId property: Resource Id of the attached workspace. + * + * @param workspaceResourceId the workspaceResourceId value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + + /** + * Get the trafficAnalyticsInterval property: The interval in minutes which would decide how frequently TA service + * should do flow analytics. + * + * @return the trafficAnalyticsInterval value. + */ + public Integer trafficAnalyticsInterval() { + return this.trafficAnalyticsInterval; + } + + /** + * Set the trafficAnalyticsInterval property: The interval in minutes which would decide how frequently TA service + * should do flow analytics. + * + * @param trafficAnalyticsInterval the trafficAnalyticsInterval value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withTrafficAnalyticsInterval(Integer trafficAnalyticsInterval) { + this.trafficAnalyticsInterval = trafficAnalyticsInterval; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsProperties.java new file mode 100644 index 0000000000000..8d9ed17473da8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsProperties.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.network.generated.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; + +/** Parameters that define the configuration of traffic analytics. */ +@Fluent +public final class TrafficAnalyticsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficAnalyticsProperties.class); + + /* + * Parameters that define the configuration of traffic analytics. + */ + @JsonProperty(value = "networkWatcherFlowAnalyticsConfiguration") + private TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration; + + /** + * Get the networkWatcherFlowAnalyticsConfiguration property: Parameters that define the configuration of traffic + * analytics. + * + * @return the networkWatcherFlowAnalyticsConfiguration value. + */ + public TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration() { + return this.networkWatcherFlowAnalyticsConfiguration; + } + + /** + * Set the networkWatcherFlowAnalyticsConfiguration property: Parameters that define the configuration of traffic + * analytics. + * + * @param networkWatcherFlowAnalyticsConfiguration the networkWatcherFlowAnalyticsConfiguration value to set. + * @return the TrafficAnalyticsProperties object itself. + */ + public TrafficAnalyticsProperties withNetworkWatcherFlowAnalyticsConfiguration( + TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration) { + this.networkWatcherFlowAnalyticsConfiguration = networkWatcherFlowAnalyticsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkWatcherFlowAnalyticsConfiguration() != null) { + networkWatcherFlowAnalyticsConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficSelectorPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficSelectorPolicy.java new file mode 100644 index 0000000000000..b3cc6313ad490 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficSelectorPolicy.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 traffic selector policy for a virtual network gateway connection. */ +@Fluent +public final class TrafficSelectorPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficSelectorPolicy.class); + + /* + * A collection of local address spaces in CIDR format. + */ + @JsonProperty(value = "localAddressRanges", required = true) + private List localAddressRanges; + + /* + * A collection of remote address spaces in CIDR format. + */ + @JsonProperty(value = "remoteAddressRanges", required = true) + private List remoteAddressRanges; + + /** + * Get the localAddressRanges property: A collection of local address spaces in CIDR format. + * + * @return the localAddressRanges value. + */ + public List localAddressRanges() { + return this.localAddressRanges; + } + + /** + * Set the localAddressRanges property: A collection of local address spaces in CIDR format. + * + * @param localAddressRanges the localAddressRanges value to set. + * @return the TrafficSelectorPolicy object itself. + */ + public TrafficSelectorPolicy withLocalAddressRanges(List localAddressRanges) { + this.localAddressRanges = localAddressRanges; + return this; + } + + /** + * Get the remoteAddressRanges property: A collection of remote address spaces in CIDR format. + * + * @return the remoteAddressRanges value. + */ + public List remoteAddressRanges() { + return this.remoteAddressRanges; + } + + /** + * Set the remoteAddressRanges property: A collection of remote address spaces in CIDR format. + * + * @param remoteAddressRanges the remoteAddressRanges value to set. + * @return the TrafficSelectorPolicy object itself. + */ + public TrafficSelectorPolicy withRemoteAddressRanges(List remoteAddressRanges) { + this.remoteAddressRanges = remoteAddressRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (localAddressRanges() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localAddressRanges in model TrafficSelectorPolicy")); + } + if (remoteAddressRanges() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remoteAddressRanges in model TrafficSelectorPolicy")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TransportProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TransportProtocol.java new file mode 100644 index 0000000000000..e1e0cc7b117d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TransportProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TransportProtocol. */ +public final class TransportProtocol extends ExpandableStringEnum { + /** Static value Udp for TransportProtocol. */ + public static final TransportProtocol UDP = fromString("Udp"); + + /** Static value Tcp for TransportProtocol. */ + public static final TransportProtocol TCP = fromString("Tcp"); + + /** Static value All for TransportProtocol. */ + public static final TransportProtocol ALL = fromString("All"); + + /** + * Creates or finds a TransportProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransportProtocol. + */ + @JsonCreator + public static TransportProtocol fromString(String name) { + return fromString(name, TransportProtocol.class); + } + + /** @return known TransportProtocol values. */ + public static Collection values() { + return values(TransportProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingDetails.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingDetails.java new file mode 100644 index 0000000000000..973ecd1422a5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingDetails.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Information gained from troubleshooting of specified resource. */ +@Fluent +public final class TroubleshootingDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingDetails.class); + + /* + * The id of the get troubleshoot operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Reason type of failure. + */ + @JsonProperty(value = "reasonType") + private String reasonType; + + /* + * A summary of troubleshooting. + */ + @JsonProperty(value = "summary") + private String summary; + + /* + * Details on troubleshooting results. + */ + @JsonProperty(value = "detail") + private String detail; + + /* + * List of recommended actions. + */ + @JsonProperty(value = "recommendedActions") + private List recommendedActions; + + /** + * Get the id property: The id of the get troubleshoot operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id of the get troubleshoot operation. + * + * @param id the id value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withId(String id) { + this.id = id; + return this; + } + + /** + * Get the reasonType property: Reason type of failure. + * + * @return the reasonType value. + */ + public String reasonType() { + return this.reasonType; + } + + /** + * Set the reasonType property: Reason type of failure. + * + * @param reasonType the reasonType value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withReasonType(String reasonType) { + this.reasonType = reasonType; + return this; + } + + /** + * Get the summary property: A summary of troubleshooting. + * + * @return the summary value. + */ + public String summary() { + return this.summary; + } + + /** + * Set the summary property: A summary of troubleshooting. + * + * @param summary the summary value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withSummary(String summary) { + this.summary = summary; + return this; + } + + /** + * Get the detail property: Details on troubleshooting results. + * + * @return the detail value. + */ + public String detail() { + return this.detail; + } + + /** + * Set the detail property: Details on troubleshooting results. + * + * @param detail the detail value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withDetail(String detail) { + this.detail = detail; + return this; + } + + /** + * Get the recommendedActions property: List of recommended actions. + * + * @return the recommendedActions value. + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * Set the recommendedActions property: List of recommended actions. + * + * @param recommendedActions the recommendedActions value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withRecommendedActions(List recommendedActions) { + this.recommendedActions = recommendedActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recommendedActions() != null) { + recommendedActions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingParameters.java new file mode 100644 index 0000000000000..3e657f141b882 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingParameters.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters that define the resource to troubleshoot. */ +@JsonFlatten +@Fluent +public class TroubleshootingParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingParameters.class); + + /* + * The target resource to troubleshoot. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * The ID for the storage account to save the troubleshoot result. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /* + * The path to the blob to save the troubleshoot result in. + */ + @JsonProperty(value = "properties.storagePath", required = true) + private String storagePath; + + /** + * Get the targetResourceId property: The target resource to troubleshoot. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The target resource to troubleshoot. + * + * @param targetResourceId the targetResourceId value to set. + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the storageId property: The ID for the storage account to save the troubleshoot result. + * + * @return the storageId value. + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the storageId property: The ID for the storage account to save the troubleshoot result. + * + * @param storageId the storageId value to set. + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the storagePath property: The path to the blob to save the troubleshoot result in. + * + * @return the storagePath value. + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the storagePath property: The path to the blob to save the troubleshoot result in. + * + * @param storagePath the storagePath value to set. + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model TroubleshootingParameters")); + } + if (storageId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageId in model TroubleshootingParameters")); + } + if (storagePath() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storagePath in model TroubleshootingParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingRecommendedActions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingRecommendedActions.java new file mode 100644 index 0000000000000..c19f6f8cf3f1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingRecommendedActions.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Recommended actions based on discovered issues. */ +@Fluent +public final class TroubleshootingRecommendedActions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingRecommendedActions.class); + + /* + * ID of the recommended action. + */ + @JsonProperty(value = "actionId") + private String actionId; + + /* + * Description of recommended actions. + */ + @JsonProperty(value = "actionText") + private String actionText; + + /* + * The uri linking to a documentation for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUri") + private String actionUri; + + /* + * The information from the URI for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUriText") + private String actionUriText; + + /** + * Get the actionId property: ID of the recommended action. + * + * @return the actionId value. + */ + public String actionId() { + return this.actionId; + } + + /** + * Set the actionId property: ID of the recommended action. + * + * @param actionId the actionId value to set. + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionId(String actionId) { + this.actionId = actionId; + return this; + } + + /** + * Get the actionText property: Description of recommended actions. + * + * @return the actionText value. + */ + public String actionText() { + return this.actionText; + } + + /** + * Set the actionText property: Description of recommended actions. + * + * @param actionText the actionText value to set. + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionText(String actionText) { + this.actionText = actionText; + return this; + } + + /** + * Get the actionUri property: The uri linking to a documentation for the recommended troubleshooting actions. + * + * @return the actionUri value. + */ + public String actionUri() { + return this.actionUri; + } + + /** + * Set the actionUri property: The uri linking to a documentation for the recommended troubleshooting actions. + * + * @param actionUri the actionUri value to set. + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUri(String actionUri) { + this.actionUri = actionUri; + return this; + } + + /** + * Get the actionUriText property: The information from the URI for the recommended troubleshooting actions. + * + * @return the actionUriText value. + */ + public String actionUriText() { + return this.actionUriText; + } + + /** + * Set the actionUriText property: The information from the URI for the recommended troubleshooting actions. + * + * @param actionUriText the actionUriText value to set. + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUriText(String actionUriText) { + this.actionUriText = actionUriText; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java new file mode 100644 index 0000000000000..396ee77e84a26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of TroubleshootingResult. */ +public interface TroubleshootingResult { + /** + * Gets the startTime property: The start time of the troubleshooting. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the troubleshooting. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the code property: The result code of the troubleshooting. + * + * @return the code value. + */ + String code(); + + /** + * Gets the results property: Information from troubleshooting. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner object. + * + * @return the inner object. + */ + TroubleshootingResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java new file mode 100644 index 0000000000000..83dfcfe339cbd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** VirtualNetworkGatewayConnection properties. */ +@Immutable +public final class TunnelConnectionHealth { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TunnelConnectionHealth.class); + + /* + * Tunnel name. + */ + @JsonProperty(value = "tunnel", access = JsonProperty.Access.WRITE_ONLY) + private String tunnel; + + /* + * Virtual Network Gateway connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * The Ingress Bytes Transferred in this connection. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The time at which connection was established in Utc format. + */ + @JsonProperty(value = "lastConnectionEstablishedUtcTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastConnectionEstablishedUtcTime; + + /** + * Get the tunnel property: Tunnel name. + * + * @return the tunnel value. + */ + public String tunnel() { + return this.tunnel; + } + + /** + * Get the connectionStatus property: Virtual Network Gateway connection status. + * + * @return the connectionStatus value. + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the ingressBytesTransferred property: The Ingress Bytes Transferred in this connection. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the egressBytesTransferred property: The Egress Bytes Transferred in this connection. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the lastConnectionEstablishedUtcTime property: The time at which connection was established in Utc format. + * + * @return the lastConnectionEstablishedUtcTime value. + */ + public String lastConnectionEstablishedUtcTime() { + return this.lastConnectionEstablishedUtcTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UnprepareNetworkPoliciesRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UnprepareNetworkPoliciesRequest.java new file mode 100644 index 0000000000000..0ed72167a0f3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UnprepareNetworkPoliciesRequest.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.network.generated.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; + +/** Details of UnprepareNetworkPolicies for Subnet. */ +@Fluent +public final class UnprepareNetworkPoliciesRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnprepareNetworkPoliciesRequest.class); + + /* + * The name of the service for which subnet is being unprepared for. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /** + * Get the serviceName property: The name of the service for which subnet is being unprepared for. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the service for which subnet is being unprepared for. + * + * @param serviceName the serviceName value to set. + * @return the UnprepareNetworkPoliciesRequest object itself. + */ + public UnprepareNetworkPoliciesRequest withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.java new file mode 100644 index 0000000000000..498b78749eae1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; + +/** An immutable client-side representation of Usage. */ +public interface Usage { + /** + * Gets the id property: Resource identifier. + * + * @return the id value. + */ + String id(); + + /** + * Gets the unit property: An enum describing the unit of measurement. + * + * @return the unit value. + */ + UsageUnit unit(); + + /** + * Gets the currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + long currentValue(); + + /** + * Gets the limit property: The limit of usage. + * + * @return the limit value. + */ + long limit(); + + /** + * Gets the name property: The name of the type of usage. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.java new file mode 100644 index 0000000000000..f6b2d101d7605 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.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.network.generated.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 usage names. */ +@Fluent +public final class UsageName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); + + /* + * A string describing the resource name. + */ + @JsonProperty(value = "value") + private String value; + + /* + * A localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the value property: A string describing the resource name. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: A string describing the resource name. + * + * @param value the value value to set. + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: A localized string describing the resource name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: A localized string describing the resource name. + * + * @param localizedValue the localizedValue value to set. + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageUnit.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageUnit.java new file mode 100644 index 0000000000000..944945399e69b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageUnit.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UsageUnit. */ +public final class UsageUnit extends ExpandableStringEnum { + /** Static value Count for UsageUnit. */ + public static final UsageUnit COUNT = fromString("Count"); + + /** + * Creates or finds a UsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsageUnit. + */ + @JsonCreator + public static UsageUnit fromString(String name) { + return fromString(name, UsageUnit.class); + } + + /** @return known UsageUnit values. */ + public static Collection values() { + return values(UsageUnit.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usages.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usages.java new file mode 100644 index 0000000000000..c53c47229d9fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usages.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.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + PagedIterable list(String location); + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsagesListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsagesListResult.java new file mode 100644 index 0000000000000..42f9abbb0542b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsagesListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list usages operation response. */ +@Fluent +public final class UsagesListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesListResult.class); + + /* + * The list network resource usages. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list network resource usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list network resource usages. + * + * @param value the value value to set. + * @return the UsagesListResult object itself. + */ + public UsagesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the UsagesListResult object itself. + */ + public UsagesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VM.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VM.java new file mode 100644 index 0000000000000..80adb222c5add --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VM.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine. */ +@Fluent +public final class VM extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VM.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VM object itself. + */ + public VM withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VM withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VM withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.java new file mode 100644 index 0000000000000..c955fefbb3ca3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VerbosityLevel. */ +public final class VerbosityLevel extends ExpandableStringEnum { + /** Static value Normal for VerbosityLevel. */ + public static final VerbosityLevel NORMAL = fromString("Normal"); + + /** Static value Minimum for VerbosityLevel. */ + public static final VerbosityLevel MINIMUM = fromString("Minimum"); + + /** Static value Full for VerbosityLevel. */ + public static final VerbosityLevel FULL = fromString("Full"); + + /** + * Creates or finds a VerbosityLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding VerbosityLevel. + */ + @JsonCreator + public static VerbosityLevel fromString(String name) { + return fromString(name, VerbosityLevel.class); + } + + /** @return known VerbosityLevel values. */ + public static Collection values() { + return values(VerbosityLevel.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowParameters.java new file mode 100644 index 0000000000000..d2aa46ad8926e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowParameters.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Parameters that define the IP flow to be verified. */ +@Fluent +public final class VerificationIpFlowParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VerificationIpFlowParameters.class); + + /* + * The ID of the target resource to perform next-hop on. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * The direction of the packet represented as a 5-tuple. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /* + * Protocol to be verified on. + */ + @JsonProperty(value = "protocol", required = true) + private IpFlowProtocol protocol; + + /* + * The local port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "localPort", required = true) + private String localPort; + + /* + * The remote port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "remotePort", required = true) + private String remotePort; + + /* + * The local IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "localIPAddress", required = true) + private String localIpAddress; + + /* + * The remote IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "remoteIPAddress", required = true) + private String remoteIpAddress; + + /* + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of them, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the targetResourceId property: The ID of the target resource to perform next-hop on. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The ID of the target resource to perform next-hop on. + * + * @param targetResourceId the targetResourceId value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the direction property: The direction of the packet represented as a 5-tuple. + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of the packet represented as a 5-tuple. + * + * @param direction the direction value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get the protocol property: Protocol to be verified on. + * + * @return the protocol value. + */ + public IpFlowProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol to be verified on. + * + * @param protocol the protocol value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withProtocol(IpFlowProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the localPort property: The local port. Acceptable values are a single integer in the range (0-65535). + * Support for * for the source port, which depends on the direction. + * + * @return the localPort value. + */ + public String localPort() { + return this.localPort; + } + + /** + * Set the localPort property: The local port. Acceptable values are a single integer in the range (0-65535). + * Support for * for the source port, which depends on the direction. + * + * @param localPort the localPort value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get the remotePort property: The remote port. Acceptable values are a single integer in the range (0-65535). + * Support for * for the source port, which depends on the direction. + * + * @return the remotePort value. + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set the remotePort property: The remote port. Acceptable values are a single integer in the range (0-65535). + * Support for * for the source port, which depends on the direction. + * + * @param remotePort the remotePort value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + + /** + * Get the localIpAddress property: The local IP address. Acceptable values are valid IPv4 addresses. + * + * @return the localIpAddress value. + */ + public String localIpAddress() { + return this.localIpAddress; + } + + /** + * Set the localIpAddress property: The local IP address. Acceptable values are valid IPv4 addresses. + * + * @param localIpAddress the localIpAddress value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withLocalIpAddress(String localIpAddress) { + this.localIpAddress = localIpAddress; + return this; + } + + /** + * Get the remoteIpAddress property: The remote IP address. Acceptable values are valid IPv4 addresses. + * + * @return the remoteIpAddress value. + */ + public String remoteIpAddress() { + return this.remoteIpAddress; + } + + /** + * Set the remoteIpAddress property: The remote IP address. Acceptable values are valid IPv4 addresses. + * + * @param remoteIpAddress the remoteIpAddress value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withRemoteIpAddress(String remoteIpAddress) { + this.remoteIpAddress = remoteIpAddress; + return this; + } + + /** + * Get the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of + * them, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value. + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of + * them, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model VerificationIpFlowParameters")); + } + if (direction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property direction in model VerificationIpFlowParameters")); + } + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model VerificationIpFlowParameters")); + } + if (localPort() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localPort in model VerificationIpFlowParameters")); + } + if (remotePort() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remotePort in model VerificationIpFlowParameters")); + } + if (localIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localIpAddress in model VerificationIpFlowParameters")); + } + if (remoteIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remoteIpAddress in model VerificationIpFlowParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.java new file mode 100644 index 0000000000000..37a83526cf2ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; + +/** An immutable client-side representation of VerificationIpFlowResult. */ +public interface VerificationIpFlowResult { + /** + * Gets the access property: Indicates whether the traffic is allowed or denied. + * + * @return the access value. + */ + Access access(); + + /** + * Gets the ruleName property: Name of the rule. If input is not matched against any security rule, it is not + * displayed. + * + * @return the ruleName value. + */ + String ruleName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner object. + * + * @return the inner object. + */ + VerificationIpFlowResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNicProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNicProperties.java new file mode 100644 index 0000000000000..5e058362ed04b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNicProperties.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.network.generated.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; + +/** Network Virtual Appliance NIC properties. */ +@Immutable +public final class VirtualApplianceNicProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceNicProperties.class); + + /* + * NIC name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Public IP address. + */ + @JsonProperty(value = "publicIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String publicIpAddress; + + /* + * Private IP address. + */ + @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /** + * Get the name property: NIC name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the publicIpAddress property: Public IP address. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Get the privateIpAddress property: Private IP address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java new file mode 100644 index 0000000000000..1afd049f7f3d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.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.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; + +/** An immutable client-side representation of VirtualApplianceSite. */ +public interface VirtualApplianceSite { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the virtual appliance site. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Site type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the addressPrefix property: Address Prefix. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the o365Policy property: Office 365 Policy. + * + * @return the o365Policy value. + */ + Office365PolicyProperties o365Policy(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner object. + * + * @return the inner object. + */ + VirtualApplianceSiteInner innerModel(); + + /** The entirety of the VirtualApplianceSite definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualApplianceSite definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualApplianceSite definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualApplianceSite definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkVirtualApplianceName. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @return the next definition stage. + */ + WithCreate withExistingNetworkVirtualAppliance( + String resourceGroupName, String networkVirtualApplianceName); + } + /** + * The stage of the VirtualApplianceSite 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.WithName, DefinitionStages.WithAddressPrefix, DefinitionStages.WithO365Policy { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualApplianceSite create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualApplianceSite create(Context context); + } + /** The stage of the VirtualApplianceSite definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the virtual appliance site.. + * + * @param name Name of the virtual appliance site. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualApplianceSite definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: Address Prefix.. + * + * @param addressPrefix Address Prefix. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the VirtualApplianceSite definition allowing to specify o365Policy. */ + interface WithO365Policy { + /** + * Specifies the o365Policy property: Office 365 Policy.. + * + * @param o365Policy Office 365 Policy. + * @return the next definition stage. + */ + WithCreate withO365Policy(Office365PolicyProperties o365Policy); + } + } + /** + * Begins update for the VirtualApplianceSite resource. + * + * @return the stage of resource update. + */ + VirtualApplianceSite.Update update(); + + /** The template for VirtualApplianceSite update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithAddressPrefix, UpdateStages.WithO365Policy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualApplianceSite apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualApplianceSite apply(Context context); + } + /** The VirtualApplianceSite update stages. */ + interface UpdateStages { + /** The stage of the VirtualApplianceSite update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the virtual appliance site.. + * + * @param name Name of the virtual appliance site. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VirtualApplianceSite update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: Address Prefix.. + * + * @param addressPrefix Address Prefix. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the VirtualApplianceSite update allowing to specify o365Policy. */ + interface WithO365Policy { + /** + * Specifies the o365Policy property: Office 365 Policy.. + * + * @param o365Policy Office 365 Policy. + * @return the next definition stage. + */ + Update withO365Policy(Office365PolicyProperties o365Policy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualApplianceSite refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualApplianceSite refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSites.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSites.java new file mode 100644 index 0000000000000..41a8e513384ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSites.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.network.generated.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 VirtualApplianceSites. */ +public interface VirtualApplianceSites { + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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. + */ + void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName); + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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. + */ + void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context); + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the specified Virtual Appliance Site. + */ + VirtualApplianceSite get(String resourceGroupName, String networkVirtualApplianceName, String siteName); + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the 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 the specified Virtual Appliance Site. + */ + Response getWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context); + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + PagedIterable list(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + PagedIterable list( + String resourceGroupName, String networkVirtualApplianceName, Context context); + + /** + * Gets the specified Virtual Appliance Site. + * + * @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 the specified Virtual Appliance Site. + */ + VirtualApplianceSite getById(String id); + + /** + * Gets the specified Virtual Appliance Site. + * + * @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 specified Virtual Appliance Site. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @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 VirtualApplianceSite resource. + * + * @param name resource name. + * @return the first stage of the new VirtualApplianceSite definition. + */ + VirtualApplianceSite.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkuProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkuProperties.java new file mode 100644 index 0000000000000..f98f45803698b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkuProperties.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.network.generated.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; + +/** Network Virtual Appliance Sku Properties. */ +@Fluent +public final class VirtualApplianceSkuProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceSkuProperties.class); + + /* + * Virtual Appliance Vendor. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /* + * Virtual Appliance Scale Unit. + */ + @JsonProperty(value = "bundledScaleUnit") + private String bundledScaleUnit; + + /* + * Virtual Appliance Version. + */ + @JsonProperty(value = "marketPlaceVersion") + private String marketPlaceVersion; + + /** + * Get the vendor property: Virtual Appliance Vendor. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Set the vendor property: Virtual Appliance Vendor. + * + * @param vendor the vendor value to set. + * @return the VirtualApplianceSkuProperties object itself. + */ + public VirtualApplianceSkuProperties withVendor(String vendor) { + this.vendor = vendor; + return this; + } + + /** + * Get the bundledScaleUnit property: Virtual Appliance Scale Unit. + * + * @return the bundledScaleUnit value. + */ + public String bundledScaleUnit() { + return this.bundledScaleUnit; + } + + /** + * Set the bundledScaleUnit property: Virtual Appliance Scale Unit. + * + * @param bundledScaleUnit the bundledScaleUnit value to set. + * @return the VirtualApplianceSkuProperties object itself. + */ + public VirtualApplianceSkuProperties withBundledScaleUnit(String bundledScaleUnit) { + this.bundledScaleUnit = bundledScaleUnit; + return this; + } + + /** + * Get the marketPlaceVersion property: Virtual Appliance Version. + * + * @return the marketPlaceVersion value. + */ + public String marketPlaceVersion() { + return this.marketPlaceVersion; + } + + /** + * Set the marketPlaceVersion property: Virtual Appliance Version. + * + * @param marketPlaceVersion the marketPlaceVersion value to set. + * @return the VirtualApplianceSkuProperties object itself. + */ + public VirtualApplianceSkuProperties withMarketPlaceVersion(String marketPlaceVersion) { + this.marketPlaceVersion = marketPlaceVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkus.java new file mode 100644 index 0000000000000..87a58c3ea96fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkus.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.network.generated.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 VirtualApplianceSkus. */ +public interface VirtualApplianceSkus { + /** + * List all SKUs available for a virtual appliance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + PagedIterable list(); + + /** + * List all SKUs available for a virtual appliance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + PagedIterable list(Context context); + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the NetworkVirtualApplianceSkus resource. + */ + NetworkVirtualApplianceSku get(String skuName); + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the NetworkVirtualApplianceSkus resource. + */ + Response getWithResponse(String skuName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHub.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHub.java new file mode 100644 index 0000000000000..fb2385ada075d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHub.java @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualHub. */ +public interface VirtualHub { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the virtualWan property: The VirtualWAN to which the VirtualHub belongs. + * + * @return the virtualWan value. + */ + SubResource virtualWan(); + + /** + * Gets the vpnGateway property: The VpnGateway associated with this VirtualHub. + * + * @return the vpnGateway value. + */ + SubResource vpnGateway(); + + /** + * Gets the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub. + * + * @return the p2SVpnGateway value. + */ + SubResource p2SVpnGateway(); + + /** + * Gets the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub. + * + * @return the expressRouteGateway value. + */ + SubResource expressRouteGateway(); + + /** + * Gets the azureFirewall property: The azureFirewall associated with this VirtualHub. + * + * @return the azureFirewall value. + */ + SubResource azureFirewall(); + + /** + * Gets the securityPartnerProvider property: The securityPartnerProvider associated with this VirtualHub. + * + * @return the securityPartnerProvider value. + */ + SubResource securityPartnerProvider(); + + /** + * Gets the addressPrefix property: Address-prefix for this VirtualHub. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the routeTable property: The routeTable associated with this virtual hub. + * + * @return the routeTable value. + */ + VirtualHubRouteTable routeTable(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual hub resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the securityProviderName property: The Security Provider name. + * + * @return the securityProviderName value. + */ + String securityProviderName(); + + /** + * Gets the virtualHubRouteTableV2S property: List of all virtual hub route table v2s associated with this + * VirtualHub. + * + * @return the virtualHubRouteTableV2S value. + */ + List virtualHubRouteTableV2S(); + + /** + * Gets the sku property: The sku of this VirtualHub. + * + * @return the sku value. + */ + String sku(); + + /** + * Gets the routingState property: The routing state. + * + * @return the routingState value. + */ + RoutingState routingState(); + + /** + * Gets the bgpConnections property: List of references to Bgp Connections. + * + * @return the bgpConnections value. + */ + List bgpConnections(); + + /** + * Gets the ipConfigurations property: List of references to IpConfigurations. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the virtualRouterAsn property: VirtualRouter ASN. + * + * @return the virtualRouterAsn value. + */ + Long virtualRouterAsn(); + + /** + * Gets the virtualRouterIps property: VirtualRouter IPs. + * + * @return the virtualRouterIps value. + */ + List virtualRouterIps(); + + /** + * Gets the allowBranchToBranchTraffic property: Flag to control transit for VirtualRouter hub. + * + * @return the allowBranchToBranchTraffic value. + */ + Boolean allowBranchToBranchTraffic(); + + /** + * Gets the preferredRoutingGateway property: The preferred gateway to route on-prem traffic. + * + * @return the preferredRoutingGateway value. + */ + PreferredRoutingGateway preferredRoutingGateway(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VirtualHubInner object. + * + * @return the inner object. + */ + VirtualHubInner innerModel(); + + /** The entirety of the VirtualHub definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualHub definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualHub definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualHub 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 VirtualHub definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualHub 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.WithVirtualWan, + DefinitionStages.WithVpnGateway, + DefinitionStages.WithP2SVpnGateway, + DefinitionStages.WithExpressRouteGateway, + DefinitionStages.WithAzureFirewall, + DefinitionStages.WithSecurityPartnerProvider, + DefinitionStages.WithAddressPrefix, + DefinitionStages.WithRouteTable, + DefinitionStages.WithSecurityProviderName, + DefinitionStages.WithVirtualHubRouteTableV2S, + DefinitionStages.WithSku, + DefinitionStages.WithVirtualRouterAsn, + DefinitionStages.WithVirtualRouterIps, + DefinitionStages.WithAllowBranchToBranchTraffic, + DefinitionStages.WithPreferredRoutingGateway { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualHub create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualHub create(Context context); + } + /** The stage of the VirtualHub 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 VirtualHub definition allowing to specify virtualWan. */ + interface WithVirtualWan { + /** + * Specifies the virtualWan property: The VirtualWAN to which the VirtualHub belongs.. + * + * @param virtualWan The VirtualWAN to which the VirtualHub belongs. + * @return the next definition stage. + */ + WithCreate withVirtualWan(SubResource virtualWan); + } + /** The stage of the VirtualHub definition allowing to specify vpnGateway. */ + interface WithVpnGateway { + /** + * Specifies the vpnGateway property: The VpnGateway associated with this VirtualHub.. + * + * @param vpnGateway The VpnGateway associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withVpnGateway(SubResource vpnGateway); + } + /** The stage of the VirtualHub definition allowing to specify p2SVpnGateway. */ + interface WithP2SVpnGateway { + /** + * Specifies the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub.. + * + * @param p2SVpnGateway The P2SVpnGateway associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withP2SVpnGateway(SubResource p2SVpnGateway); + } + /** The stage of the VirtualHub definition allowing to specify expressRouteGateway. */ + interface WithExpressRouteGateway { + /** + * Specifies the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub.. + * + * @param expressRouteGateway The expressRouteGateway associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withExpressRouteGateway(SubResource expressRouteGateway); + } + /** The stage of the VirtualHub definition allowing to specify azureFirewall. */ + interface WithAzureFirewall { + /** + * Specifies the azureFirewall property: The azureFirewall associated with this VirtualHub.. + * + * @param azureFirewall The azureFirewall associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withAzureFirewall(SubResource azureFirewall); + } + /** The stage of the VirtualHub definition allowing to specify securityPartnerProvider. */ + interface WithSecurityPartnerProvider { + /** + * Specifies the securityPartnerProvider property: The securityPartnerProvider associated with this + * VirtualHub.. + * + * @param securityPartnerProvider The securityPartnerProvider associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withSecurityPartnerProvider(SubResource securityPartnerProvider); + } + /** The stage of the VirtualHub definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: Address-prefix for this VirtualHub.. + * + * @param addressPrefix Address-prefix for this VirtualHub. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the VirtualHub definition allowing to specify routeTable. */ + interface WithRouteTable { + /** + * Specifies the routeTable property: The routeTable associated with this virtual hub.. + * + * @param routeTable The routeTable associated with this virtual hub. + * @return the next definition stage. + */ + WithCreate withRouteTable(VirtualHubRouteTable routeTable); + } + /** The stage of the VirtualHub definition allowing to specify securityProviderName. */ + interface WithSecurityProviderName { + /** + * Specifies the securityProviderName property: The Security Provider name.. + * + * @param securityProviderName The Security Provider name. + * @return the next definition stage. + */ + WithCreate withSecurityProviderName(String securityProviderName); + } + /** The stage of the VirtualHub definition allowing to specify virtualHubRouteTableV2S. */ + interface WithVirtualHubRouteTableV2S { + /** + * Specifies the virtualHubRouteTableV2S property: List of all virtual hub route table v2s associated with + * this VirtualHub.. + * + * @param virtualHubRouteTableV2S List of all virtual hub route table v2s associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withVirtualHubRouteTableV2S(List virtualHubRouteTableV2S); + } + /** The stage of the VirtualHub definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku of this VirtualHub.. + * + * @param sku The sku of this VirtualHub. + * @return the next definition stage. + */ + WithCreate withSku(String sku); + } + /** The stage of the VirtualHub definition allowing to specify virtualRouterAsn. */ + interface WithVirtualRouterAsn { + /** + * Specifies the virtualRouterAsn property: VirtualRouter ASN.. + * + * @param virtualRouterAsn VirtualRouter ASN. + * @return the next definition stage. + */ + WithCreate withVirtualRouterAsn(Long virtualRouterAsn); + } + /** The stage of the VirtualHub definition allowing to specify virtualRouterIps. */ + interface WithVirtualRouterIps { + /** + * Specifies the virtualRouterIps property: VirtualRouter IPs.. + * + * @param virtualRouterIps VirtualRouter IPs. + * @return the next definition stage. + */ + WithCreate withVirtualRouterIps(List virtualRouterIps); + } + /** The stage of the VirtualHub definition allowing to specify allowBranchToBranchTraffic. */ + interface WithAllowBranchToBranchTraffic { + /** + * Specifies the allowBranchToBranchTraffic property: Flag to control transit for VirtualRouter hub.. + * + * @param allowBranchToBranchTraffic Flag to control transit for VirtualRouter hub. + * @return the next definition stage. + */ + WithCreate withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic); + } + /** The stage of the VirtualHub definition allowing to specify preferredRoutingGateway. */ + interface WithPreferredRoutingGateway { + /** + * Specifies the preferredRoutingGateway property: The preferred gateway to route on-prem traffic. + * + * @param preferredRoutingGateway The preferred gateway to route on-prem traffic. + * @return the next definition stage. + */ + WithCreate withPreferredRoutingGateway(PreferredRoutingGateway preferredRoutingGateway); + } + } + /** + * Begins update for the VirtualHub resource. + * + * @return the stage of resource update. + */ + VirtualHub.Update update(); + + /** The template for VirtualHub update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualHub apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualHub apply(Context context); + } + /** The VirtualHub update stages. */ + interface UpdateStages { + /** The stage of the VirtualHub 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualHub refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualHub refresh(Context context); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @throws com.azure.core.management.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 getEffectiveVirtualHubRoutes(); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubBgpConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubBgpConnections.java new file mode 100644 index 0000000000000..3ff62c1198ff6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubBgpConnections.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VirtualHubBgpConnections. */ +public interface VirtualHubBgpConnections { + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + BgpConnection get(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String connectionName); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listLearnedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listLearnedRoutes(String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @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 virtual Appliance Site resource. + */ + BgpConnection getById(String id); + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @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 virtual Appliance Site resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @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 BgpConnection resource. + * + * @param name resource name. + * @return the first stage of the new BgpConnection definition. + */ + BgpConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubEffectiveRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubEffectiveRoute.java new file mode 100644 index 0000000000000..058bc5a01930c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubEffectiveRoute.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 effective route configured on the virtual hub or specified resource. */ +@Fluent +public final class VirtualHubEffectiveRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubEffectiveRoute.class); + + /* + * The list of address prefixes. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * The list of next hops. + */ + @JsonProperty(value = "nextHops") + private List nextHops; + + /* + * The type of the next hop. + */ + @JsonProperty(value = "nextHopType") + private String nextHopType; + + /* + * The ASPath of this route. + */ + @JsonProperty(value = "asPath") + private String asPath; + + /* + * The origin of this route. + */ + @JsonProperty(value = "routeOrigin") + private String routeOrigin; + + /** + * Get the addressPrefixes property: The list of address prefixes. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: The list of address prefixes. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the VirtualHubEffectiveRoute object itself. + */ + public VirtualHubEffectiveRoute withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the nextHops property: The list of next hops. + * + * @return the nextHops value. + */ + public List nextHops() { + return this.nextHops; + } + + /** + * Set the nextHops property: The list of next hops. + * + * @param nextHops the nextHops value to set. + * @return the VirtualHubEffectiveRoute object itself. + */ + public VirtualHubEffectiveRoute withNextHops(List nextHops) { + this.nextHops = nextHops; + return this; + } + + /** + * Get the nextHopType property: The type of the next hop. + * + * @return the nextHopType value. + */ + public String nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: The type of the next hop. + * + * @param nextHopType the nextHopType value to set. + * @return the VirtualHubEffectiveRoute object itself. + */ + public VirtualHubEffectiveRoute withNextHopType(String nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the asPath property: The ASPath of this route. + * + * @return the asPath value. + */ + public String asPath() { + return this.asPath; + } + + /** + * Set the asPath property: The ASPath of this route. + * + * @param asPath the asPath value to set. + * @return the VirtualHubEffectiveRoute object itself. + */ + public VirtualHubEffectiveRoute withAsPath(String asPath) { + this.asPath = asPath; + return this; + } + + /** + * Get the routeOrigin property: The origin of this route. + * + * @return the routeOrigin value. + */ + public String routeOrigin() { + return this.routeOrigin; + } + + /** + * Set the routeOrigin property: The origin of this route. + * + * @param routeOrigin the routeOrigin value to set. + * @return the VirtualHubEffectiveRoute object itself. + */ + public VirtualHubEffectiveRoute withRouteOrigin(String routeOrigin) { + this.routeOrigin = routeOrigin; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubId.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubId.java new file mode 100644 index 0000000000000..fcf1095a3efdc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubId.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.network.generated.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; + +/** Virtual Hub identifier. */ +@Fluent +public final class VirtualHubId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubId.class); + + /* + * The resource URI for the Virtual Hub where the ExpressRoute gateway is + * or will be deployed. The Virtual Hub resource and the ExpressRoute + * gateway resource reside in the same subscription. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. + * The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. + * The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. + * + * @param id the id value to set. + * @return the VirtualHubId object itself. + */ + public VirtualHubId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubIpConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubIpConfigurations.java new file mode 100644 index 0000000000000..adee26f7830fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubIpConfigurations.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.network.generated.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 VirtualHubIpConfigurations. */ +public interface VirtualHubIpConfigurations { + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + HubIpConfiguration get(String resourceGroupName, String virtualHubName, String ipConfigName); + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String ipConfigName, Context context); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String ipConfigName); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, String ipConfigName, Context context); + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @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 ipConfigurations. + */ + HubIpConfiguration getById(String id); + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @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 ipConfigurations. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @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 HubIpConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new HubIpConfiguration definition. + */ + HubIpConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRoute.java new file mode 100644 index 0000000000000..8049022fe97f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRoute.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.network.generated.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; + +/** VirtualHub route. */ +@Fluent +public final class VirtualHubRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRoute.class); + + /* + * List of all addressPrefixes. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * NextHop ip address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * Get the addressPrefixes property: List of all addressPrefixes. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: List of all addressPrefixes. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the VirtualHubRoute object itself. + */ + public VirtualHubRoute withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the nextHopIpAddress property: NextHop ip address. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: NextHop ip address. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the VirtualHubRoute object itself. + */ + public VirtualHubRoute withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTable.java new file mode 100644 index 0000000000000..f7029f25ceb54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTable.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.network.generated.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; + +/** VirtualHub route table. */ +@Fluent +public final class VirtualHubRouteTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteTable.class); + + /* + * List of all routes. + */ + @JsonProperty(value = "routes") + private List routes; + + /** + * Get the routes property: List of all routes. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: List of all routes. + * + * @param routes the routes value to set. + * @return the VirtualHubRouteTable object itself. + */ + public VirtualHubRouteTable withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java new file mode 100644 index 0000000000000..368efa892c8f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import java.util.List; + +/** An immutable client-side representation of VirtualHubRouteTableV2. */ +public interface VirtualHubRouteTableV2 { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the routes property: List of all routes. + * + * @return the routes value. + */ + List routes(); + + /** + * Gets the attachedConnections property: List of all connections attached to this route table v2. + * + * @return the attachedConnections value. + */ + List attachedConnections(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual hub route table v2 resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner object. + * + * @return the inner object. + */ + VirtualHubRouteTableV2Inner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.java new file mode 100644 index 0000000000000..e88b34ae92d8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; + +/** Resource collection API of VirtualHubRouteTableV2S. */ +public interface VirtualHubRouteTableV2S { + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + VirtualHubRouteTableV2 get(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + VirtualHubRouteTableV2 createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters); + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + VirtualHubRouteTableV2 createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context); + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualHubName, String routeTableName); + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualHubName, String routeTableName, Context context); + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteV2.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteV2.java new file mode 100644 index 0000000000000..57e4ff2d53e31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteV2.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** VirtualHubRouteTableV2 route. */ +@Fluent +public final class VirtualHubRouteV2 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteV2.class); + + /* + * The type of destinations. + */ + @JsonProperty(value = "destinationType") + private String destinationType; + + /* + * List of all destinations. + */ + @JsonProperty(value = "destinations") + private List destinations; + + /* + * The type of next hops. + */ + @JsonProperty(value = "nextHopType") + private String nextHopType; + + /* + * NextHops ip address. + */ + @JsonProperty(value = "nextHops") + private List nextHops; + + /** + * Get the destinationType property: The type of destinations. + * + * @return the destinationType value. + */ + public String destinationType() { + return this.destinationType; + } + + /** + * Set the destinationType property: The type of destinations. + * + * @param destinationType the destinationType value to set. + * @return the VirtualHubRouteV2 object itself. + */ + public VirtualHubRouteV2 withDestinationType(String destinationType) { + this.destinationType = destinationType; + return this; + } + + /** + * Get the destinations property: List of all destinations. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: List of all destinations. + * + * @param destinations the destinations value to set. + * @return the VirtualHubRouteV2 object itself. + */ + public VirtualHubRouteV2 withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Get the nextHopType property: The type of next hops. + * + * @return the nextHopType value. + */ + public String nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: The type of next hops. + * + * @param nextHopType the nextHopType value to set. + * @return the VirtualHubRouteV2 object itself. + */ + public VirtualHubRouteV2 withNextHopType(String nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the nextHops property: NextHops ip address. + * + * @return the nextHops value. + */ + public List nextHops() { + return this.nextHops; + } + + /** + * Set the nextHops property: NextHops ip address. + * + * @param nextHops the nextHops value to set. + * @return the VirtualHubRouteV2 object itself. + */ + public VirtualHubRouteV2 withNextHops(List nextHops) { + this.nextHops = nextHops; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubs.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubs.java new file mode 100644 index 0000000000000..faca84707948a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubs.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VirtualHubs. */ +public interface VirtualHubs { + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + VirtualHub getByResourceGroup(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHubName, Context context); + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName); + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualHubName, Context context); + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + PagedIterable list(); + + /** + * Lists all the VirtualHubs 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 result of the request to list VirtualHubs. + */ + PagedIterable list(Context context); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context); + + /** + * Retrieves the details of a VirtualHub. + * + * @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 virtualHub Resource. + */ + VirtualHub getById(String id); + + /** + * Retrieves the details of a VirtualHub. + * + * @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 virtualHub Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a VirtualHub. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a VirtualHub. + * + * @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 VirtualHub resource. + * + * @param name resource name. + * @return the first stage of the new VirtualHub definition. + */ + VirtualHub.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetwork.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetwork.java new file mode 100644 index 0000000000000..dfba689a84145 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetwork.java @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetwork. */ +public interface VirtualNetwork { + /** + * 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 extendedLocation property: The extended location of the virtual network. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the addressSpace property: The AddressSpace that contains an array of IP address ranges that can be used by + * subnets. + * + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * Gets the dhcpOptions property: The dhcpOptions that contains an array of DNS servers available to VMs deployed in + * the virtual network. + * + * @return the dhcpOptions value. + */ + DhcpOptions dhcpOptions(); + + /** + * Gets the flowTimeoutInMinutes property: The FlowTimeout value (in minutes) for the Virtual Network. + * + * @return the flowTimeoutInMinutes value. + */ + Integer flowTimeoutInMinutes(); + + /** + * Gets the subnets property: A list of subnets in a Virtual Network. + * + * @return the subnets value. + */ + List subnets(); + + /** + * Gets the virtualNetworkPeerings property: A list of peerings in a Virtual Network. + * + * @return the virtualNetworkPeerings value. + */ + List virtualNetworkPeerings(); + + /** + * Gets the resourceGuid property: The resourceGuid property of the Virtual Network resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual network resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the enableDdosProtection property: Indicates if DDoS protection is enabled for all the protected resources + * in the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @return the enableDdosProtection value. + */ + Boolean enableDdosProtection(); + + /** + * Gets the enableVmProtection property: Indicates if VM protection is enabled for all the subnets in the virtual + * network. + * + * @return the enableVmProtection value. + */ + Boolean enableVmProtection(); + + /** + * Gets the ddosProtectionPlan property: The DDoS protection plan associated with the virtual network. + * + * @return the ddosProtectionPlan value. + */ + SubResource ddosProtectionPlan(); + + /** + * Gets the bgpCommunities property: Bgp Communities sent over ExpressRoute with each route corresponding to a + * prefix in this VNET. + * + * @return the bgpCommunities value. + */ + VirtualNetworkBgpCommunities bgpCommunities(); + + /** + * Gets the ipAllocations property: Array of IpAllocation which reference this VNET. + * + * @return the ipAllocations value. + */ + List ipAllocations(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VirtualNetworkInner object. + * + * @return the inner object. + */ + VirtualNetworkInner innerModel(); + + /** The entirety of the VirtualNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetwork definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualNetwork 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 VirtualNetwork definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualNetwork 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.WithExtendedLocation, + DefinitionStages.WithAddressSpace, + DefinitionStages.WithDhcpOptions, + DefinitionStages.WithFlowTimeoutInMinutes, + DefinitionStages.WithSubnets, + DefinitionStages.WithVirtualNetworkPeerings, + DefinitionStages.WithEnableDdosProtection, + DefinitionStages.WithEnableVmProtection, + DefinitionStages.WithDdosProtectionPlan, + DefinitionStages.WithBgpCommunities, + DefinitionStages.WithIpAllocations { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetwork create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetwork create(Context context); + } + /** The stage of the VirtualNetwork 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 VirtualNetwork definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the virtual network.. + * + * @param extendedLocation The extended location of the virtual network. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the VirtualNetwork definition allowing to specify addressSpace. */ + interface WithAddressSpace { + /** + * Specifies the addressSpace property: The AddressSpace that contains an array of IP address ranges that + * can be used by subnets.. + * + * @param addressSpace The AddressSpace that contains an array of IP address ranges that can be used by + * subnets. + * @return the next definition stage. + */ + WithCreate withAddressSpace(AddressSpace addressSpace); + } + /** The stage of the VirtualNetwork definition allowing to specify dhcpOptions. */ + interface WithDhcpOptions { + /** + * Specifies the dhcpOptions property: The dhcpOptions that contains an array of DNS servers available to + * VMs deployed in the virtual network.. + * + * @param dhcpOptions The dhcpOptions that contains an array of DNS servers available to VMs deployed in the + * virtual network. + * @return the next definition stage. + */ + WithCreate withDhcpOptions(DhcpOptions dhcpOptions); + } + /** The stage of the VirtualNetwork definition allowing to specify flowTimeoutInMinutes. */ + interface WithFlowTimeoutInMinutes { + /** + * Specifies the flowTimeoutInMinutes property: The FlowTimeout value (in minutes) for the Virtual Network. + * + * @param flowTimeoutInMinutes The FlowTimeout value (in minutes) for the Virtual Network. + * @return the next definition stage. + */ + WithCreate withFlowTimeoutInMinutes(Integer flowTimeoutInMinutes); + } + /** The stage of the VirtualNetwork definition allowing to specify subnets. */ + interface WithSubnets { + /** + * Specifies the subnets property: A list of subnets in a Virtual Network.. + * + * @param subnets A list of subnets in a Virtual Network. + * @return the next definition stage. + */ + WithCreate withSubnets(List subnets); + } + /** The stage of the VirtualNetwork definition allowing to specify virtualNetworkPeerings. */ + interface WithVirtualNetworkPeerings { + /** + * Specifies the virtualNetworkPeerings property: A list of peerings in a Virtual Network.. + * + * @param virtualNetworkPeerings A list of peerings in a Virtual Network. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkPeerings(List virtualNetworkPeerings); + } + /** The stage of the VirtualNetwork definition allowing to specify enableDdosProtection. */ + interface WithEnableDdosProtection { + /** + * Specifies the enableDdosProtection property: Indicates if DDoS protection is enabled for all the + * protected resources in the virtual network. It requires a DDoS protection plan associated with the + * resource.. + * + * @param enableDdosProtection Indicates if DDoS protection is enabled for all the protected resources in + * the virtual network. It requires a DDoS protection plan associated with the resource. + * @return the next definition stage. + */ + WithCreate withEnableDdosProtection(Boolean enableDdosProtection); + } + /** The stage of the VirtualNetwork definition allowing to specify enableVmProtection. */ + interface WithEnableVmProtection { + /** + * Specifies the enableVmProtection property: Indicates if VM protection is enabled for all the subnets in + * the virtual network.. + * + * @param enableVmProtection Indicates if VM protection is enabled for all the subnets in the virtual + * network. + * @return the next definition stage. + */ + WithCreate withEnableVmProtection(Boolean enableVmProtection); + } + /** The stage of the VirtualNetwork definition allowing to specify ddosProtectionPlan. */ + interface WithDdosProtectionPlan { + /** + * Specifies the ddosProtectionPlan property: The DDoS protection plan associated with the virtual network.. + * + * @param ddosProtectionPlan The DDoS protection plan associated with the virtual network. + * @return the next definition stage. + */ + WithCreate withDdosProtectionPlan(SubResource ddosProtectionPlan); + } + /** The stage of the VirtualNetwork definition allowing to specify bgpCommunities. */ + interface WithBgpCommunities { + /** + * Specifies the bgpCommunities property: Bgp Communities sent over ExpressRoute with each route + * corresponding to a prefix in this VNET.. + * + * @param bgpCommunities Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in + * this VNET. + * @return the next definition stage. + */ + WithCreate withBgpCommunities(VirtualNetworkBgpCommunities bgpCommunities); + } + /** The stage of the VirtualNetwork definition allowing to specify ipAllocations. */ + interface WithIpAllocations { + /** + * Specifies the ipAllocations property: Array of IpAllocation which reference this VNET.. + * + * @param ipAllocations Array of IpAllocation which reference this VNET. + * @return the next definition stage. + */ + WithCreate withIpAllocations(List ipAllocations); + } + } + /** + * Begins update for the VirtualNetwork resource. + * + * @return the stage of resource update. + */ + VirtualNetwork.Update update(); + + /** The template for VirtualNetwork update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetwork apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetwork apply(Context context); + } + /** The VirtualNetwork update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetwork 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetwork refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetwork refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkBgpCommunities.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkBgpCommunities.java new file mode 100644 index 0000000000000..a46363a56cf3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkBgpCommunities.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.network.generated.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; + +/** Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. */ +@Fluent +public final class VirtualNetworkBgpCommunities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkBgpCommunities.class); + + /* + * The BGP community associated with the virtual network. + */ + @JsonProperty(value = "virtualNetworkCommunity", required = true) + private String virtualNetworkCommunity; + + /* + * The BGP community associated with the region of the virtual network. + */ + @JsonProperty(value = "regionalCommunity", access = JsonProperty.Access.WRITE_ONLY) + private String regionalCommunity; + + /** + * Get the virtualNetworkCommunity property: The BGP community associated with the virtual network. + * + * @return the virtualNetworkCommunity value. + */ + public String virtualNetworkCommunity() { + return this.virtualNetworkCommunity; + } + + /** + * Set the virtualNetworkCommunity property: The BGP community associated with the virtual network. + * + * @param virtualNetworkCommunity the virtualNetworkCommunity value to set. + * @return the VirtualNetworkBgpCommunities object itself. + */ + public VirtualNetworkBgpCommunities withVirtualNetworkCommunity(String virtualNetworkCommunity) { + this.virtualNetworkCommunity = virtualNetworkCommunity; + return this; + } + + /** + * Get the regionalCommunity property: The BGP community associated with the region of the virtual network. + * + * @return the regionalCommunity value. + */ + public String regionalCommunity() { + return this.regionalCommunity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkCommunity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkCommunity in model VirtualNetworkBgpCommunities")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkConnectionGatewayReference.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkConnectionGatewayReference.java new file mode 100644 index 0000000000000..bad252dfab984 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkConnectionGatewayReference.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.network.generated.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; + +/** A reference to VirtualNetworkGateway or LocalNetworkGateway resource. */ +@Fluent +public final class VirtualNetworkConnectionGatewayReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkConnectionGatewayReference.class); + + /* + * The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @param id the id value to set. + * @return the VirtualNetworkConnectionGatewayReference object itself. + */ + public VirtualNetworkConnectionGatewayReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property id in model VirtualNetworkConnectionGatewayReference")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateway.java new file mode 100644 index 0000000000000..a72c758efc2da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateway.java @@ -0,0 +1,907 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetworkGateway. */ +public interface VirtualNetworkGateway { + /** + * 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 extendedLocation property: The extended location of type local virtual network gateway. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the ipConfigurations property: IP configurations for virtual network gateway. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the gatewayType property: The type of this virtual network gateway. + * + * @return the gatewayType value. + */ + VirtualNetworkGatewayType gatewayType(); + + /** + * Gets the vpnType property: The type of this virtual network gateway. + * + * @return the vpnType value. + */ + VpnType vpnType(); + + /** + * Gets the vpnGatewayGeneration property: The generation for this VirtualNetworkGateway. Must be None if + * gatewayType is not VPN. + * + * @return the vpnGatewayGeneration value. + */ + VpnGatewayGeneration vpnGatewayGeneration(); + + /** + * Gets the enableBgp property: Whether BGP is enabled for this virtual network gateway or not. + * + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * Gets the enablePrivateIpAddress property: Whether private IP needs to be enabled on this gateway for connections + * or not. + * + * @return the enablePrivateIpAddress value. + */ + Boolean enablePrivateIpAddress(); + + /** + * Gets the active property: ActiveActive flag. + * + * @return the active value. + */ + Boolean active(); + + /** + * Gets the gatewayDefaultSite property: The reference to the LocalNetworkGateway resource which represents local + * network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @return the gatewayDefaultSite value. + */ + SubResource gatewayDefaultSite(); + + /** + * Gets the sku property: The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected + * for Virtual network gateway. + * + * @return the sku value. + */ + VirtualNetworkGatewaySku sku(); + + /** + * Gets the vpnClientConfiguration property: The reference to the VpnClientConfiguration resource which represents + * the P2S VpnClient configurations. + * + * @return the vpnClientConfiguration value. + */ + VpnClientConfiguration vpnClientConfiguration(); + + /** + * Gets the bgpSettings property: Virtual network gateway's BGP speaker settings. + * + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * Gets the customRoutes property: The reference to the address space resource which represents the custom routes + * address space specified by the customer for virtual network gateway and VpnClient. + * + * @return the customRoutes value. + */ + AddressSpace customRoutes(); + + /** + * Gets the resourceGuid property: The resource GUID property of the virtual network gateway resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual network gateway resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the enableDnsForwarding property: Whether dns forwarding is enabled or not. + * + * @return the enableDnsForwarding value. + */ + Boolean enableDnsForwarding(); + + /** + * Gets the inboundDnsForwardingEndpoint property: The IP address allocated by the gateway to which dns requests can + * be sent. + * + * @return the inboundDnsForwardingEndpoint value. + */ + String inboundDnsForwardingEndpoint(); + + /** + * Gets the vNetExtendedLocationResourceId property: Customer vnet resource id. VirtualNetworkGateway of type local + * gateway is associated with the customer vnet. + * + * @return the vNetExtendedLocationResourceId value. + */ + String vNetExtendedLocationResourceId(); + + /** + * Gets the natRules property: NatRules for virtual network gateway. + * + * @return the natRules value. + */ + List natRules(); + + /** + * Gets the enableBgpRouteTranslationForNat property: EnableBgpRouteTranslationForNat flag. + * + * @return the enableBgpRouteTranslationForNat value. + */ + Boolean enableBgpRouteTranslationForNat(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VirtualNetworkGatewayInner object. + * + * @return the inner object. + */ + VirtualNetworkGatewayInner innerModel(); + + /** The entirety of the VirtualNetworkGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualNetworkGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualNetworkGateway 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 VirtualNetworkGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualNetworkGateway 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.WithExtendedLocation, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithGatewayType, + DefinitionStages.WithVpnType, + DefinitionStages.WithVpnGatewayGeneration, + DefinitionStages.WithEnableBgp, + DefinitionStages.WithEnablePrivateIpAddress, + DefinitionStages.WithActive, + DefinitionStages.WithGatewayDefaultSite, + DefinitionStages.WithSku, + DefinitionStages.WithVpnClientConfiguration, + DefinitionStages.WithBgpSettings, + DefinitionStages.WithCustomRoutes, + DefinitionStages.WithEnableDnsForwarding, + DefinitionStages.WithVNetExtendedLocationResourceId, + DefinitionStages.WithNatRules, + DefinitionStages.WithEnableBgpRouteTranslationForNat { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkGateway create(Context context); + } + /** The stage of the VirtualNetworkGateway 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 VirtualNetworkGateway definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of type local virtual network gateway.. + * + * @param extendedLocation The extended location of type local virtual network gateway. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IP configurations for virtual network gateway.. + * + * @param ipConfigurations IP configurations for virtual network gateway. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify gatewayType. */ + interface WithGatewayType { + /** + * Specifies the gatewayType property: The type of this virtual network gateway.. + * + * @param gatewayType The type of this virtual network gateway. + * @return the next definition stage. + */ + WithCreate withGatewayType(VirtualNetworkGatewayType gatewayType); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify vpnType. */ + interface WithVpnType { + /** + * Specifies the vpnType property: The type of this virtual network gateway.. + * + * @param vpnType The type of this virtual network gateway. + * @return the next definition stage. + */ + WithCreate withVpnType(VpnType vpnType); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify vpnGatewayGeneration. */ + interface WithVpnGatewayGeneration { + /** + * Specifies the vpnGatewayGeneration property: The generation for this VirtualNetworkGateway. Must be None + * if gatewayType is not VPN.. + * + * @param vpnGatewayGeneration The generation for this VirtualNetworkGateway. Must be None if gatewayType is + * not VPN. + * @return the next definition stage. + */ + WithCreate withVpnGatewayGeneration(VpnGatewayGeneration vpnGatewayGeneration); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enableBgp. */ + interface WithEnableBgp { + /** + * Specifies the enableBgp property: Whether BGP is enabled for this virtual network gateway or not.. + * + * @param enableBgp Whether BGP is enabled for this virtual network gateway or not. + * @return the next definition stage. + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enablePrivateIpAddress. */ + interface WithEnablePrivateIpAddress { + /** + * Specifies the enablePrivateIpAddress property: Whether private IP needs to be enabled on this gateway for + * connections or not.. + * + * @param enablePrivateIpAddress Whether private IP needs to be enabled on this gateway for connections or + * not. + * @return the next definition stage. + */ + WithCreate withEnablePrivateIpAddress(Boolean enablePrivateIpAddress); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify active. */ + interface WithActive { + /** + * Specifies the active property: ActiveActive flag.. + * + * @param active ActiveActive flag. + * @return the next definition stage. + */ + WithCreate withActive(Boolean active); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify gatewayDefaultSite. */ + interface WithGatewayDefaultSite { + /** + * Specifies the gatewayDefaultSite property: The reference to the LocalNetworkGateway resource which + * represents local network site having default routes. Assign Null value in case of removing existing + * default site setting.. + * + * @param gatewayDefaultSite The reference to the LocalNetworkGateway resource which represents local + * network site having default routes. Assign Null value in case of removing existing default site + * setting. + * @return the next definition stage. + */ + WithCreate withGatewayDefaultSite(SubResource gatewayDefaultSite); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The reference to the VirtualNetworkGatewaySku resource which represents the + * SKU selected for Virtual network gateway.. + * + * @param sku The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for + * Virtual network gateway. + * @return the next definition stage. + */ + WithCreate withSku(VirtualNetworkGatewaySku sku); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify vpnClientConfiguration. */ + interface WithVpnClientConfiguration { + /** + * Specifies the vpnClientConfiguration property: The reference to the VpnClientConfiguration resource which + * represents the P2S VpnClient configurations.. + * + * @param vpnClientConfiguration The reference to the VpnClientConfiguration resource which represents the + * P2S VpnClient configurations. + * @return the next definition stage. + */ + WithCreate withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify bgpSettings. */ + interface WithBgpSettings { + /** + * Specifies the bgpSettings property: Virtual network gateway's BGP speaker settings.. + * + * @param bgpSettings Virtual network gateway's BGP speaker settings. + * @return the next definition stage. + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify customRoutes. */ + interface WithCustomRoutes { + /** + * Specifies the customRoutes property: The reference to the address space resource which represents the + * custom routes address space specified by the customer for virtual network gateway and VpnClient.. + * + * @param customRoutes The reference to the address space resource which represents the custom routes + * address space specified by the customer for virtual network gateway and VpnClient. + * @return the next definition stage. + */ + WithCreate withCustomRoutes(AddressSpace customRoutes); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enableDnsForwarding. */ + interface WithEnableDnsForwarding { + /** + * Specifies the enableDnsForwarding property: Whether dns forwarding is enabled or not.. + * + * @param enableDnsForwarding Whether dns forwarding is enabled or not. + * @return the next definition stage. + */ + WithCreate withEnableDnsForwarding(Boolean enableDnsForwarding); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify vNetExtendedLocationResourceId. */ + interface WithVNetExtendedLocationResourceId { + /** + * Specifies the vNetExtendedLocationResourceId property: Customer vnet resource id. VirtualNetworkGateway + * of type local gateway is associated with the customer vnet.. + * + * @param vNetExtendedLocationResourceId Customer vnet resource id. VirtualNetworkGateway of type local + * gateway is associated with the customer vnet. + * @return the next definition stage. + */ + WithCreate withVNetExtendedLocationResourceId(String vNetExtendedLocationResourceId); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify natRules. */ + interface WithNatRules { + /** + * Specifies the natRules property: NatRules for virtual network gateway.. + * + * @param natRules NatRules for virtual network gateway. + * @return the next definition stage. + */ + WithCreate withNatRules(List natRules); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enableBgpRouteTranslationForNat. */ + interface WithEnableBgpRouteTranslationForNat { + /** + * Specifies the enableBgpRouteTranslationForNat property: EnableBgpRouteTranslationForNat flag.. + * + * @param enableBgpRouteTranslationForNat EnableBgpRouteTranslationForNat flag. + * @return the next definition stage. + */ + WithCreate withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat); + } + } + /** + * Begins update for the VirtualNetworkGateway resource. + * + * @return the stage of resource update. + */ + VirtualNetworkGateway.Update update(); + + /** The template for VirtualNetworkGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkGateway apply(Context context); + } + /** The VirtualNetworkGateway update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkGateway 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkGateway refresh(Context context); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(String gatewayVip); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(String gatewayVip, Context context); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @throws com.azure.core.management.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 resetVpnClientSharedKey(); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource 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. + */ + void resetVpnClientSharedKey(Context context); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String generatevpnclientpackage(VpnClientParameters parameters); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String generatevpnclientpackage(VpnClientParameters parameters, Context context); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String generateVpnProfile(VpnClientParameters parameters); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String generateVpnProfile(VpnClientParameters parameters, Context context); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + String getVpnProfilePackageUrl(); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + String getVpnProfilePackageUrl(Context context); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(String peer); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(String peer, Context context); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + String supportedVpnDevices(); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + Response supportedVpnDevicesWithResponse(Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getLearnedRoutes(); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getLearnedRoutes(Context context); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters setVpnclientIpsecParameters(VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters setVpnclientIpsecParameters( + VpnClientIPsecParametersInner vpnclientIpsecParams, Context context); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters getVpnclientIpsecParameters(); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters getVpnclientIpsecParameters(Context context); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture(VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture(); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture(VpnPacketCaptureStartParameters parameters, Context context); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String stopPacketCapture(VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String stopPacketCapture(VpnPacketCaptureStopParameters parameters, Context context); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth(); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource 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 vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth(Context context); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectVirtualNetworkGatewayVpnConnections(P2SVpnConnectionRequest request); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectVirtualNetworkGatewayVpnConnections(P2SVpnConnectionRequest request, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnection.java new file mode 100644 index 0000000000000..13a292c09776c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnection.java @@ -0,0 +1,697 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetworkGatewayConnection. */ +public interface VirtualNetworkGatewayConnection { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the authorizationKey property: The authorizationKey. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the virtualNetworkGateway1 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkGateway virtualNetworkGateway1(); + + /** + * Gets the virtualNetworkGateway2 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkGateway virtualNetworkGateway2(); + + /** + * Gets the localNetworkGateway2 property: The reference to local network gateway resource. + * + * @return the localNetworkGateway2 value. + */ + LocalNetworkGateway localNetworkGateway2(); + + /** + * Gets the ingressNatRules property: List of ingress NatRules. + * + * @return the ingressNatRules value. + */ + List ingressNatRules(); + + /** + * Gets the egressNatRules property: List of egress NatRules. + * + * @return the egressNatRules value. + */ + List egressNatRules(); + + /** + * Gets the connectionType property: Gateway connection type. + * + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * Gets the connectionProtocol property: Connection protocol used for this connection. + * + * @return the connectionProtocol value. + */ + VirtualNetworkGatewayConnectionProtocol connectionProtocol(); + + /** + * Gets the routingWeight property: The routing weight. + * + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * Gets the dpdTimeoutSeconds property: The dead peer detection timeout of this connection in seconds. + * + * @return the dpdTimeoutSeconds value. + */ + Integer dpdTimeoutSeconds(); + + /** + * Gets the connectionMode property: The connection mode for this connection. + * + * @return the connectionMode value. + */ + VirtualNetworkGatewayConnectionMode connectionMode(); + + /** + * Gets the sharedKey property: The IPSec shared key. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the connectionStatus property: Virtual Network Gateway connection status. + * + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * Gets the tunnelConnectionStatus property: Collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * Gets the egressBytesTransferred property: The egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * Gets the ingressBytesTransferred property: The ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * Gets the peer property: The reference to peerings resource. + * + * @return the peer value. + */ + SubResource peer(); + + /** + * Gets the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * Gets the useLocalAzureIpAddress property: Use private local Azure IP for the connection. + * + * @return the useLocalAzureIpAddress value. + */ + Boolean useLocalAzureIpAddress(); + + /** + * Gets the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * Gets the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * Gets the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @return the trafficSelectorPolicies value. + */ + List trafficSelectorPolicies(); + + /** + * Gets the resourceGuid property: The resource GUID property of the virtual network gateway connection resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual network gateway connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner + * object. + * + * @return the inner object. + */ + VirtualNetworkGatewayConnectionInner innerModel(); + + /** The entirety of the VirtualNetworkGatewayConnection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithVirtualNetworkGateway1, + DefinitionStages.WithConnectionType, + DefinitionStages.WithCreate { + } + /** The VirtualNetworkGatewayConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkGatewayConnection definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualNetworkGatewayConnection 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 VirtualNetworkGatewayConnection definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithVirtualNetworkGateway1 withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify virtualNetworkGateway1. */ + interface WithVirtualNetworkGateway1 { + /** + * Specifies the virtualNetworkGateway1 property: The reference to virtual network gateway resource.. + * + * @param virtualNetworkGateway1 The reference to virtual network gateway resource. + * @return the next definition stage. + */ + WithConnectionType withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify connectionType. */ + interface WithConnectionType { + /** + * Specifies the connectionType property: Gateway connection type.. + * + * @param connectionType Gateway connection type. + * @return the next definition stage. + */ + WithCreate withConnectionType(VirtualNetworkGatewayConnectionType connectionType); + } + /** + * The stage of the VirtualNetworkGatewayConnection 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.WithAuthorizationKey, + DefinitionStages.WithVirtualNetworkGateway2, + DefinitionStages.WithLocalNetworkGateway2, + DefinitionStages.WithIngressNatRules, + DefinitionStages.WithEgressNatRules, + DefinitionStages.WithConnectionProtocol, + DefinitionStages.WithRoutingWeight, + DefinitionStages.WithDpdTimeoutSeconds, + DefinitionStages.WithConnectionMode, + DefinitionStages.WithSharedKey, + DefinitionStages.WithPeer, + DefinitionStages.WithEnableBgp, + DefinitionStages.WithUseLocalAzureIpAddress, + DefinitionStages.WithUsePolicyBasedTrafficSelectors, + DefinitionStages.WithIpsecPolicies, + DefinitionStages.WithTrafficSelectorPolicies, + DefinitionStages.WithExpressRouteGatewayBypass { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkGatewayConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkGatewayConnection create(Context context); + } + /** The stage of the VirtualNetworkGatewayConnection 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 VirtualNetworkGatewayConnection definition allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorizationKey.. + * + * @param authorizationKey The authorizationKey. + * @return the next definition stage. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify virtualNetworkGateway2. */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies the virtualNetworkGateway2 property: The reference to virtual network gateway resource.. + * + * @param virtualNetworkGateway2 The reference to virtual network gateway resource. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify localNetworkGateway2. */ + interface WithLocalNetworkGateway2 { + /** + * Specifies the localNetworkGateway2 property: The reference to local network gateway resource.. + * + * @param localNetworkGateway2 The reference to local network gateway resource. + * @return the next definition stage. + */ + WithCreate withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify ingressNatRules. */ + interface WithIngressNatRules { + /** + * Specifies the ingressNatRules property: List of ingress NatRules.. + * + * @param ingressNatRules List of ingress NatRules. + * @return the next definition stage. + */ + WithCreate withIngressNatRules(List ingressNatRules); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify egressNatRules. */ + interface WithEgressNatRules { + /** + * Specifies the egressNatRules property: List of egress NatRules.. + * + * @param egressNatRules List of egress NatRules. + * @return the next definition stage. + */ + WithCreate withEgressNatRules(List egressNatRules); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify connectionProtocol. */ + interface WithConnectionProtocol { + /** + * Specifies the connectionProtocol property: Connection protocol used for this connection.. + * + * @param connectionProtocol Connection protocol used for this connection. + * @return the next definition stage. + */ + WithCreate withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify routingWeight. */ + interface WithRoutingWeight { + /** + * Specifies the routingWeight property: The routing weight.. + * + * @param routingWeight The routing weight. + * @return the next definition stage. + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify dpdTimeoutSeconds. */ + interface WithDpdTimeoutSeconds { + /** + * Specifies the dpdTimeoutSeconds property: The dead peer detection timeout of this connection in seconds.. + * + * @param dpdTimeoutSeconds The dead peer detection timeout of this connection in seconds. + * @return the next definition stage. + */ + WithCreate withDpdTimeoutSeconds(Integer dpdTimeoutSeconds); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify connectionMode. */ + interface WithConnectionMode { + /** + * Specifies the connectionMode property: The connection mode for this connection.. + * + * @param connectionMode The connection mode for this connection. + * @return the next definition stage. + */ + WithCreate withConnectionMode(VirtualNetworkGatewayConnectionMode connectionMode); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify sharedKey. */ + interface WithSharedKey { + /** + * Specifies the sharedKey property: The IPSec shared key.. + * + * @param sharedKey The IPSec shared key. + * @return the next definition stage. + */ + WithCreate withSharedKey(String sharedKey); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify peer. */ + interface WithPeer { + /** + * Specifies the peer property: The reference to peerings resource.. + * + * @param peer The reference to peerings resource. + * @return the next definition stage. + */ + WithCreate withPeer(SubResource peer); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify enableBgp. */ + interface WithEnableBgp { + /** + * Specifies the enableBgp property: EnableBgp flag.. + * + * @param enableBgp EnableBgp flag. + * @return the next definition stage. + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify useLocalAzureIpAddress. */ + interface WithUseLocalAzureIpAddress { + /** + * Specifies the useLocalAzureIpAddress property: Use private local Azure IP for the connection.. + * + * @param useLocalAzureIpAddress Use private local Azure IP for the connection. + * @return the next definition stage. + */ + WithCreate withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress); + } + /** + * The stage of the VirtualNetworkGatewayConnection definition allowing to specify + * usePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors.. + * + * @param usePolicyBasedTrafficSelectors Enable policy-based traffic selectors. + * @return the next definition stage. + */ + WithCreate withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify ipsecPolicies. */ + interface WithIpsecPolicies { + /** + * Specifies the ipsecPolicies property: The IPSec Policies to be considered by this connection.. + * + * @param ipsecPolicies The IPSec Policies to be considered by this connection. + * @return the next definition stage. + */ + WithCreate withIpsecPolicies(List ipsecPolicies); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify trafficSelectorPolicies. */ + interface WithTrafficSelectorPolicies { + /** + * Specifies the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this + * connection.. + * + * @param trafficSelectorPolicies The Traffic Selector Policies to be considered by this connection. + * @return the next definition stage. + */ + WithCreate withTrafficSelectorPolicies(List trafficSelectorPolicies); + } + /** + * The stage of the VirtualNetworkGatewayConnection definition allowing to specify expressRouteGatewayBypass. + */ + interface WithExpressRouteGatewayBypass { + /** + * Specifies the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding.. + * + * @param expressRouteGatewayBypass Bypass ExpressRoute Gateway for data forwarding. + * @return the next definition stage. + */ + WithCreate withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass); + } + } + /** + * Begins update for the VirtualNetworkGatewayConnection resource. + * + * @return the stage of resource update. + */ + VirtualNetworkGatewayConnection.Update update(); + + /** The template for VirtualNetworkGatewayConnection update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkGatewayConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkGatewayConnection apply(Context context); + } + /** The VirtualNetworkGatewayConnection update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkGatewayConnection 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkGatewayConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkGatewayConnection refresh(Context context); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture(VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture(); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture(VpnPacketCaptureStartParameters parameters, Context context); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String stopPacketCapture(VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String stopPacketCapture(VpnPacketCaptureStopParameters parameters, Context context); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String getIkeSas(); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource 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 the response. + */ + String getIkeSas(Context context); + + /** + * Resets the virtual network gateway connection specified. + * + * @throws com.azure.core.management.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 resetConnection(); + + /** + * Resets the virtual network gateway connection specified. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetConnection(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListEntity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListEntity.java new file mode 100644 index 0000000000000..0c46b3b688c30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListEntity.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.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetworkGatewayConnectionListEntity. */ +public interface VirtualNetworkGatewayConnectionListEntity { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the authorizationKey property: The authorizationKey. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the virtualNetworkGateway1 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway1(); + + /** + * Gets the virtualNetworkGateway2 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway2(); + + /** + * Gets the localNetworkGateway2 property: The reference to local network gateway resource. + * + * @return the localNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference localNetworkGateway2(); + + /** + * Gets the connectionType property: Gateway connection type. + * + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * Gets the connectionProtocol property: Connection protocol used for this connection. + * + * @return the connectionProtocol value. + */ + VirtualNetworkGatewayConnectionProtocol connectionProtocol(); + + /** + * Gets the routingWeight property: The routing weight. + * + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * Gets the connectionMode property: The connection mode for this connection. + * + * @return the connectionMode value. + */ + VirtualNetworkGatewayConnectionMode connectionMode(); + + /** + * Gets the sharedKey property: The IPSec shared key. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the connectionStatus property: Virtual Network Gateway connection status. + * + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * Gets the tunnelConnectionStatus property: Collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * Gets the egressBytesTransferred property: The egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * Gets the ingressBytesTransferred property: The ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * Gets the peer property: The reference to peerings resource. + * + * @return the peer value. + */ + SubResource peer(); + + /** + * Gets the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * Gets the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * Gets the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * Gets the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @return the trafficSelectorPolicies value. + */ + List trafficSelectorPolicies(); + + /** + * Gets the resourceGuid property: The resource GUID property of the virtual network gateway connection resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual network gateway connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner object. + * + * @return the inner object. + */ + VirtualNetworkGatewayConnectionListEntityInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListResult.java new file mode 100644 index 0000000000000..38baa6a869fb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListVirtualNetworkGatewayConnections API service call. */ +@Fluent +public final class VirtualNetworkGatewayConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionListResult.class); + + /* + * A list of VirtualNetworkGatewayConnection resources that exists in a + * resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkGatewayConnectionListResult object itself. + */ + public VirtualNetworkGatewayConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionMode.java new file mode 100644 index 0000000000000..c02c0b46c8fae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionMode.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayConnectionMode. */ +public final class VirtualNetworkGatewayConnectionMode + extends ExpandableStringEnum { + /** Static value Default for VirtualNetworkGatewayConnectionMode. */ + public static final VirtualNetworkGatewayConnectionMode DEFAULT = fromString("Default"); + + /** Static value ResponderOnly for VirtualNetworkGatewayConnectionMode. */ + public static final VirtualNetworkGatewayConnectionMode RESPONDER_ONLY = fromString("ResponderOnly"); + + /** Static value InitiatorOnly for VirtualNetworkGatewayConnectionMode. */ + public static final VirtualNetworkGatewayConnectionMode INITIATOR_ONLY = fromString("InitiatorOnly"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionMode. + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionMode fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionMode.class); + } + + /** @return known VirtualNetworkGatewayConnectionMode values. */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionProtocol.java new file mode 100644 index 0000000000000..1073adcc854a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionProtocol.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayConnectionProtocol. */ +public final class VirtualNetworkGatewayConnectionProtocol + extends ExpandableStringEnum { + /** Static value IKEv2 for VirtualNetworkGatewayConnectionProtocol. */ + public static final VirtualNetworkGatewayConnectionProtocol IKEV2 = fromString("IKEv2"); + + /** Static value IKEv1 for VirtualNetworkGatewayConnectionProtocol. */ + public static final VirtualNetworkGatewayConnectionProtocol IKEV1 = fromString("IKEv1"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionProtocol. + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionProtocol fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionProtocol.class); + } + + /** @return known VirtualNetworkGatewayConnectionProtocol values. */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionStatus.java new file mode 100644 index 0000000000000..072a609d3d9ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionStatus.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayConnectionStatus. */ +public final class VirtualNetworkGatewayConnectionStatus + extends ExpandableStringEnum { + /** Static value Unknown for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionStatus. + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionStatus fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionStatus.class); + } + + /** @return known VirtualNetworkGatewayConnectionStatus values. */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionType.java new file mode 100644 index 0000000000000..b53167f80b070 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayConnectionType. */ +public final class VirtualNetworkGatewayConnectionType + extends ExpandableStringEnum { + /** Static value IPsec for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType IPSEC = fromString("IPsec"); + + /** Static value Vnet2Vnet for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VNET2VNET = fromString("Vnet2Vnet"); + + /** Static value ExpressRoute for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** Static value VPNClient for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VPNCLIENT = fromString("VPNClient"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionType. + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionType fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionType.class); + } + + /** @return known VirtualNetworkGatewayConnectionType values. */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnections.java new file mode 100644 index 0000000000000..10e6ec758ccd5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnections.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; + +/** Resource collection API of VirtualNetworkGatewayConnections. */ +public interface VirtualNetworkGatewayConnections { + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + VirtualNetworkGatewayConnection getByResourceGroup( + String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayConnectionName); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayConnectionName, Context context); + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + ConnectionSharedKey setSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + ConnectionSharedKey setSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key 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 response for GetConnectionSharedKey API service call. + */ + ConnectionSharedKey getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key 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 response for GetConnectionSharedKey API service call. + */ + Response getSharedKeyWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource 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 response for the ListVirtualNetworkGatewayConnections API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @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 the specified virtual network gateway connection by resource group. + */ + VirtualNetworkGatewayConnection getById(String id); + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @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 specified virtual network gateway connection by resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @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 VirtualNetworkGatewayConnection resource. + * + * @param name resource name. + * @return the first stage of the new VirtualNetworkGatewayConnection definition. + */ + VirtualNetworkGatewayConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayIpConfiguration.java new file mode 100644 index 0000000000000..9f7cd2b5d53f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayIpConfiguration.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration for virtual network gateway. */ +@JsonFlatten +@Fluent +public class VirtualNetworkGatewayIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayIpConfiguration.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /* + * The reference to the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIpAddress; + + /* + * Private IP Address for this gateway. + */ + @JsonProperty(value = "properties.privateIPAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /* + * The provisioning state of the virtual network gateway IP configuration + * resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VirtualNetworkGatewayIpConfiguration object itself. + */ + public VirtualNetworkGatewayIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: The private IP address allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the VirtualNetworkGatewayIpConfiguration object itself. + */ + public VirtualNetworkGatewayIpConfiguration withPrivateIpAllocationMethod( + IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The reference to the subnet resource. + * + * @param subnet the subnet value to set. + * @return the VirtualNetworkGatewayIpConfiguration object itself. + */ + public VirtualNetworkGatewayIpConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: The reference to the public IP resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the VirtualNetworkGatewayIpConfiguration object itself. + */ + public VirtualNetworkGatewayIpConfiguration withPublicIpAddress(SubResource publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the privateIpAddress property: Private IP Address for this gateway. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network gateway IP configuration + * resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListConnectionsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListConnectionsResult.java new file mode 100644 index 0000000000000..a93ee9c313b02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListConnectionsResult.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the VirtualNetworkGatewayListConnections API service call. */ +@Fluent +public final class VirtualNetworkGatewayListConnectionsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayListConnectionsResult.class); + + /* + * A list of VirtualNetworkGatewayConnection resources that exists in a + * resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkGatewayListConnectionsResult object itself. + */ + public VirtualNetworkGatewayListConnectionsResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListResult.java new file mode 100644 index 0000000000000..ea61528b66ef8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListResult.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListVirtualNetworkGateways API service call. */ +@Fluent +public final class VirtualNetworkGatewayListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayListResult.class); + + /* + * A list of VirtualNetworkGateway resources that exists in a resource + * group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of VirtualNetworkGateway resources that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetworkGateway resources that exists in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkGatewayListResult object itself. + */ + public VirtualNetworkGatewayListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @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/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRule.java new file mode 100644 index 0000000000000..45a794e764679 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRule.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import java.util.List; + +/** An immutable client-side representation of VirtualNetworkGatewayNatRule. */ +public interface VirtualNetworkGatewayNatRule { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the typePropertiesType property: The type of NAT rule for VPN NAT. + * + * @return the typePropertiesType value. + */ + VpnNatRuleType typePropertiesType(); + + /** + * Gets the mode property: The Source NAT direction of a VPN NAT. + * + * @return the mode value. + */ + VpnNatRuleMode mode(); + + /** + * Gets the internalMappings property: The private IP address internal mapping for NAT. + * + * @return the internalMappings value. + */ + List internalMappings(); + + /** + * Gets the externalMappings property: The private IP address external mapping for NAT. + * + * @return the externalMappings value. + */ + List externalMappings(); + + /** + * Gets the ipConfigurationId property: The IP Configuration ID this NAT rule applies to. + * + * @return the ipConfigurationId value. + */ + String ipConfigurationId(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner + * object. + * + * @return the inner object. + */ + VirtualNetworkGatewayNatRuleInner innerModel(); + + /** The entirety of the VirtualNetworkGatewayNatRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualNetworkGatewayNatRule definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkGatewayNatRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualNetworkGatewayName. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @return the next definition stage. + */ + WithCreate withExistingVirtualNetworkGateway(String resourceGroupName, String virtualNetworkGatewayName); + } + /** + * The stage of the VirtualNetworkGatewayNatRule 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.WithName, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithMode, + DefinitionStages.WithInternalMappings, + DefinitionStages.WithExternalMappings, + DefinitionStages.WithIpConfigurationId { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkGatewayNatRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkGatewayNatRule create(Context context); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of NAT rule for VPN NAT.. + * + * @param typePropertiesType The type of NAT rule for VPN NAT. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(VpnNatRuleType typePropertiesType); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The Source NAT direction of a VPN NAT.. + * + * @param mode The Source NAT direction of a VPN NAT. + * @return the next definition stage. + */ + WithCreate withMode(VpnNatRuleMode mode); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify internalMappings. */ + interface WithInternalMappings { + /** + * Specifies the internalMappings property: The private IP address internal mapping for NAT.. + * + * @param internalMappings The private IP address internal mapping for NAT. + * @return the next definition stage. + */ + WithCreate withInternalMappings(List internalMappings); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify externalMappings. */ + interface WithExternalMappings { + /** + * Specifies the externalMappings property: The private IP address external mapping for NAT.. + * + * @param externalMappings The private IP address external mapping for NAT. + * @return the next definition stage. + */ + WithCreate withExternalMappings(List externalMappings); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify ipConfigurationId. */ + interface WithIpConfigurationId { + /** + * Specifies the ipConfigurationId property: The IP Configuration ID this NAT rule applies to.. + * + * @param ipConfigurationId The IP Configuration ID this NAT rule applies to. + * @return the next definition stage. + */ + WithCreate withIpConfigurationId(String ipConfigurationId); + } + } + /** + * Begins update for the VirtualNetworkGatewayNatRule resource. + * + * @return the stage of resource update. + */ + VirtualNetworkGatewayNatRule.Update update(); + + /** The template for VirtualNetworkGatewayNatRule update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithTypePropertiesType, + UpdateStages.WithMode, + UpdateStages.WithInternalMappings, + UpdateStages.WithExternalMappings, + UpdateStages.WithIpConfigurationId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkGatewayNatRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkGatewayNatRule apply(Context context); + } + /** The VirtualNetworkGatewayNatRule update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of NAT rule for VPN NAT.. + * + * @param typePropertiesType The type of NAT rule for VPN NAT. + * @return the next definition stage. + */ + Update withTypePropertiesType(VpnNatRuleType typePropertiesType); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The Source NAT direction of a VPN NAT.. + * + * @param mode The Source NAT direction of a VPN NAT. + * @return the next definition stage. + */ + Update withMode(VpnNatRuleMode mode); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify internalMappings. */ + interface WithInternalMappings { + /** + * Specifies the internalMappings property: The private IP address internal mapping for NAT.. + * + * @param internalMappings The private IP address internal mapping for NAT. + * @return the next definition stage. + */ + Update withInternalMappings(List internalMappings); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify externalMappings. */ + interface WithExternalMappings { + /** + * Specifies the externalMappings property: The private IP address external mapping for NAT.. + * + * @param externalMappings The private IP address external mapping for NAT. + * @return the next definition stage. + */ + Update withExternalMappings(List externalMappings); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify ipConfigurationId. */ + interface WithIpConfigurationId { + /** + * Specifies the ipConfigurationId property: The IP Configuration ID this NAT rule applies to.. + * + * @param ipConfigurationId The IP Configuration ID this NAT rule applies to. + * @return the next definition stage. + */ + Update withIpConfigurationId(String ipConfigurationId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkGatewayNatRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkGatewayNatRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRules.java new file mode 100644 index 0000000000000..254667f406e9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRules.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VirtualNetworkGatewayNatRules. */ +public interface VirtualNetworkGatewayNatRules { + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + VirtualNetworkGatewayNatRule get(String resourceGroupName, String virtualNetworkGatewayName, String natRuleName); + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + Response getWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayName, String natRuleName); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayName, String natRuleName, Context context); + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Retrieves the details of a nat rule. + * + * @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 virtualNetworkGatewayNatRule Resource. + */ + VirtualNetworkGatewayNatRule getById(String id); + + /** + * Retrieves the details of a nat rule. + * + * @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 virtualNetworkGatewayNatRule Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a nat rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a nat rule. + * + * @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 VirtualNetworkGatewayNatRule resource. + * + * @param name resource name. + * @return the first stage of the new VirtualNetworkGatewayNatRule definition. + */ + VirtualNetworkGatewayNatRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySku.java new file mode 100644 index 0000000000000..5cc473547fc0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySku.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** VirtualNetworkGatewaySku details. */ +@Fluent +public final class VirtualNetworkGatewaySku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewaySku.class); + + /* + * Gateway SKU name. + */ + @JsonProperty(value = "name") + private VirtualNetworkGatewaySkuName name; + + /* + * Gateway SKU tier. + */ + @JsonProperty(value = "tier") + private VirtualNetworkGatewaySkuTier tier; + + /* + * The capacity. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private Integer capacity; + + /** + * Get the name property: Gateway SKU name. + * + * @return the name value. + */ + public VirtualNetworkGatewaySkuName name() { + return this.name; + } + + /** + * Set the name property: Gateway SKU name. + * + * @param name the name value to set. + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withName(VirtualNetworkGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Gateway SKU tier. + * + * @return the tier value. + */ + public VirtualNetworkGatewaySkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Gateway SKU tier. + * + * @param tier the tier value to set. + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withTier(VirtualNetworkGatewaySkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: The capacity. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuName.java new file mode 100644 index 0000000000000..9587145a6467c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuName.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewaySkuName. */ +public final class VirtualNetworkGatewaySkuName extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw4 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW4 = fromString("VpnGw4"); + + /** Static value VpnGw5 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW5 = fromString("VpnGw5"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value VpnGw4AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW4AZ = fromString("VpnGw4AZ"); + + /** Static value VpnGw5AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW5AZ = fromString("VpnGw5AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewaySkuName. + */ + @JsonCreator + public static VirtualNetworkGatewaySkuName fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuName.class); + } + + /** @return known VirtualNetworkGatewaySkuName values. */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuTier.java new file mode 100644 index 0000000000000..22fe33da02c22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuTier.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewaySkuTier. */ +public final class VirtualNetworkGatewaySkuTier extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw4 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW4 = fromString("VpnGw4"); + + /** Static value VpnGw5 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW5 = fromString("VpnGw5"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value VpnGw4AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW4AZ = fromString("VpnGw4AZ"); + + /** Static value VpnGw5AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW5AZ = fromString("VpnGw5AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewaySkuTier. + */ + @JsonCreator + public static VirtualNetworkGatewaySkuTier fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuTier.class); + } + + /** @return known VirtualNetworkGatewaySkuTier values. */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayType.java new file mode 100644 index 0000000000000..7d56db74c3c8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayType. */ +public final class VirtualNetworkGatewayType extends ExpandableStringEnum { + /** Static value Vpn for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType VPN = fromString("Vpn"); + + /** Static value ExpressRoute for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** Static value LocalGateway for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType LOCAL_GATEWAY = fromString("LocalGateway"); + + /** + * Creates or finds a VirtualNetworkGatewayType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayType. + */ + @JsonCreator + public static VirtualNetworkGatewayType fromString(String name) { + return fromString(name, VirtualNetworkGatewayType.class); + } + + /** @return known VirtualNetworkGatewayType values. */ + public static Collection values() { + return values(VirtualNetworkGatewayType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateways.java new file mode 100644 index 0000000000000..0b13ee9716074 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateways.java @@ -0,0 +1,675 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; + +/** Resource collection API of VirtualNetworkGateways. */ +public interface VirtualNetworkGateways { + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + VirtualNetworkGateway getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayName); + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkGatewayName, Context context); + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual network gateways by resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + Response supportedVpnDevicesWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters setVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters setVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway 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 an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters getVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + String vpnDeviceConfigurationScript( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + Response vpnDeviceConfigurationScriptWithResponse( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters, + Context context); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String stopPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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. + */ + String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context); + + /** + * Gets the specified virtual network gateway by resource group. + * + * @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 the specified virtual network gateway by resource group. + */ + VirtualNetworkGateway getById(String id); + + /** + * Gets the specified virtual network gateway by resource group. + * + * @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 specified virtual network gateway by resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified virtual network gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified virtual network gateway. + * + * @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 VirtualNetworkGateway resource. + * + * @param name resource name. + * @return the first stage of the new VirtualNetworkGateway definition. + */ + VirtualNetworkGateway.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListResult.java new file mode 100644 index 0000000000000..5fad08c0ba080 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListVirtualNetworks API service call. */ +@Fluent +public final class VirtualNetworkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkListResult.class); + + /* + * A list of VirtualNetwork resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of VirtualNetwork resources in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetwork resources in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkListResult object itself. + */ + public VirtualNetworkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkListResult object itself. + */ + public VirtualNetworkListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListUsageResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListUsageResult.java new file mode 100644 index 0000000000000..95d90a8fdf375 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListUsageResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the virtual networks GetUsage API service call. */ +@Fluent +public final class VirtualNetworkListUsageResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkListUsageResult.class); + + /* + * VirtualNetwork usage stats. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: VirtualNetwork usage stats. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkListUsageResult object itself. + */ + public VirtualNetworkListUsageResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeering.java new file mode 100644 index 0000000000000..776248e92a2d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeering.java @@ -0,0 +1,589 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; + +/** An immutable client-side representation of VirtualNetworkPeering. */ +public interface VirtualNetworkPeering { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * + * @return the allowVirtualNetworkAccess value. + */ + Boolean allowVirtualNetworkAccess(); + + /** + * Gets the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local virtual network + * will be allowed/disallowed in remote virtual network. + * + * @return the allowForwardedTraffic value. + */ + Boolean allowForwardedTraffic(); + + /** + * Gets the allowGatewayTransit property: If gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @return the allowGatewayTransit value. + */ + Boolean allowGatewayTransit(); + + /** + * Gets the useRemoteGateways property: If remote gateways can be used on this virtual network. If the flag is set + * to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote + * virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @return the useRemoteGateways value. + */ + Boolean useRemoteGateways(); + + /** + * Gets the remoteVirtualNetwork property: The reference to the remote virtual network. The remote virtual network + * can be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * Gets the remoteAddressSpace property: The reference to the address space peered with the remote virtual network. + * + * @return the remoteAddressSpace value. + */ + AddressSpace remoteAddressSpace(); + + /** + * Gets the remoteVirtualNetworkAddressSpace property: The reference to the current address space of the remote + * virtual network. + * + * @return the remoteVirtualNetworkAddressSpace value. + */ + AddressSpace remoteVirtualNetworkAddressSpace(); + + /** + * Gets the remoteBgpCommunities property: The reference to the remote virtual network's Bgp Communities. + * + * @return the remoteBgpCommunities value. + */ + VirtualNetworkBgpCommunities remoteBgpCommunities(); + + /** + * Gets the peeringState property: The status of the virtual network peering. + * + * @return the peeringState value. + */ + VirtualNetworkPeeringState peeringState(); + + /** + * Gets the peeringSyncLevel property: The peering sync status of the virtual network peering. + * + * @return the peeringSyncLevel value. + */ + VirtualNetworkPeeringLevel peeringSyncLevel(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual network peering resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the doNotVerifyRemoteGateways property: If we need to verify the provisioning state of the remote gateway. + * + * @return the doNotVerifyRemoteGateways value. + */ + Boolean doNotVerifyRemoteGateways(); + + /** + * Gets the resourceGuid property: The resourceGuid property of the Virtual Network peering resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner object. + * + * @return the inner object. + */ + VirtualNetworkPeeringInner innerModel(); + + /** The entirety of the VirtualNetworkPeering definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualNetworkPeering definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkPeering definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualNetworkPeering definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualNetworkName. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the next definition stage. + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + /** + * The stage of the VirtualNetworkPeering 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.WithName, + DefinitionStages.WithType, + DefinitionStages.WithAllowVirtualNetworkAccess, + DefinitionStages.WithAllowForwardedTraffic, + DefinitionStages.WithAllowGatewayTransit, + DefinitionStages.WithUseRemoteGateways, + DefinitionStages.WithRemoteVirtualNetwork, + DefinitionStages.WithRemoteAddressSpace, + DefinitionStages.WithRemoteVirtualNetworkAddressSpace, + DefinitionStages.WithRemoteBgpCommunities, + DefinitionStages.WithPeeringState, + DefinitionStages.WithPeeringSyncLevel, + DefinitionStages.WithDoNotVerifyRemoteGateways, + DefinitionStages.WithSyncRemoteAddressSpace { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkPeering create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkPeering create(Context context); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify allowVirtualNetworkAccess. */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space + * would be able to access the VMs in remote virtual network space.. + * + * @param allowVirtualNetworkAccess Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * @return the next definition stage. + */ + WithCreate withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify allowForwardedTraffic. */ + interface WithAllowForwardedTraffic { + /** + * Specifies the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local + * virtual network will be allowed/disallowed in remote virtual network.. + * + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the local virtual network will + * be allowed/disallowed in remote virtual network. + * @return the next definition stage. + */ + WithCreate withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify allowGatewayTransit. */ + interface WithAllowGatewayTransit { + /** + * Specifies the allowGatewayTransit property: If gateway links can be used in remote virtual networking to + * link to this virtual network.. + * + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this + * virtual network. + * @return the next definition stage. + */ + WithCreate withAllowGatewayTransit(Boolean allowGatewayTransit); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify useRemoteGateways. */ + interface WithUseRemoteGateways { + /** + * Specifies the useRemoteGateways property: If remote gateways can be used on this virtual network. If the + * flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use + * gateways of remote virtual network for transit. Only one peering can have this flag set to true. This + * flag cannot be set if virtual network already has a gateway.. + * + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of + * remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot + * be set if virtual network already has a gateway. + * @return the next definition stage. + */ + WithCreate withUseRemoteGateways(Boolean useRemoteGateways); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteVirtualNetwork. */ + interface WithRemoteVirtualNetwork { + /** + * Specifies the remoteVirtualNetwork property: The reference to the remote virtual network. The remote + * virtual network can be in the same or different region (preview). See here to register for the preview + * and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).. + * + * @param remoteVirtualNetwork The reference to the remote virtual network. The remote virtual network can + * be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @return the next definition stage. + */ + WithCreate withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteAddressSpace. */ + interface WithRemoteAddressSpace { + /** + * Specifies the remoteAddressSpace property: The reference to the address space peered with the remote + * virtual network.. + * + * @param remoteAddressSpace The reference to the address space peered with the remote virtual network. + * @return the next definition stage. + */ + WithCreate withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteVirtualNetworkAddressSpace. */ + interface WithRemoteVirtualNetworkAddressSpace { + /** + * Specifies the remoteVirtualNetworkAddressSpace property: The reference to the current address space of + * the remote virtual network.. + * + * @param remoteVirtualNetworkAddressSpace The reference to the current address space of the remote virtual + * network. + * @return the next definition stage. + */ + WithCreate withRemoteVirtualNetworkAddressSpace(AddressSpace remoteVirtualNetworkAddressSpace); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteBgpCommunities. */ + interface WithRemoteBgpCommunities { + /** + * Specifies the remoteBgpCommunities property: The reference to the remote virtual network's Bgp + * Communities.. + * + * @param remoteBgpCommunities The reference to the remote virtual network's Bgp Communities. + * @return the next definition stage. + */ + WithCreate withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify peeringState. */ + interface WithPeeringState { + /** + * Specifies the peeringState property: The status of the virtual network peering.. + * + * @param peeringState The status of the virtual network peering. + * @return the next definition stage. + */ + WithCreate withPeeringState(VirtualNetworkPeeringState peeringState); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify peeringSyncLevel. */ + interface WithPeeringSyncLevel { + /** + * Specifies the peeringSyncLevel property: The peering sync status of the virtual network peering.. + * + * @param peeringSyncLevel The peering sync status of the virtual network peering. + * @return the next definition stage. + */ + WithCreate withPeeringSyncLevel(VirtualNetworkPeeringLevel peeringSyncLevel); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify doNotVerifyRemoteGateways. */ + interface WithDoNotVerifyRemoteGateways { + /** + * Specifies the doNotVerifyRemoteGateways property: If we need to verify the provisioning state of the + * remote gateway.. + * + * @param doNotVerifyRemoteGateways If we need to verify the provisioning state of the remote gateway. + * @return the next definition stage. + */ + WithCreate withDoNotVerifyRemoteGateways(Boolean doNotVerifyRemoteGateways); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify syncRemoteAddressSpace. */ + interface WithSyncRemoteAddressSpace { + /** + * Specifies the syncRemoteAddressSpace property: Parameter indicates the intention to sync the peering with + * the current address space on the remote vNet after it's updated.. + * + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current + * address space on the remote vNet after it's updated. + * @return the next definition stage. + */ + WithCreate withSyncRemoteAddressSpace(SyncRemoteAddressSpace syncRemoteAddressSpace); + } + } + /** + * Begins update for the VirtualNetworkPeering resource. + * + * @return the stage of resource update. + */ + VirtualNetworkPeering.Update update(); + + /** The template for VirtualNetworkPeering update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithAllowVirtualNetworkAccess, + UpdateStages.WithAllowForwardedTraffic, + UpdateStages.WithAllowGatewayTransit, + UpdateStages.WithUseRemoteGateways, + UpdateStages.WithRemoteVirtualNetwork, + UpdateStages.WithRemoteAddressSpace, + UpdateStages.WithRemoteVirtualNetworkAddressSpace, + UpdateStages.WithRemoteBgpCommunities, + UpdateStages.WithPeeringState, + UpdateStages.WithPeeringSyncLevel, + UpdateStages.WithDoNotVerifyRemoteGateways, + UpdateStages.WithSyncRemoteAddressSpace { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkPeering apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkPeering apply(Context context); + } + /** The VirtualNetworkPeering update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkPeering update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VirtualNetworkPeering update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the VirtualNetworkPeering update allowing to specify allowVirtualNetworkAccess. */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space + * would be able to access the VMs in remote virtual network space.. + * + * @param allowVirtualNetworkAccess Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * @return the next definition stage. + */ + Update withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + /** The stage of the VirtualNetworkPeering update allowing to specify allowForwardedTraffic. */ + interface WithAllowForwardedTraffic { + /** + * Specifies the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local + * virtual network will be allowed/disallowed in remote virtual network.. + * + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the local virtual network will + * be allowed/disallowed in remote virtual network. + * @return the next definition stage. + */ + Update withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + /** The stage of the VirtualNetworkPeering update allowing to specify allowGatewayTransit. */ + interface WithAllowGatewayTransit { + /** + * Specifies the allowGatewayTransit property: If gateway links can be used in remote virtual networking to + * link to this virtual network.. + * + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this + * virtual network. + * @return the next definition stage. + */ + Update withAllowGatewayTransit(Boolean allowGatewayTransit); + } + /** The stage of the VirtualNetworkPeering update allowing to specify useRemoteGateways. */ + interface WithUseRemoteGateways { + /** + * Specifies the useRemoteGateways property: If remote gateways can be used on this virtual network. If the + * flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use + * gateways of remote virtual network for transit. Only one peering can have this flag set to true. This + * flag cannot be set if virtual network already has a gateway.. + * + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of + * remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot + * be set if virtual network already has a gateway. + * @return the next definition stage. + */ + Update withUseRemoteGateways(Boolean useRemoteGateways); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteVirtualNetwork. */ + interface WithRemoteVirtualNetwork { + /** + * Specifies the remoteVirtualNetwork property: The reference to the remote virtual network. The remote + * virtual network can be in the same or different region (preview). See here to register for the preview + * and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).. + * + * @param remoteVirtualNetwork The reference to the remote virtual network. The remote virtual network can + * be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @return the next definition stage. + */ + Update withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteAddressSpace. */ + interface WithRemoteAddressSpace { + /** + * Specifies the remoteAddressSpace property: The reference to the address space peered with the remote + * virtual network.. + * + * @param remoteAddressSpace The reference to the address space peered with the remote virtual network. + * @return the next definition stage. + */ + Update withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteVirtualNetworkAddressSpace. */ + interface WithRemoteVirtualNetworkAddressSpace { + /** + * Specifies the remoteVirtualNetworkAddressSpace property: The reference to the current address space of + * the remote virtual network.. + * + * @param remoteVirtualNetworkAddressSpace The reference to the current address space of the remote virtual + * network. + * @return the next definition stage. + */ + Update withRemoteVirtualNetworkAddressSpace(AddressSpace remoteVirtualNetworkAddressSpace); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteBgpCommunities. */ + interface WithRemoteBgpCommunities { + /** + * Specifies the remoteBgpCommunities property: The reference to the remote virtual network's Bgp + * Communities.. + * + * @param remoteBgpCommunities The reference to the remote virtual network's Bgp Communities. + * @return the next definition stage. + */ + Update withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities); + } + /** The stage of the VirtualNetworkPeering update allowing to specify peeringState. */ + interface WithPeeringState { + /** + * Specifies the peeringState property: The status of the virtual network peering.. + * + * @param peeringState The status of the virtual network peering. + * @return the next definition stage. + */ + Update withPeeringState(VirtualNetworkPeeringState peeringState); + } + /** The stage of the VirtualNetworkPeering update allowing to specify peeringSyncLevel. */ + interface WithPeeringSyncLevel { + /** + * Specifies the peeringSyncLevel property: The peering sync status of the virtual network peering.. + * + * @param peeringSyncLevel The peering sync status of the virtual network peering. + * @return the next definition stage. + */ + Update withPeeringSyncLevel(VirtualNetworkPeeringLevel peeringSyncLevel); + } + /** The stage of the VirtualNetworkPeering update allowing to specify doNotVerifyRemoteGateways. */ + interface WithDoNotVerifyRemoteGateways { + /** + * Specifies the doNotVerifyRemoteGateways property: If we need to verify the provisioning state of the + * remote gateway.. + * + * @param doNotVerifyRemoteGateways If we need to verify the provisioning state of the remote gateway. + * @return the next definition stage. + */ + Update withDoNotVerifyRemoteGateways(Boolean doNotVerifyRemoteGateways); + } + /** The stage of the VirtualNetworkPeering update allowing to specify syncRemoteAddressSpace. */ + interface WithSyncRemoteAddressSpace { + /** + * Specifies the syncRemoteAddressSpace property: Parameter indicates the intention to sync the peering with + * the current address space on the remote vNet after it's updated.. + * + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current + * address space on the remote vNet after it's updated. + * @return the next definition stage. + */ + Update withSyncRemoteAddressSpace(SyncRemoteAddressSpace syncRemoteAddressSpace); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkPeering refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkPeering refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.java new file mode 100644 index 0000000000000..8b31e5b4c428f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkPeeringLevel. */ +public final class VirtualNetworkPeeringLevel extends ExpandableStringEnum { + /** Static value FullyInSync for VirtualNetworkPeeringLevel. */ + public static final VirtualNetworkPeeringLevel FULLY_IN_SYNC = fromString("FullyInSync"); + + /** Static value RemoteNotInSync for VirtualNetworkPeeringLevel. */ + public static final VirtualNetworkPeeringLevel REMOTE_NOT_IN_SYNC = fromString("RemoteNotInSync"); + + /** Static value LocalNotInSync for VirtualNetworkPeeringLevel. */ + public static final VirtualNetworkPeeringLevel LOCAL_NOT_IN_SYNC = fromString("LocalNotInSync"); + + /** Static value LocalAndRemoteNotInSync for VirtualNetworkPeeringLevel. */ + public static final VirtualNetworkPeeringLevel LOCAL_AND_REMOTE_NOT_IN_SYNC = fromString("LocalAndRemoteNotInSync"); + + /** + * Creates or finds a VirtualNetworkPeeringLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPeeringLevel. + */ + @JsonCreator + public static VirtualNetworkPeeringLevel fromString(String name) { + return fromString(name, VirtualNetworkPeeringLevel.class); + } + + /** @return known VirtualNetworkPeeringLevel values. */ + public static Collection values() { + return values(VirtualNetworkPeeringLevel.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringListResult.java new file mode 100644 index 0000000000000..8212a5e4932ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. */ +@Fluent +public final class VirtualNetworkPeeringListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringListResult.class); + + /* + * The peerings in a virtual network. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The peerings in a virtual network. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The peerings in a virtual network. + * + * @param value the value value to set. + * @return the VirtualNetworkPeeringListResult object itself. + */ + public VirtualNetworkPeeringListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkPeeringListResult object itself. + */ + public VirtualNetworkPeeringListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringState.java new file mode 100644 index 0000000000000..c1e276e78b651 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkPeeringState. */ +public final class VirtualNetworkPeeringState extends ExpandableStringEnum { + /** Static value Initiated for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState INITIATED = fromString("Initiated"); + + /** Static value Connected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState CONNECTED = fromString("Connected"); + + /** Static value Disconnected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a VirtualNetworkPeeringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPeeringState. + */ + @JsonCreator + public static VirtualNetworkPeeringState fromString(String name) { + return fromString(name, VirtualNetworkPeeringState.class); + } + + /** @return known VirtualNetworkPeeringState values. */ + public static Collection values() { + return values(VirtualNetworkPeeringState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeerings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeerings.java new file mode 100644 index 0000000000000..04293e2c01346 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeerings.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.network.generated.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 VirtualNetworkPeerings. */ +public interface VirtualNetworkPeerings { + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, String virtualNetworkPeeringName, Context context); + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + VirtualNetworkPeering get(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + PagedIterable list(String resourceGroupName, String virtualNetworkName); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * Gets the specified virtual network peering. + * + * @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 the specified virtual network peering. + */ + VirtualNetworkPeering getById(String id); + + /** + * Gets the specified virtual network peering. + * + * @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 specified virtual network peering. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified virtual network peering. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified virtual network peering. + * + * @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 VirtualNetworkPeering resource. + * + * @param name resource name. + * @return the first stage of the new VirtualNetworkPeering definition. + */ + VirtualNetworkPeering.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateEndpointNetworkPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateEndpointNetworkPolicies.java new file mode 100644 index 0000000000000..0a8306899f29f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateEndpointNetworkPolicies.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkPrivateEndpointNetworkPolicies. */ +public final class VirtualNetworkPrivateEndpointNetworkPolicies + extends ExpandableStringEnum { + /** Static value Enabled for VirtualNetworkPrivateEndpointNetworkPolicies. */ + public static final VirtualNetworkPrivateEndpointNetworkPolicies ENABLED = fromString("Enabled"); + + /** Static value Disabled for VirtualNetworkPrivateEndpointNetworkPolicies. */ + public static final VirtualNetworkPrivateEndpointNetworkPolicies DISABLED = fromString("Disabled"); + + /** + * Creates or finds a VirtualNetworkPrivateEndpointNetworkPolicies from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPrivateEndpointNetworkPolicies. + */ + @JsonCreator + public static VirtualNetworkPrivateEndpointNetworkPolicies fromString(String name) { + return fromString(name, VirtualNetworkPrivateEndpointNetworkPolicies.class); + } + + /** @return known VirtualNetworkPrivateEndpointNetworkPolicies values. */ + public static Collection values() { + return values(VirtualNetworkPrivateEndpointNetworkPolicies.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateLinkServiceNetworkPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateLinkServiceNetworkPolicies.java new file mode 100644 index 0000000000000..34fc8246d8567 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateLinkServiceNetworkPolicies.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkPrivateLinkServiceNetworkPolicies. */ +public final class VirtualNetworkPrivateLinkServiceNetworkPolicies + extends ExpandableStringEnum { + /** Static value Enabled for VirtualNetworkPrivateLinkServiceNetworkPolicies. */ + public static final VirtualNetworkPrivateLinkServiceNetworkPolicies ENABLED = fromString("Enabled"); + + /** Static value Disabled for VirtualNetworkPrivateLinkServiceNetworkPolicies. */ + public static final VirtualNetworkPrivateLinkServiceNetworkPolicies DISABLED = fromString("Disabled"); + + /** + * Creates or finds a VirtualNetworkPrivateLinkServiceNetworkPolicies from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPrivateLinkServiceNetworkPolicies. + */ + @JsonCreator + public static VirtualNetworkPrivateLinkServiceNetworkPolicies fromString(String name) { + return fromString(name, VirtualNetworkPrivateLinkServiceNetworkPolicies.class); + } + + /** @return known VirtualNetworkPrivateLinkServiceNetworkPolicies values. */ + public static Collection values() { + return values(VirtualNetworkPrivateLinkServiceNetworkPolicies.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTap.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTap.java new file mode 100644 index 0000000000000..1a6debd0286f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTap.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetworkTap. */ +public interface VirtualNetworkTap { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the networkInterfaceTapConfigurations property: Specifies the list of resource IDs for the network interface + * IP configuration that needs to be tapped. + * + * @return the networkInterfaceTapConfigurations value. + */ + List networkInterfaceTapConfigurations(); + + /** + * Gets the resourceGuid property: The resource GUID property of the virtual network tap resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual network tap resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the destinationNetworkInterfaceIpConfiguration property: The reference to the private IP Address of the + * collector nic that will receive the tap. + * + * @return the destinationNetworkInterfaceIpConfiguration value. + */ + NetworkInterfaceIpConfiguration destinationNetworkInterfaceIpConfiguration(); + + /** + * Gets the destinationLoadBalancerFrontEndIpConfiguration property: The reference to the private IP address on the + * internal Load Balancer that will receive the tap. + * + * @return the destinationLoadBalancerFrontEndIpConfiguration value. + */ + FrontendIpConfiguration destinationLoadBalancerFrontEndIpConfiguration(); + + /** + * Gets the destinationPort property: The VXLAN destination port that will receive the tapped traffic. + * + * @return the destinationPort value. + */ + Integer destinationPort(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VirtualNetworkTapInner object. + * + * @return the inner object. + */ + VirtualNetworkTapInner innerModel(); + + /** The entirety of the VirtualNetworkTap definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualNetworkTap definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkTap definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualNetworkTap 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 VirtualNetworkTap definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualNetworkTap 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.WithDestinationNetworkInterfaceIpConfiguration, + DefinitionStages.WithDestinationLoadBalancerFrontEndIpConfiguration, + DefinitionStages.WithDestinationPort { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkTap create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkTap create(Context context); + } + /** The stage of the VirtualNetworkTap 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 VirtualNetworkTap definition allowing to specify destinationNetworkInterfaceIpConfiguration. + */ + interface WithDestinationNetworkInterfaceIpConfiguration { + /** + * Specifies the destinationNetworkInterfaceIpConfiguration property: The reference to the private IP + * Address of the collector nic that will receive the tap.. + * + * @param destinationNetworkInterfaceIpConfiguration The reference to the private IP Address of the + * collector nic that will receive the tap. + * @return the next definition stage. + */ + WithCreate withDestinationNetworkInterfaceIpConfiguration( + NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration); + } + /** + * The stage of the VirtualNetworkTap definition allowing to specify + * destinationLoadBalancerFrontEndIpConfiguration. + */ + interface WithDestinationLoadBalancerFrontEndIpConfiguration { + /** + * Specifies the destinationLoadBalancerFrontEndIpConfiguration property: The reference to the private IP + * address on the internal Load Balancer that will receive the tap.. + * + * @param destinationLoadBalancerFrontEndIpConfiguration The reference to the private IP address on the + * internal Load Balancer that will receive the tap. + * @return the next definition stage. + */ + WithCreate withDestinationLoadBalancerFrontEndIpConfiguration( + FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration); + } + /** The stage of the VirtualNetworkTap definition allowing to specify destinationPort. */ + interface WithDestinationPort { + /** + * Specifies the destinationPort property: The VXLAN destination port that will receive the tapped traffic.. + * + * @param destinationPort The VXLAN destination port that will receive the tapped traffic. + * @return the next definition stage. + */ + WithCreate withDestinationPort(Integer destinationPort); + } + } + /** + * Begins update for the VirtualNetworkTap resource. + * + * @return the stage of resource update. + */ + VirtualNetworkTap.Update update(); + + /** The template for VirtualNetworkTap update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkTap apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkTap apply(Context context); + } + /** The VirtualNetworkTap update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkTap 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkTap refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkTap refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapListResult.java new file mode 100644 index 0000000000000..23d1bd19b8bf4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListVirtualNetworkTap API service call. */ +@Fluent +public final class VirtualNetworkTapListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapListResult.class); + + /* + * A list of VirtualNetworkTaps in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of VirtualNetworkTaps in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetworkTaps in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkTapListResult object itself. + */ + public VirtualNetworkTapListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkTapListResult object itself. + */ + public VirtualNetworkTapListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTaps.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTaps.java new file mode 100644 index 0000000000000..70447adbcb441 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTaps.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VirtualNetworkTaps. */ +public interface VirtualNetworkTaps { + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 tapName); + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 tapName, Context context); + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + VirtualNetworkTap getByResourceGroup(String resourceGroupName, String tapName); + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String tapName, Context context); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the VirtualNetworkTaps 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 all the VirtualNetworkTaps in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource 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 all the VirtualNetworkTaps in a subscription. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified virtual network tap. + * + * @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 information about the specified virtual network tap. + */ + VirtualNetworkTap getById(String id); + + /** + * Gets information about the specified virtual network tap. + * + * @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 information about the specified virtual network tap. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified virtual network tap. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified virtual network tap. + * + * @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 VirtualNetworkTap resource. + * + * @param name resource name. + * @return the first stage of the new VirtualNetworkTap definition. + */ + VirtualNetworkTap.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsage.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsage.java new file mode 100644 index 0000000000000..dffc0d4bdb35c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsage.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.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; + +/** An immutable client-side representation of VirtualNetworkUsage. */ +public interface VirtualNetworkUsage { + /** + * Gets the currentValue property: Indicates number of IPs used from the Subnet. + * + * @return the currentValue value. + */ + Double currentValue(); + + /** + * Gets the id property: Subnet identifier. + * + * @return the id value. + */ + String id(); + + /** + * Gets the limit property: Indicates the size of the subnet. + * + * @return the limit value. + */ + Double limit(); + + /** + * Gets the name property: The name containing common and localized value for usage. + * + * @return the name value. + */ + VirtualNetworkUsageName name(); + + /** + * Gets the unit property: Usage units. Returns 'Count'. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner object. + * + * @return the inner object. + */ + VirtualNetworkUsageInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsageName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsageName.java new file mode 100644 index 0000000000000..626d6ab9f7522 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsageName.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.network.generated.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; + +/** Usage strings container. */ +@Immutable +public final class VirtualNetworkUsageName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkUsageName.class); + + /* + * Localized subnet size and usage string. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /* + * Subnet size and usage string. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the localizedValue property: Localized subnet size and usage string. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Get the value property: Subnet size and usage string. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworks.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworks.java new file mode 100644 index 0000000000000..8e6ff84c64ae3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworks.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.network.generated.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 VirtualNetworks. */ +public interface VirtualNetworks { + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName); + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualNetworkName, Context context); + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName); + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, String expand, Context context); + + /** + * Gets all virtual networks in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + PagedIterable list(); + + /** + * Gets all virtual networks 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 all virtual networks in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource 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 all virtual networks in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + IpAddressAvailabilityResult checkIpAddressAvailability( + String resourceGroupName, String virtualNetworkName, String ipAddress); + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + Response checkIpAddressAvailabilityWithResponse( + String resourceGroupName, String virtualNetworkName, String ipAddress, Context context); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + PagedIterable listUsage(String resourceGroupName, String virtualNetworkName); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + PagedIterable listUsage(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * Gets the specified virtual network by resource group. + * + * @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 the specified virtual network by resource group. + */ + VirtualNetwork getById(String id); + + /** + * Gets the specified virtual network by resource group. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified virtual 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 deleteById(String id); + + /** + * Deletes the specified virtual 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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VirtualNetwork resource. + * + * @param name resource name. + * @return the first stage of the new VirtualNetwork definition. + */ + VirtualNetwork.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouter.java new file mode 100644 index 0000000000000..401962acb3bb5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouter.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualRouter. */ +public interface VirtualRouter { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the virtualRouterAsn property: VirtualRouter ASN. + * + * @return the virtualRouterAsn value. + */ + Long virtualRouterAsn(); + + /** + * Gets the virtualRouterIps property: VirtualRouter IPs. + * + * @return the virtualRouterIps value. + */ + List virtualRouterIps(); + + /** + * Gets the hostedSubnet property: The Subnet on which VirtualRouter is hosted. + * + * @return the hostedSubnet value. + */ + SubResource hostedSubnet(); + + /** + * Gets the hostedGateway property: The Gateway on which VirtualRouter is hosted. + * + * @return the hostedGateway value. + */ + SubResource hostedGateway(); + + /** + * Gets the peerings property: List of references to VirtualRouterPeerings. + * + * @return the peerings value. + */ + List peerings(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VirtualRouterInner object. + * + * @return the inner object. + */ + VirtualRouterInner innerModel(); + + /** The entirety of the VirtualRouter definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualRouter definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualRouter definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualRouter 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 VirtualRouter definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualRouter 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.WithVirtualRouterAsn, + DefinitionStages.WithVirtualRouterIps, + DefinitionStages.WithHostedSubnet, + DefinitionStages.WithHostedGateway { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualRouter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualRouter create(Context context); + } + /** The stage of the VirtualRouter 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 VirtualRouter definition allowing to specify virtualRouterAsn. */ + interface WithVirtualRouterAsn { + /** + * Specifies the virtualRouterAsn property: VirtualRouter ASN.. + * + * @param virtualRouterAsn VirtualRouter ASN. + * @return the next definition stage. + */ + WithCreate withVirtualRouterAsn(Long virtualRouterAsn); + } + /** The stage of the VirtualRouter definition allowing to specify virtualRouterIps. */ + interface WithVirtualRouterIps { + /** + * Specifies the virtualRouterIps property: VirtualRouter IPs.. + * + * @param virtualRouterIps VirtualRouter IPs. + * @return the next definition stage. + */ + WithCreate withVirtualRouterIps(List virtualRouterIps); + } + /** The stage of the VirtualRouter definition allowing to specify hostedSubnet. */ + interface WithHostedSubnet { + /** + * Specifies the hostedSubnet property: The Subnet on which VirtualRouter is hosted.. + * + * @param hostedSubnet The Subnet on which VirtualRouter is hosted. + * @return the next definition stage. + */ + WithCreate withHostedSubnet(SubResource hostedSubnet); + } + /** The stage of the VirtualRouter definition allowing to specify hostedGateway. */ + interface WithHostedGateway { + /** + * Specifies the hostedGateway property: The Gateway on which VirtualRouter is hosted.. + * + * @param hostedGateway The Gateway on which VirtualRouter is hosted. + * @return the next definition stage. + */ + WithCreate withHostedGateway(SubResource hostedGateway); + } + } + /** + * Begins update for the VirtualRouter resource. + * + * @return the stage of resource update. + */ + VirtualRouter.Update update(); + + /** The template for VirtualRouter update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithVirtualRouterAsn, + UpdateStages.WithVirtualRouterIps, + UpdateStages.WithHostedSubnet, + UpdateStages.WithHostedGateway { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualRouter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualRouter apply(Context context); + } + /** The VirtualRouter update stages. */ + interface UpdateStages { + /** The stage of the VirtualRouter 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 VirtualRouter update allowing to specify virtualRouterAsn. */ + interface WithVirtualRouterAsn { + /** + * Specifies the virtualRouterAsn property: VirtualRouter ASN.. + * + * @param virtualRouterAsn VirtualRouter ASN. + * @return the next definition stage. + */ + Update withVirtualRouterAsn(Long virtualRouterAsn); + } + /** The stage of the VirtualRouter update allowing to specify virtualRouterIps. */ + interface WithVirtualRouterIps { + /** + * Specifies the virtualRouterIps property: VirtualRouter IPs.. + * + * @param virtualRouterIps VirtualRouter IPs. + * @return the next definition stage. + */ + Update withVirtualRouterIps(List virtualRouterIps); + } + /** The stage of the VirtualRouter update allowing to specify hostedSubnet. */ + interface WithHostedSubnet { + /** + * Specifies the hostedSubnet property: The Subnet on which VirtualRouter is hosted.. + * + * @param hostedSubnet The Subnet on which VirtualRouter is hosted. + * @return the next definition stage. + */ + Update withHostedSubnet(SubResource hostedSubnet); + } + /** The stage of the VirtualRouter update allowing to specify hostedGateway. */ + interface WithHostedGateway { + /** + * Specifies the hostedGateway property: The Gateway on which VirtualRouter is hosted.. + * + * @param hostedGateway The Gateway on which VirtualRouter is hosted. + * @return the next definition stage. + */ + Update withHostedGateway(SubResource hostedGateway); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualRouter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualRouter refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterListResult.java new file mode 100644 index 0000000000000..ae48ce2548ff2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListVirtualRouters API service call. */ +@Fluent +public final class VirtualRouterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterListResult.class); + + /* + * List of Virtual Routers. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Virtual Routers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Virtual Routers. + * + * @param value the value value to set. + * @return the VirtualRouterListResult object itself. + */ + public VirtualRouterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualRouterListResult object itself. + */ + public VirtualRouterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeering.java new file mode 100644 index 0000000000000..4588eca51a81a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeering.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.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; + +/** An immutable client-side representation of VirtualRouterPeering. */ +public interface VirtualRouterPeering { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the virtual router peering that is unique within a virtual router. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Peering type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the peerAsn property: Peer ASN. + * + * @return the peerAsn value. + */ + Long peerAsn(); + + /** + * Gets the peerIp property: Peer IP. + * + * @return the peerIp value. + */ + String peerIp(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner object. + * + * @return the inner object. + */ + VirtualRouterPeeringInner innerModel(); + + /** The entirety of the VirtualRouterPeering definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualRouterPeering definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualRouterPeering definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualRouterPeering definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualRouterName. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @return the next definition stage. + */ + WithCreate withExistingVirtualRouter(String resourceGroupName, String virtualRouterName); + } + /** + * The stage of the VirtualRouterPeering 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.WithName, DefinitionStages.WithPeerAsn, DefinitionStages.WithPeerIp { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualRouterPeering create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualRouterPeering create(Context context); + } + /** The stage of the VirtualRouterPeering definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the virtual router peering that is unique within a virtual router.. + * + * @param name Name of the virtual router peering that is unique within a virtual router. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualRouterPeering definition allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: Peer ASN.. + * + * @param peerAsn Peer ASN. + * @return the next definition stage. + */ + WithCreate withPeerAsn(Long peerAsn); + } + /** The stage of the VirtualRouterPeering definition allowing to specify peerIp. */ + interface WithPeerIp { + /** + * Specifies the peerIp property: Peer IP.. + * + * @param peerIp Peer IP. + * @return the next definition stage. + */ + WithCreate withPeerIp(String peerIp); + } + } + /** + * Begins update for the VirtualRouterPeering resource. + * + * @return the stage of resource update. + */ + VirtualRouterPeering.Update update(); + + /** The template for VirtualRouterPeering update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithPeerAsn, UpdateStages.WithPeerIp { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualRouterPeering apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualRouterPeering apply(Context context); + } + /** The VirtualRouterPeering update stages. */ + interface UpdateStages { + /** The stage of the VirtualRouterPeering update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the virtual router peering that is unique within a virtual router.. + * + * @param name Name of the virtual router peering that is unique within a virtual router. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VirtualRouterPeering update allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: Peer ASN.. + * + * @param peerAsn Peer ASN. + * @return the next definition stage. + */ + Update withPeerAsn(Long peerAsn); + } + /** The stage of the VirtualRouterPeering update allowing to specify peerIp. */ + interface WithPeerIp { + /** + * Specifies the peerIp property: Peer IP.. + * + * @param peerIp Peer IP. + * @return the next definition stage. + */ + Update withPeerIp(String peerIp); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualRouterPeering refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualRouterPeering refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeeringListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeeringListResult.java new file mode 100644 index 0000000000000..764a56e7600a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeeringListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListVirtualRouterPeerings API service call. */ +@Fluent +public final class VirtualRouterPeeringListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterPeeringListResult.class); + + /* + * List of VirtualRouterPeerings in a VirtualRouter. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VirtualRouterPeerings in a VirtualRouter. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VirtualRouterPeerings in a VirtualRouter. + * + * @param value the value value to set. + * @return the VirtualRouterPeeringListResult object itself. + */ + public VirtualRouterPeeringListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualRouterPeeringListResult object itself. + */ + public VirtualRouterPeeringListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeerings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeerings.java new file mode 100644 index 0000000000000..3c2b95946e671 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeerings.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VirtualRouterPeerings. */ +public interface VirtualRouterPeerings { + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName, String peeringName); + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName, String peeringName, Context context); + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + VirtualRouterPeering get(String resourceGroupName, String virtualRouterName, String peeringName); + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + Response getWithResponse( + String resourceGroupName, String virtualRouterName, String peeringName, Context context); + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + PagedIterable list(String resourceGroupName, String virtualRouterName); + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + PagedIterable list(String resourceGroupName, String virtualRouterName, Context context); + + /** + * Gets the specified Virtual Router Peering. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + VirtualRouterPeering getById(String id); + + /** + * Gets the specified Virtual Router Peering. + * + * @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.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified peering from a Virtual Router. + * + * @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.resourcemanager.network.generated.models.ErrorException 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 VirtualRouterPeering resource. + * + * @param name resource name. + * @return the first stage of the new VirtualRouterPeering definition. + */ + VirtualRouterPeering.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouters.java new file mode 100644 index 0000000000000..da0a0d8d2d5a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouters.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VirtualRouters. */ +public interface VirtualRouters { + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName); + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException 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 virtualRouterName, Context context); + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + VirtualRouter getByResourceGroup(String resourceGroupName, String virtualRouterName); + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualRouterName, String expand, Context context); + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Virtual Routers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Virtual Router. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + VirtualRouter getById(String id); + + /** + * Gets the specified Virtual Router. + * + * @param id the resource ID. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes the specified Virtual Router. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Virtual Router. + * + * @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.resourcemanager.network.generated.models.ErrorException 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 VirtualRouter resource. + * + * @param name resource name. + * @return the first stage of the new VirtualRouter definition. + */ + VirtualRouter.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWan.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWan.java new file mode 100644 index 0000000000000..ae8b6c27a66d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWan.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualWan. */ +public interface VirtualWan { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the disableVpnEncryption property: Vpn encryption to be disabled or not. + * + * @return the disableVpnEncryption value. + */ + Boolean disableVpnEncryption(); + + /** + * Gets the virtualHubs property: List of VirtualHubs in the VirtualWAN. + * + * @return the virtualHubs value. + */ + List virtualHubs(); + + /** + * Gets the vpnSites property: List of VpnSites in the VirtualWAN. + * + * @return the vpnSites value. + */ + List vpnSites(); + + /** + * Gets the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed. + * + * @return the allowBranchToBranchTraffic value. + */ + Boolean allowBranchToBranchTraffic(); + + /** + * Gets the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed. + * + * @return the allowVnetToVnetTraffic value. + */ + Boolean allowVnetToVnetTraffic(); + + /** + * Gets the office365LocalBreakoutCategory property: The office local breakout category. + * + * @return the office365LocalBreakoutCategory value. + */ + OfficeTrafficCategory office365LocalBreakoutCategory(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual WAN resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the typePropertiesType property: The type of the VirtualWAN. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VirtualWanInner object. + * + * @return the inner object. + */ + VirtualWanInner innerModel(); + + /** The entirety of the VirtualWan definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualWan definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualWan definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualWan 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 VirtualWan definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualWan 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.WithDisableVpnEncryption, + DefinitionStages.WithAllowBranchToBranchTraffic, + DefinitionStages.WithAllowVnetToVnetTraffic, + DefinitionStages.WithTypePropertiesType { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualWan create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualWan create(Context context); + } + /** The stage of the VirtualWan 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 VirtualWan definition allowing to specify disableVpnEncryption. */ + interface WithDisableVpnEncryption { + /** + * Specifies the disableVpnEncryption property: Vpn encryption to be disabled or not.. + * + * @param disableVpnEncryption Vpn encryption to be disabled or not. + * @return the next definition stage. + */ + WithCreate withDisableVpnEncryption(Boolean disableVpnEncryption); + } + /** The stage of the VirtualWan definition allowing to specify allowBranchToBranchTraffic. */ + interface WithAllowBranchToBranchTraffic { + /** + * Specifies the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed.. + * + * @param allowBranchToBranchTraffic True if branch to branch traffic is allowed. + * @return the next definition stage. + */ + WithCreate withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic); + } + /** The stage of the VirtualWan definition allowing to specify allowVnetToVnetTraffic. */ + interface WithAllowVnetToVnetTraffic { + /** + * Specifies the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed.. + * + * @param allowVnetToVnetTraffic True if Vnet to Vnet traffic is allowed. + * @return the next definition stage. + */ + WithCreate withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic); + } + /** The stage of the VirtualWan definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of the VirtualWAN.. + * + * @param typePropertiesType The type of the VirtualWAN. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + } + /** + * Begins update for the VirtualWan resource. + * + * @return the stage of resource update. + */ + VirtualWan.Update update(); + + /** The template for VirtualWan update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualWan apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualWan apply(Context context); + } + /** The VirtualWan update stages. */ + interface UpdateStages { + /** The stage of the VirtualWan 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualWan refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualWan refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProvider.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProvider.java new file mode 100644 index 0000000000000..b175234527e3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProvider.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Collection of SecurityProviders. */ +@Fluent +public final class VirtualWanSecurityProvider { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanSecurityProvider.class); + + /* + * Name of the security provider. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Url of the security provider. + */ + @JsonProperty(value = "url") + private String url; + + /* + * Name of the security provider. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private VirtualWanSecurityProviderType type; + + /** + * Get the name property: Name of the security provider. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the security provider. + * + * @param name the name value to set. + * @return the VirtualWanSecurityProvider object itself. + */ + public VirtualWanSecurityProvider withName(String name) { + this.name = name; + return this; + } + + /** + * Get the url property: Url of the security provider. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Url of the security provider. + * + * @param url the url value to set. + * @return the VirtualWanSecurityProvider object itself. + */ + public VirtualWanSecurityProvider withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the type property: Name of the security provider. + * + * @return the type value. + */ + public VirtualWanSecurityProviderType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviderType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviderType.java new file mode 100644 index 0000000000000..a7e850ba6078f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviderType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualWanSecurityProviderType. */ +public final class VirtualWanSecurityProviderType extends ExpandableStringEnum { + /** Static value External for VirtualWanSecurityProviderType. */ + public static final VirtualWanSecurityProviderType EXTERNAL = fromString("External"); + + /** Static value Native for VirtualWanSecurityProviderType. */ + public static final VirtualWanSecurityProviderType NATIVE = fromString("Native"); + + /** + * Creates or finds a VirtualWanSecurityProviderType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualWanSecurityProviderType. + */ + @JsonCreator + public static VirtualWanSecurityProviderType fromString(String name) { + return fromString(name, VirtualWanSecurityProviderType.class); + } + + /** @return known VirtualWanSecurityProviderType values. */ + public static Collection values() { + return values(VirtualWanSecurityProviderType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviders.java new file mode 100644 index 0000000000000..44a392862636d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviders.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import java.util.List; + +/** An immutable client-side representation of VirtualWanSecurityProviders. */ +public interface VirtualWanSecurityProviders { + /** + * Gets the supportedProviders property: List of VirtualWAN security providers. + * + * @return the supportedProviders value. + */ + List supportedProviders(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner object. + * + * @return the inner object. + */ + VirtualWanSecurityProvidersInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java new file mode 100644 index 0000000000000..c4c29b079b54e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** Virtual Wan Vpn profile parameters Vpn profile generation. */ +@Fluent +public final class VirtualWanVpnProfileParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanVpnProfileParameters.class); + + /* + * VpnServerConfiguration partial resource uri with which VirtualWan is + * associated to. + */ + @JsonProperty(value = "vpnServerConfigurationResourceId") + private String vpnServerConfigurationResourceId; + + /* + * VPN client authentication method. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** + * Get the vpnServerConfigurationResourceId property: VpnServerConfiguration partial resource uri with which + * VirtualWan is associated to. + * + * @return the vpnServerConfigurationResourceId value. + */ + public String vpnServerConfigurationResourceId() { + return this.vpnServerConfigurationResourceId; + } + + /** + * Set the vpnServerConfigurationResourceId property: VpnServerConfiguration partial resource uri with which + * VirtualWan is associated to. + * + * @param vpnServerConfigurationResourceId the vpnServerConfigurationResourceId value to set. + * @return the VirtualWanVpnProfileParameters object itself. + */ + public VirtualWanVpnProfileParameters withVpnServerConfigurationResourceId( + String vpnServerConfigurationResourceId) { + this.vpnServerConfigurationResourceId = vpnServerConfigurationResourceId; + return this; + } + + /** + * Get the authenticationMethod property: VPN client authentication method. + * + * @return the authenticationMethod value. + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: VPN client authentication method. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the VirtualWanVpnProfileParameters object itself. + */ + public VirtualWanVpnProfileParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWans.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWans.java new file mode 100644 index 0000000000000..adfa60a469037 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWans.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VirtualWans. */ +public interface VirtualWans { + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + VirtualWan getByResourceGroup(String resourceGroupName, String virtualWanName); + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualWanName, Context context); + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualWanName); + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtualWanName, Context context); + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + PagedIterable list(); + + /** + * Lists all the VirtualWANs 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 result of the request to list VirtualWANs. + */ + PagedIterable list(Context context); + + /** + * Retrieves the details of a VirtualWAN. + * + * @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 virtualWAN Resource. + */ + VirtualWan getById(String id); + + /** + * Retrieves the details of a VirtualWAN. + * + * @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 virtualWAN Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a VirtualWAN. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a VirtualWAN. + * + * @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 VirtualWan resource. + * + * @param name resource name. + * @return the first stage of the new VirtualWan definition. + */ + VirtualWan.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetRoute.java new file mode 100644 index 0000000000000..86c05e1b9f3a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetRoute.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.network.generated.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; + +/** List of routes that control routing from VirtualHub into a virtual network connection. */ +@Fluent +public final class VnetRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetRoute.class); + + /* + * List of all Static Routes. + */ + @JsonProperty(value = "staticRoutes") + private List staticRoutes; + + /** + * Get the staticRoutes property: List of all Static Routes. + * + * @return the staticRoutes value. + */ + public List staticRoutes() { + return this.staticRoutes; + } + + /** + * Set the staticRoutes property: List of all Static Routes. + * + * @param staticRoutes the staticRoutes value to set. + * @return the VnetRoute object itself. + */ + public VnetRoute withStaticRoutes(List staticRoutes) { + this.staticRoutes = staticRoutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (staticRoutes() != null) { + staticRoutes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnAuthenticationType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnAuthenticationType.java new file mode 100644 index 0000000000000..4ffa173fac827 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnAuthenticationType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnAuthenticationType. */ +public final class VpnAuthenticationType extends ExpandableStringEnum { + /** Static value Certificate for VpnAuthenticationType. */ + public static final VpnAuthenticationType CERTIFICATE = fromString("Certificate"); + + /** Static value Radius for VpnAuthenticationType. */ + public static final VpnAuthenticationType RADIUS = fromString("Radius"); + + /** Static value AAD for VpnAuthenticationType. */ + public static final VpnAuthenticationType AAD = fromString("AAD"); + + /** + * Creates or finds a VpnAuthenticationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnAuthenticationType. + */ + @JsonCreator + public static VpnAuthenticationType fromString(String name) { + return fromString(name, VpnAuthenticationType.class); + } + + /** @return known VpnAuthenticationType values. */ + public static Collection values() { + return values(VpnAuthenticationType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConfiguration.java new file mode 100644 index 0000000000000..80b4bfaee33e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConfiguration.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** VpnClientConfiguration for P2S client. */ +@Fluent +public final class VpnClientConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientConfiguration.class); + + /* + * The reference to the address space resource which represents Address + * space for P2S VpnClient. + */ + @JsonProperty(value = "vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /* + * VpnClientRootCertificate for virtual network gateway. + */ + @JsonProperty(value = "vpnClientRootCertificates") + private List vpnClientRootCertificates; + + /* + * VpnClientRevokedCertificate for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientRevokedCertificates") + private List vpnClientRevokedCertificates; + + /* + * VpnClientProtocols for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientProtocols") + private List vpnClientProtocols; + + /* + * VPN authentication types for the virtual network gateway.. + */ + @JsonProperty(value = "vpnAuthenticationTypes") + private List vpnAuthenticationTypes; + + /* + * VpnClientIpsecPolicies for virtual network gateway P2S client. + */ + @JsonProperty(value = "vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /* + * The radius server address property of the VirtualNetworkGateway resource + * for vpn client connection. + */ + @JsonProperty(value = "radiusServerAddress") + private String radiusServerAddress; + + /* + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /* + * The radiusServers property for multiple radius server configuration. + */ + @JsonProperty(value = "radiusServers") + private List radiusServers; + + /* + * The AADTenant property of the VirtualNetworkGateway resource for vpn + * client connection used for AAD authentication. + */ + @JsonProperty(value = "aadTenant") + private String aadTenant; + + /* + * The AADAudience property of the VirtualNetworkGateway resource for vpn + * client connection used for AAD authentication. + */ + @JsonProperty(value = "aadAudience") + private String aadAudience; + + /* + * The AADIssuer property of the VirtualNetworkGateway resource for vpn + * client connection used for AAD authentication. + */ + @JsonProperty(value = "aadIssuer") + private String aadIssuer; + + /** + * Get the vpnClientAddressPool property: The reference to the address space resource which represents Address space + * for P2S VpnClient. + * + * @return the vpnClientAddressPool value. + */ + public AddressSpace vpnClientAddressPool() { + return this.vpnClientAddressPool; + } + + /** + * Set the vpnClientAddressPool property: The reference to the address space resource which represents Address space + * for P2S VpnClient. + * + * @param vpnClientAddressPool the vpnClientAddressPool value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.vpnClientAddressPool = vpnClientAddressPool; + return this; + } + + /** + * Get the vpnClientRootCertificates property: VpnClientRootCertificate for virtual network gateway. + * + * @return the vpnClientRootCertificates value. + */ + public List vpnClientRootCertificates() { + return this.vpnClientRootCertificates; + } + + /** + * Set the vpnClientRootCertificates property: VpnClientRootCertificate for virtual network gateway. + * + * @param vpnClientRootCertificates the vpnClientRootCertificates value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRootCertificates( + List vpnClientRootCertificates) { + this.vpnClientRootCertificates = vpnClientRootCertificates; + return this; + } + + /** + * Get the vpnClientRevokedCertificates property: VpnClientRevokedCertificate for Virtual network gateway. + * + * @return the vpnClientRevokedCertificates value. + */ + public List vpnClientRevokedCertificates() { + return this.vpnClientRevokedCertificates; + } + + /** + * Set the vpnClientRevokedCertificates property: VpnClientRevokedCertificate for Virtual network gateway. + * + * @param vpnClientRevokedCertificates the vpnClientRevokedCertificates value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRevokedCertificates( + List vpnClientRevokedCertificates) { + this.vpnClientRevokedCertificates = vpnClientRevokedCertificates; + return this; + } + + /** + * Get the vpnClientProtocols property: VpnClientProtocols for Virtual network gateway. + * + * @return the vpnClientProtocols value. + */ + public List vpnClientProtocols() { + return this.vpnClientProtocols; + } + + /** + * Set the vpnClientProtocols property: VpnClientProtocols for Virtual network gateway. + * + * @param vpnClientProtocols the vpnClientProtocols value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientProtocols(List vpnClientProtocols) { + this.vpnClientProtocols = vpnClientProtocols; + return this; + } + + /** + * Get the vpnAuthenticationTypes property: VPN authentication types for the virtual network gateway.. + * + * @return the vpnAuthenticationTypes value. + */ + public List vpnAuthenticationTypes() { + return this.vpnAuthenticationTypes; + } + + /** + * Set the vpnAuthenticationTypes property: VPN authentication types for the virtual network gateway.. + * + * @param vpnAuthenticationTypes the vpnAuthenticationTypes value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnAuthenticationTypes(List vpnAuthenticationTypes) { + this.vpnAuthenticationTypes = vpnAuthenticationTypes; + return this; + } + + /** + * Get the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @return the vpnClientIpsecPolicies value. + */ + public List vpnClientIpsecPolicies() { + return this.vpnClientIpsecPolicies; + } + + /** + * Set the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + return this; + } + + /** + * Get the radiusServerAddress property: The radius server address property of the VirtualNetworkGateway resource + * for vpn client connection. + * + * @return the radiusServerAddress value. + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radiusServerAddress property: The radius server address property of the VirtualNetworkGateway resource + * for vpn client connection. + * + * @param radiusServerAddress the radiusServerAddress value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radiusServerSecret property: The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @return the radiusServerSecret value. + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radiusServerSecret property: The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param radiusServerSecret the radiusServerSecret value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + + /** + * Get the radiusServers property: The radiusServers property for multiple radius server configuration. + * + * @return the radiusServers value. + */ + public List radiusServers() { + return this.radiusServers; + } + + /** + * Set the radiusServers property: The radiusServers property for multiple radius server configuration. + * + * @param radiusServers the radiusServers value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServers(List radiusServers) { + this.radiusServers = radiusServers; + return this; + } + + /** + * Get the aadTenant property: The AADTenant property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @return the aadTenant value. + */ + public String aadTenant() { + return this.aadTenant; + } + + /** + * Set the aadTenant property: The AADTenant property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @param aadTenant the aadTenant value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withAadTenant(String aadTenant) { + this.aadTenant = aadTenant; + return this; + } + + /** + * Get the aadAudience property: The AADAudience property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @return the aadAudience value. + */ + public String aadAudience() { + return this.aadAudience; + } + + /** + * Set the aadAudience property: The AADAudience property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @param aadAudience the aadAudience value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withAadAudience(String aadAudience) { + this.aadAudience = aadAudience; + return this; + } + + /** + * Get the aadIssuer property: The AADIssuer property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @return the aadIssuer value. + */ + public String aadIssuer() { + return this.aadIssuer; + } + + /** + * Set the aadIssuer property: The AADIssuer property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @param aadIssuer the aadIssuer value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withAadIssuer(String aadIssuer) { + this.aadIssuer = aadIssuer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vpnClientAddressPool() != null) { + vpnClientAddressPool().validate(); + } + if (vpnClientRootCertificates() != null) { + vpnClientRootCertificates().forEach(e -> e.validate()); + } + if (vpnClientRevokedCertificates() != null) { + vpnClientRevokedCertificates().forEach(e -> e.validate()); + } + if (vpnClientIpsecPolicies() != null) { + vpnClientIpsecPolicies().forEach(e -> e.validate()); + } + if (radiusServers() != null) { + radiusServers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealth.java new file mode 100644 index 0000000000000..6b30226baa4b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealth.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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; + +/** VpnClientConnectionHealth properties. */ +@Fluent +public final class VpnClientConnectionHealth { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientConnectionHealth.class); + + /* + * Total of the Ingress Bytes Transferred in this P2S Vpn connection. + */ + @JsonProperty(value = "totalIngressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalIngressBytesTransferred; + + /* + * Total of the Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "totalEgressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalEgressBytesTransferred; + + /* + * The total of p2s vpn clients connected at this time to this + * P2SVpnGateway. + */ + @JsonProperty(value = "vpnClientConnectionsCount") + private Integer vpnClientConnectionsCount; + + /* + * List of allocated ip addresses to the connected p2s vpn clients. + */ + @JsonProperty(value = "allocatedIpAddresses") + private List allocatedIpAddresses; + + /** + * Get the totalIngressBytesTransferred property: Total of the Ingress Bytes Transferred in this P2S Vpn connection. + * + * @return the totalIngressBytesTransferred value. + */ + public Long totalIngressBytesTransferred() { + return this.totalIngressBytesTransferred; + } + + /** + * Get the totalEgressBytesTransferred property: Total of the Egress Bytes Transferred in this connection. + * + * @return the totalEgressBytesTransferred value. + */ + public Long totalEgressBytesTransferred() { + return this.totalEgressBytesTransferred; + } + + /** + * Get the vpnClientConnectionsCount property: The total of p2s vpn clients connected at this time to this + * P2SVpnGateway. + * + * @return the vpnClientConnectionsCount value. + */ + public Integer vpnClientConnectionsCount() { + return this.vpnClientConnectionsCount; + } + + /** + * Set the vpnClientConnectionsCount property: The total of p2s vpn clients connected at this time to this + * P2SVpnGateway. + * + * @param vpnClientConnectionsCount the vpnClientConnectionsCount value to set. + * @return the VpnClientConnectionHealth object itself. + */ + public VpnClientConnectionHealth withVpnClientConnectionsCount(Integer vpnClientConnectionsCount) { + this.vpnClientConnectionsCount = vpnClientConnectionsCount; + return this; + } + + /** + * Get the allocatedIpAddresses property: List of allocated ip addresses to the connected p2s vpn clients. + * + * @return the allocatedIpAddresses value. + */ + public List allocatedIpAddresses() { + return this.allocatedIpAddresses; + } + + /** + * Set the allocatedIpAddresses property: List of allocated ip addresses to the connected p2s vpn clients. + * + * @param allocatedIpAddresses the allocatedIpAddresses value to set. + * @return the VpnClientConnectionHealth object itself. + */ + public VpnClientConnectionHealth withAllocatedIpAddresses(List allocatedIpAddresses) { + this.allocatedIpAddresses = allocatedIpAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetail.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetail.java new file mode 100644 index 0000000000000..2c488b3542183 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetail.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.network.generated.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; + +/** VPN client connection health detail. */ +@Immutable +public final class VpnClientConnectionHealthDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientConnectionHealthDetail.class); + + /* + * The vpn client Id. + */ + @JsonProperty(value = "vpnConnectionId", access = JsonProperty.Access.WRITE_ONLY) + private String vpnConnectionId; + + /* + * The duration time of a connected vpn client. + */ + @JsonProperty(value = "vpnConnectionDuration", access = JsonProperty.Access.WRITE_ONLY) + private Long vpnConnectionDuration; + + /* + * The start time of a connected vpn client. + */ + @JsonProperty(value = "vpnConnectionTime", access = JsonProperty.Access.WRITE_ONLY) + private String vpnConnectionTime; + + /* + * The public Ip of a connected vpn client. + */ + @JsonProperty(value = "publicIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String publicIpAddress; + + /* + * The assigned private Ip of a connected vpn client. + */ + @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /* + * The user name of a connected vpn client. + */ + @JsonProperty(value = "vpnUserName", access = JsonProperty.Access.WRITE_ONLY) + private String vpnUsername; + + /* + * The max band width. + */ + @JsonProperty(value = "maxBandwidth", access = JsonProperty.Access.WRITE_ONLY) + private Long maxBandwidth; + + /* + * The egress packets per second. + */ + @JsonProperty(value = "egressPacketsTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressPacketsTransferred; + + /* + * The egress bytes per second. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The ingress packets per second. + */ + @JsonProperty(value = "ingressPacketsTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressPacketsTransferred; + + /* + * The ingress bytes per second. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The max packets transferred per second. + */ + @JsonProperty(value = "maxPacketsPerSecond", access = JsonProperty.Access.WRITE_ONLY) + private Long maxPacketsPerSecond; + + /** + * Get the vpnConnectionId property: The vpn client Id. + * + * @return the vpnConnectionId value. + */ + public String vpnConnectionId() { + return this.vpnConnectionId; + } + + /** + * Get the vpnConnectionDuration property: The duration time of a connected vpn client. + * + * @return the vpnConnectionDuration value. + */ + public Long vpnConnectionDuration() { + return this.vpnConnectionDuration; + } + + /** + * Get the vpnConnectionTime property: The start time of a connected vpn client. + * + * @return the vpnConnectionTime value. + */ + public String vpnConnectionTime() { + return this.vpnConnectionTime; + } + + /** + * Get the publicIpAddress property: The public Ip of a connected vpn client. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Get the privateIpAddress property: The assigned private Ip of a connected vpn client. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Get the vpnUsername property: The user name of a connected vpn client. + * + * @return the vpnUsername value. + */ + public String vpnUsername() { + return this.vpnUsername; + } + + /** + * Get the maxBandwidth property: The max band width. + * + * @return the maxBandwidth value. + */ + public Long maxBandwidth() { + return this.maxBandwidth; + } + + /** + * Get the egressPacketsTransferred property: The egress packets per second. + * + * @return the egressPacketsTransferred value. + */ + public Long egressPacketsTransferred() { + return this.egressPacketsTransferred; + } + + /** + * Get the egressBytesTransferred property: The egress bytes per second. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingressPacketsTransferred property: The ingress packets per second. + * + * @return the ingressPacketsTransferred value. + */ + public Long ingressPacketsTransferred() { + return this.ingressPacketsTransferred; + } + + /** + * Get the ingressBytesTransferred property: The ingress bytes per second. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the maxPacketsPerSecond property: The max packets transferred per second. + * + * @return the maxPacketsPerSecond value. + */ + public Long maxPacketsPerSecond() { + return this.maxPacketsPerSecond; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java new file mode 100644 index 0000000000000..b22ace51ba6d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import java.util.List; + +/** An immutable client-side representation of VpnClientConnectionHealthDetailListResult. */ +public interface VpnClientConnectionHealthDetailListResult { + /** + * Gets the value property: List of vpn client connection health. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner object. + * + * @return the inner object. + */ + VpnClientConnectionHealthDetailListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java new file mode 100644 index 0000000000000..10b45b05cac88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; + +/** An immutable client-side representation of VpnClientIPsecParameters. */ +public interface VpnClientIPsecParameters { + /** + * Gets the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + * + * @return the saLifeTimeSeconds value. + */ + int saLifeTimeSeconds(); + + /** + * Gets the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + * + * @return the saDataSizeKilobytes value. + */ + int saDataSizeKilobytes(); + + /** + * Gets the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @return the ipsecEncryption value. + */ + IpsecEncryption ipsecEncryption(); + + /** + * Gets the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @return the ipsecIntegrity value. + */ + IpsecIntegrity ipsecIntegrity(); + + /** + * Gets the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @return the ikeEncryption value. + */ + IkeEncryption ikeEncryption(); + + /** + * Gets the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @return the ikeIntegrity value. + */ + IkeIntegrity ikeIntegrity(); + + /** + * Gets the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @return the dhGroup value. + */ + DhGroup dhGroup(); + + /** + * Gets the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @return the pfsGroup value. + */ + PfsGroup pfsGroup(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner object. + * + * @return the inner object. + */ + VpnClientIPsecParametersInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.java new file mode 100644 index 0000000000000..78c6c9a22e259 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.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.network.generated.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; + +/** Vpn Client Parameters for package generation. */ +@Fluent +public final class VpnClientParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientParameters.class); + + /* + * VPN client Processor Architecture. + */ + @JsonProperty(value = "processorArchitecture") + private ProcessorArchitecture processorArchitecture; + + /* + * VPN client authentication method. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /* + * The public certificate data for the radius server authentication + * certificate as a Base-64 encoded string. Required only if external + * radius authentication has been configured with EAPTLS authentication. + */ + @JsonProperty(value = "radiusServerAuthCertificate") + private String radiusServerAuthCertificate; + + /* + * A list of client root certificates public certificate data encoded as + * Base-64 strings. Optional parameter for external radius based + * authentication with EAPTLS. + */ + @JsonProperty(value = "clientRootCertificates") + private List clientRootCertificates; + + /** + * Get the processorArchitecture property: VPN client Processor Architecture. + * + * @return the processorArchitecture value. + */ + public ProcessorArchitecture processorArchitecture() { + return this.processorArchitecture; + } + + /** + * Set the processorArchitecture property: VPN client Processor Architecture. + * + * @param processorArchitecture the processorArchitecture value to set. + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withProcessorArchitecture(ProcessorArchitecture processorArchitecture) { + this.processorArchitecture = processorArchitecture; + return this; + } + + /** + * Get the authenticationMethod property: VPN client authentication method. + * + * @return the authenticationMethod value. + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: VPN client authentication method. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the radiusServerAuthCertificate property: The public certificate data for the radius server authentication + * certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with + * EAPTLS authentication. + * + * @return the radiusServerAuthCertificate value. + */ + public String radiusServerAuthCertificate() { + return this.radiusServerAuthCertificate; + } + + /** + * Set the radiusServerAuthCertificate property: The public certificate data for the radius server authentication + * certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with + * EAPTLS authentication. + * + * @param radiusServerAuthCertificate the radiusServerAuthCertificate value to set. + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withRadiusServerAuthCertificate(String radiusServerAuthCertificate) { + this.radiusServerAuthCertificate = radiusServerAuthCertificate; + return this; + } + + /** + * Get the clientRootCertificates property: A list of client root certificates public certificate data encoded as + * Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @return the clientRootCertificates value. + */ + public List clientRootCertificates() { + return this.clientRootCertificates; + } + + /** + * Set the clientRootCertificates property: A list of client root certificates public certificate data encoded as + * Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @param clientRootCertificates the clientRootCertificates value to set. + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withClientRootCertificates(List clientRootCertificates) { + this.clientRootCertificates = clientRootCertificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientProtocol.java new file mode 100644 index 0000000000000..3edf071da7366 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnClientProtocol. */ +public final class VpnClientProtocol extends ExpandableStringEnum { + /** Static value IkeV2 for VpnClientProtocol. */ + public static final VpnClientProtocol IKE_V2 = fromString("IkeV2"); + + /** Static value SSTP for VpnClientProtocol. */ + public static final VpnClientProtocol SSTP = fromString("SSTP"); + + /** Static value OpenVPN for VpnClientProtocol. */ + public static final VpnClientProtocol OPEN_VPN = fromString("OpenVPN"); + + /** + * Creates or finds a VpnClientProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnClientProtocol. + */ + @JsonCreator + public static VpnClientProtocol fromString(String name) { + return fromString(name, VpnClientProtocol.class); + } + + /** @return known VpnClientProtocol values. */ + public static Collection values() { + return values(VpnClientProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRevokedCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRevokedCertificate.java new file mode 100644 index 0000000000000..583b36370feb5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRevokedCertificate.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VPN client revoked certificate of virtual network gateway. */ +@JsonFlatten +@Fluent +public class VpnClientRevokedCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRevokedCertificate.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /* + * The provisioning state of the VPN client revoked certificate resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the thumbprint property: The revoked VPN client certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The revoked VPN client certificate thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN client revoked certificate resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public VpnClientRevokedCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRootCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRootCertificate.java new file mode 100644 index 0000000000000..bbbd7777792e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRootCertificate.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.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VPN client root certificate of virtual network gateway. */ +@JsonFlatten +@Fluent +public class VpnClientRootCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRootCertificate.class); + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The certificate public data. + */ + @JsonProperty(value = "properties.publicCertData", required = true) + private String publicCertData; + + /* + * The provisioning state of the VPN client root certificate resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @param name the name value to set. + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the publicCertData property: The certificate public data. + * + * @return the publicCertData value. + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the publicCertData property: The certificate public data. + * + * @param publicCertData the publicCertData value to set. + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN client root certificate resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public VpnClientRootCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicCertData() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicCertData in model VpnClientRootCertificate")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java new file mode 100644 index 0000000000000..111739abeb6f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import java.util.List; + +/** An immutable client-side representation of VpnConnection. */ +public interface VpnConnection { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the remoteVpnSite property: Id of the connected vpn site. + * + * @return the remoteVpnSite value. + */ + SubResource remoteVpnSite(); + + /** + * Gets the routingWeight property: Routing weight for vpn connection. + * + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * Gets the dpdTimeoutSeconds property: DPD timeout in seconds for vpn connection. + * + * @return the dpdTimeoutSeconds value. + */ + Integer dpdTimeoutSeconds(); + + /** + * Gets the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + VpnConnectionStatus connectionStatus(); + + /** + * Gets the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @return the vpnConnectionProtocolType value. + */ + VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType(); + + /** + * Gets the ingressBytesTransferred property: Ingress bytes transferred. + * + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * Gets the egressBytesTransferred property: Egress bytes transferred. + * + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * Gets the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @return the connectionBandwidth value. + */ + Integer connectionBandwidth(); + + /** + * Gets the sharedKey property: SharedKey for the vpn connection. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * Gets the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * Gets the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * Gets the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @return the trafficSelectorPolicies value. + */ + List trafficSelectorPolicies(); + + /** + * Gets the enableRateLimiting property: EnableBgp flag. + * + * @return the enableRateLimiting value. + */ + Boolean enableRateLimiting(); + + /** + * Gets the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * Gets the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value. + */ + Boolean useLocalAzureIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the vpnLinkConnections property: List of all vpn site link connections to the gateway. + * + * @return the vpnLinkConnections value. + */ + List vpnLinkConnections(); + + /** + * Gets the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + RoutingConfiguration routingConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner object. + * + * @return the inner object. + */ + VpnConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.java new file mode 100644 index 0000000000000..e80a4c24794c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.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.network.generated.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; + +/** Vpn Connection packet capture parameters supplied to start packet capture on gateway connection. */ +@Fluent +public final class VpnConnectionPacketCaptureStartParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionPacketCaptureStartParameters.class); + + /* + * Start Packet capture parameters on vpn connection. + */ + @JsonProperty(value = "filterData") + private String filterData; + + /* + * List of site link connection names. + */ + @JsonProperty(value = "linkConnectionNames") + private List linkConnectionNames; + + /** + * Get the filterData property: Start Packet capture parameters on vpn connection. + * + * @return the filterData value. + */ + public String filterData() { + return this.filterData; + } + + /** + * Set the filterData property: Start Packet capture parameters on vpn connection. + * + * @param filterData the filterData value to set. + * @return the VpnConnectionPacketCaptureStartParameters object itself. + */ + public VpnConnectionPacketCaptureStartParameters withFilterData(String filterData) { + this.filterData = filterData; + return this; + } + + /** + * Get the linkConnectionNames property: List of site link connection names. + * + * @return the linkConnectionNames value. + */ + public List linkConnectionNames() { + return this.linkConnectionNames; + } + + /** + * Set the linkConnectionNames property: List of site link connection names. + * + * @param linkConnectionNames the linkConnectionNames value to set. + * @return the VpnConnectionPacketCaptureStartParameters object itself. + */ + public VpnConnectionPacketCaptureStartParameters withLinkConnectionNames(List linkConnectionNames) { + this.linkConnectionNames = linkConnectionNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStopParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStopParameters.java new file mode 100644 index 0000000000000..f4ada8509172c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStopParameters.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.network.generated.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; + +/** Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. */ +@Fluent +public final class VpnConnectionPacketCaptureStopParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionPacketCaptureStopParameters.class); + + /* + * SAS url for packet capture on vpn connection. + */ + @JsonProperty(value = "sasUrl") + private String sasUrl; + + /* + * List of site link connection names. + */ + @JsonProperty(value = "linkConnectionNames") + private List linkConnectionNames; + + /** + * Get the sasUrl property: SAS url for packet capture on vpn connection. + * + * @return the sasUrl value. + */ + public String sasUrl() { + return this.sasUrl; + } + + /** + * Set the sasUrl property: SAS url for packet capture on vpn connection. + * + * @param sasUrl the sasUrl value to set. + * @return the VpnConnectionPacketCaptureStopParameters object itself. + */ + public VpnConnectionPacketCaptureStopParameters withSasUrl(String sasUrl) { + this.sasUrl = sasUrl; + return this; + } + + /** + * Get the linkConnectionNames property: List of site link connection names. + * + * @return the linkConnectionNames value. + */ + public List linkConnectionNames() { + return this.linkConnectionNames; + } + + /** + * Set the linkConnectionNames property: List of site link connection names. + * + * @param linkConnectionNames the linkConnectionNames value to set. + * @return the VpnConnectionPacketCaptureStopParameters object itself. + */ + public VpnConnectionPacketCaptureStopParameters withLinkConnectionNames(List linkConnectionNames) { + this.linkConnectionNames = linkConnectionNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionStatus.java new file mode 100644 index 0000000000000..d72369441b558 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionStatus.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnConnectionStatus. */ +public final class VpnConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for VpnConnectionStatus. */ + public static final VpnConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VpnConnectionStatus. */ + public static final VpnConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VpnConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnConnectionStatus. + */ + @JsonCreator + public static VpnConnectionStatus fromString(String name) { + return fromString(name, VpnConnectionStatus.class); + } + + /** @return known VpnConnectionStatus values. */ + public static Collection values() { + return values(VpnConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnections.java new file mode 100644 index 0000000000000..5018bd9be3261 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnections.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; + +/** Resource collection API of VpnConnections. */ +public interface VpnConnections { + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + VpnConnection get(String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + Response getWithResponse( + String resourceGroupName, String gatewayName, String connectionName, Context context); + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + VpnConnection createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters); + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + VpnConnection createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, String connectionName); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, String connectionName, Context context); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String startPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String stopPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnDeviceScriptParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnDeviceScriptParameters.java new file mode 100644 index 0000000000000..d4170abded814 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnDeviceScriptParameters.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.network.generated.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; + +/** Vpn device configuration script generation parameters. */ +@Fluent +public final class VpnDeviceScriptParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnDeviceScriptParameters.class); + + /* + * The vendor for the vpn device. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /* + * The device family for the vpn device. + */ + @JsonProperty(value = "deviceFamily") + private String deviceFamily; + + /* + * The firmware version for the vpn device. + */ + @JsonProperty(value = "firmwareVersion") + private String firmwareVersion; + + /** + * Get the vendor property: The vendor for the vpn device. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Set the vendor property: The vendor for the vpn device. + * + * @param vendor the vendor value to set. + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withVendor(String vendor) { + this.vendor = vendor; + return this; + } + + /** + * Get the deviceFamily property: The device family for the vpn device. + * + * @return the deviceFamily value. + */ + public String deviceFamily() { + return this.deviceFamily; + } + + /** + * Set the deviceFamily property: The device family for the vpn device. + * + * @param deviceFamily the deviceFamily value to set. + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withDeviceFamily(String deviceFamily) { + this.deviceFamily = deviceFamily; + return this; + } + + /** + * Get the firmwareVersion property: The firmware version for the vpn device. + * + * @return the firmwareVersion value. + */ + public String firmwareVersion() { + return this.firmwareVersion; + } + + /** + * Set the firmwareVersion property: The firmware version for the vpn device. + * + * @param firmwareVersion the firmwareVersion value to set. + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withFirmwareVersion(String firmwareVersion) { + this.firmwareVersion = firmwareVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateway.java new file mode 100644 index 0000000000000..267c29515fa19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateway.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VpnGateway. */ +public interface VpnGateway { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the virtualHub property: The VirtualHub to which the gateway belongs. + * + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * Gets the connections property: List of all vpn connections to the gateway. + * + * @return the connections value. + */ + List connections(); + + /** + * Gets the bgpSettings property: Local network gateway's BGP speaker settings. + * + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN gateway resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the vpnGatewayScaleUnit property: The scale unit for this vpn gateway. + * + * @return the vpnGatewayScaleUnit value. + */ + Integer vpnGatewayScaleUnit(); + + /** + * Gets the ipConfigurations property: List of all IPs configured on the gateway. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP Interface of + * the VpnGateway. + * + * @return the isRoutingPreferenceInternet value. + */ + Boolean isRoutingPreferenceInternet(); + + /** + * Gets the natRules property: List of all the nat Rules associated with the gateway. + * + * @return the natRules value. + */ + List natRules(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VpnGatewayInner object. + * + * @return the inner object. + */ + VpnGatewayInner innerModel(); + + /** The entirety of the VpnGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VpnGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the VpnGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VpnGateway 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 VpnGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VpnGateway 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.WithVirtualHub, + DefinitionStages.WithConnections, + DefinitionStages.WithBgpSettings, + DefinitionStages.WithVpnGatewayScaleUnit, + DefinitionStages.WithIsRoutingPreferenceInternet, + DefinitionStages.WithNatRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + VpnGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VpnGateway create(Context context); + } + /** The stage of the VpnGateway 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 VpnGateway definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The VirtualHub to which the gateway belongs.. + * + * @param virtualHub The VirtualHub to which the gateway belongs. + * @return the next definition stage. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + /** The stage of the VpnGateway definition allowing to specify connections. */ + interface WithConnections { + /** + * Specifies the connections property: List of all vpn connections to the gateway.. + * + * @param connections List of all vpn connections to the gateway. + * @return the next definition stage. + */ + WithCreate withConnections(List connections); + } + /** The stage of the VpnGateway definition allowing to specify bgpSettings. */ + interface WithBgpSettings { + /** + * Specifies the bgpSettings property: Local network gateway's BGP speaker settings.. + * + * @param bgpSettings Local network gateway's BGP speaker settings. + * @return the next definition stage. + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + /** The stage of the VpnGateway definition allowing to specify vpnGatewayScaleUnit. */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies the vpnGatewayScaleUnit property: The scale unit for this vpn gateway.. + * + * @param vpnGatewayScaleUnit The scale unit for this vpn gateway. + * @return the next definition stage. + */ + WithCreate withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + /** The stage of the VpnGateway definition allowing to specify isRoutingPreferenceInternet. */ + interface WithIsRoutingPreferenceInternet { + /** + * Specifies the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP + * Interface of the VpnGateway.. + * + * @param isRoutingPreferenceInternet Enable Routing Preference property for the Public IP Interface of the + * VpnGateway. + * @return the next definition stage. + */ + WithCreate withIsRoutingPreferenceInternet(Boolean isRoutingPreferenceInternet); + } + /** The stage of the VpnGateway definition allowing to specify natRules. */ + interface WithNatRules { + /** + * Specifies the natRules property: List of all the nat Rules associated with the gateway.. + * + * @param natRules List of all the nat Rules associated with the gateway. + * @return the next definition stage. + */ + WithCreate withNatRules(List natRules); + } + } + /** + * Begins update for the VpnGateway resource. + * + * @return the stage of resource update. + */ + VpnGateway.Update update(); + + /** The template for VpnGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VpnGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VpnGateway apply(Context context); + } + /** The VpnGateway update stages. */ + interface UpdateStages { + /** The stage of the VpnGateway 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VpnGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VpnGateway refresh(Context context); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + VpnGateway reset(); + + /** + * Resets the primary of the vpn gateway in the specified resource 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 vpnGateway Resource. + */ + VpnGateway reset(Context context); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String startPacketCapture(VpnGatewayPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String startPacketCapture(); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String startPacketCapture(VpnGatewayPacketCaptureStartParameters parameters, Context context); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String stopPacketCapture(VpnGatewayPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String stopPacketCapture(); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String stopPacketCapture(VpnGatewayPacketCaptureStopParameters parameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayGeneration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayGeneration.java new file mode 100644 index 0000000000000..3f074ff75b67e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayGeneration.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnGatewayGeneration. */ +public final class VpnGatewayGeneration extends ExpandableStringEnum { + /** Static value None for VpnGatewayGeneration. */ + public static final VpnGatewayGeneration NONE = fromString("None"); + + /** Static value Generation1 for VpnGatewayGeneration. */ + public static final VpnGatewayGeneration GENERATION1 = fromString("Generation1"); + + /** Static value Generation2 for VpnGatewayGeneration. */ + public static final VpnGatewayGeneration GENERATION2 = fromString("Generation2"); + + /** + * Creates or finds a VpnGatewayGeneration from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnGatewayGeneration. + */ + @JsonCreator + public static VpnGatewayGeneration fromString(String name) { + return fromString(name, VpnGatewayGeneration.class); + } + + /** @return known VpnGatewayGeneration values. */ + public static Collection values() { + return values(VpnGatewayGeneration.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayIpConfiguration.java new file mode 100644 index 0000000000000..291a851e00357 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayIpConfiguration.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.network.generated.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; + +/** IP Configuration of a VPN Gateway Resource. */ +@Fluent +public final class VpnGatewayIpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayIpConfiguration.class); + + /* + * The identifier of the IP configuration for a VPN Gateway. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The public IP address of this IP configuration. + */ + @JsonProperty(value = "publicIpAddress") + private String publicIpAddress; + + /* + * The private IP address of this IP configuration. + */ + @JsonProperty(value = "privateIpAddress") + private String privateIpAddress; + + /** + * Get the id property: The identifier of the IP configuration for a VPN Gateway. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The identifier of the IP configuration for a VPN Gateway. + * + * @param id the id value to set. + * @return the VpnGatewayIpConfiguration object itself. + */ + public VpnGatewayIpConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the publicIpAddress property: The public IP address of this IP configuration. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: The public IP address of this IP configuration. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the VpnGatewayIpConfiguration object itself. + */ + public VpnGatewayIpConfiguration withPublicIpAddress(String publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the privateIpAddress property: The private IP address of this IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The private IP address of this IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the VpnGatewayIpConfiguration object itself. + */ + public VpnGatewayIpConfiguration withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayNatRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayNatRule.java new file mode 100644 index 0000000000000..afb9d798918b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayNatRule.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.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import java.util.List; + +/** An immutable client-side representation of VpnGatewayNatRule. */ +public interface VpnGatewayNatRule { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the typePropertiesType property: The type of NAT rule for VPN NAT. + * + * @return the typePropertiesType value. + */ + VpnNatRuleType typePropertiesType(); + + /** + * Gets the mode property: The Source NAT direction of a VPN NAT. + * + * @return the mode value. + */ + VpnNatRuleMode mode(); + + /** + * Gets the internalMappings property: The private IP address internal mapping for NAT. + * + * @return the internalMappings value. + */ + List internalMappings(); + + /** + * Gets the externalMappings property: The private IP address external mapping for NAT. + * + * @return the externalMappings value. + */ + List externalMappings(); + + /** + * Gets the ipConfigurationId property: The IP Configuration ID this NAT rule applies to. + * + * @return the ipConfigurationId value. + */ + String ipConfigurationId(); + + /** + * Gets the egressVpnSiteLinkConnections property: List of egress VpnSiteLinkConnections. + * + * @return the egressVpnSiteLinkConnections value. + */ + List egressVpnSiteLinkConnections(); + + /** + * Gets the ingressVpnSiteLinkConnections property: List of ingress VpnSiteLinkConnections. + * + * @return the ingressVpnSiteLinkConnections value. + */ + List ingressVpnSiteLinkConnections(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner object. + * + * @return the inner object. + */ + VpnGatewayNatRuleInner innerModel(); + + /** The entirety of the VpnGatewayNatRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VpnGatewayNatRule definition stages. */ + interface DefinitionStages { + /** The first stage of the VpnGatewayNatRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VpnGatewayNatRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, gatewayName. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @return the next definition stage. + */ + WithCreate withExistingVpnGateway(String resourceGroupName, String gatewayName); + } + /** + * The stage of the VpnGatewayNatRule 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.WithName, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithMode, + DefinitionStages.WithInternalMappings, + DefinitionStages.WithExternalMappings, + DefinitionStages.WithIpConfigurationId { + /** + * Executes the create request. + * + * @return the created resource. + */ + VpnGatewayNatRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VpnGatewayNatRule create(Context context); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of NAT rule for VPN NAT.. + * + * @param typePropertiesType The type of NAT rule for VPN NAT. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(VpnNatRuleType typePropertiesType); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The Source NAT direction of a VPN NAT.. + * + * @param mode The Source NAT direction of a VPN NAT. + * @return the next definition stage. + */ + WithCreate withMode(VpnNatRuleMode mode); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify internalMappings. */ + interface WithInternalMappings { + /** + * Specifies the internalMappings property: The private IP address internal mapping for NAT.. + * + * @param internalMappings The private IP address internal mapping for NAT. + * @return the next definition stage. + */ + WithCreate withInternalMappings(List internalMappings); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify externalMappings. */ + interface WithExternalMappings { + /** + * Specifies the externalMappings property: The private IP address external mapping for NAT.. + * + * @param externalMappings The private IP address external mapping for NAT. + * @return the next definition stage. + */ + WithCreate withExternalMappings(List externalMappings); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify ipConfigurationId. */ + interface WithIpConfigurationId { + /** + * Specifies the ipConfigurationId property: The IP Configuration ID this NAT rule applies to.. + * + * @param ipConfigurationId The IP Configuration ID this NAT rule applies to. + * @return the next definition stage. + */ + WithCreate withIpConfigurationId(String ipConfigurationId); + } + } + /** + * Begins update for the VpnGatewayNatRule resource. + * + * @return the stage of resource update. + */ + VpnGatewayNatRule.Update update(); + + /** The template for VpnGatewayNatRule update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithTypePropertiesType, + UpdateStages.WithMode, + UpdateStages.WithInternalMappings, + UpdateStages.WithExternalMappings, + UpdateStages.WithIpConfigurationId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VpnGatewayNatRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VpnGatewayNatRule apply(Context context); + } + /** The VpnGatewayNatRule update stages. */ + interface UpdateStages { + /** The stage of the VpnGatewayNatRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VpnGatewayNatRule update allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of NAT rule for VPN NAT.. + * + * @param typePropertiesType The type of NAT rule for VPN NAT. + * @return the next definition stage. + */ + Update withTypePropertiesType(VpnNatRuleType typePropertiesType); + } + /** The stage of the VpnGatewayNatRule update allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The Source NAT direction of a VPN NAT.. + * + * @param mode The Source NAT direction of a VPN NAT. + * @return the next definition stage. + */ + Update withMode(VpnNatRuleMode mode); + } + /** The stage of the VpnGatewayNatRule update allowing to specify internalMappings. */ + interface WithInternalMappings { + /** + * Specifies the internalMappings property: The private IP address internal mapping for NAT.. + * + * @param internalMappings The private IP address internal mapping for NAT. + * @return the next definition stage. + */ + Update withInternalMappings(List internalMappings); + } + /** The stage of the VpnGatewayNatRule update allowing to specify externalMappings. */ + interface WithExternalMappings { + /** + * Specifies the externalMappings property: The private IP address external mapping for NAT.. + * + * @param externalMappings The private IP address external mapping for NAT. + * @return the next definition stage. + */ + Update withExternalMappings(List externalMappings); + } + /** The stage of the VpnGatewayNatRule update allowing to specify ipConfigurationId. */ + interface WithIpConfigurationId { + /** + * Specifies the ipConfigurationId property: The IP Configuration ID this NAT rule applies to.. + * + * @param ipConfigurationId The IP Configuration ID this NAT rule applies to. + * @return the next definition stage. + */ + Update withIpConfigurationId(String ipConfigurationId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VpnGatewayNatRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VpnGatewayNatRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStartParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStartParameters.java new file mode 100644 index 0000000000000..754f038858553 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStartParameters.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.network.generated.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; + +/** Start packet capture parameters. */ +@Fluent +public final class VpnGatewayPacketCaptureStartParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayPacketCaptureStartParameters.class); + + /* + * Start Packet capture parameters on vpn gateway. + */ + @JsonProperty(value = "filterData") + private String filterData; + + /** + * Get the filterData property: Start Packet capture parameters on vpn gateway. + * + * @return the filterData value. + */ + public String filterData() { + return this.filterData; + } + + /** + * Set the filterData property: Start Packet capture parameters on vpn gateway. + * + * @param filterData the filterData value to set. + * @return the VpnGatewayPacketCaptureStartParameters object itself. + */ + public VpnGatewayPacketCaptureStartParameters withFilterData(String filterData) { + this.filterData = filterData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStopParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStopParameters.java new file mode 100644 index 0000000000000..af5caf08b15af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStopParameters.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.network.generated.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; + +/** Stop packet capture parameters. */ +@Fluent +public final class VpnGatewayPacketCaptureStopParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayPacketCaptureStopParameters.class); + + /* + * SAS url for packet capture on vpn gateway. + */ + @JsonProperty(value = "sasUrl") + private String sasUrl; + + /** + * Get the sasUrl property: SAS url for packet capture on vpn gateway. + * + * @return the sasUrl value. + */ + public String sasUrl() { + return this.sasUrl; + } + + /** + * Set the sasUrl property: SAS url for packet capture on vpn gateway. + * + * @param sasUrl the sasUrl value to set. + * @return the VpnGatewayPacketCaptureStopParameters object itself. + */ + public VpnGatewayPacketCaptureStopParameters withSasUrl(String sasUrl) { + this.sasUrl = sasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayTunnelingProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayTunnelingProtocol.java new file mode 100644 index 0000000000000..1020d101dbf27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayTunnelingProtocol.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnGatewayTunnelingProtocol. */ +public final class VpnGatewayTunnelingProtocol extends ExpandableStringEnum { + /** Static value IkeV2 for VpnGatewayTunnelingProtocol. */ + public static final VpnGatewayTunnelingProtocol IKE_V2 = fromString("IkeV2"); + + /** Static value OpenVPN for VpnGatewayTunnelingProtocol. */ + public static final VpnGatewayTunnelingProtocol OPEN_VPN = fromString("OpenVPN"); + + /** + * Creates or finds a VpnGatewayTunnelingProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnGatewayTunnelingProtocol. + */ + @JsonCreator + public static VpnGatewayTunnelingProtocol fromString(String name) { + return fromString(name, VpnGatewayTunnelingProtocol.class); + } + + /** @return known VpnGatewayTunnelingProtocol values. */ + public static Collection values() { + return values(VpnGatewayTunnelingProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateways.java new file mode 100644 index 0000000000000..440713204b236 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateways.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VpnGateways. */ +public interface VpnGateways { + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + VpnGateway getByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String gatewayName, Context context); + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName); + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 gatewayName, Context context); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + VpnGateway reset(String resourceGroupName, String gatewayName); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + VpnGateway reset(String resourceGroupName, String gatewayName, Context context); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String startPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String startPacketCapture(String resourceGroupName, String gatewayName); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String startPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String stopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String stopPacketCapture(String resourceGroupName, String gatewayName); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context); + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + PagedIterable list(); + + /** + * Lists all the VpnGateways 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 result of the request to list VpnGateways. + */ + PagedIterable list(Context context); + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @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 vpnGateway Resource. + */ + VpnGateway getById(String id); + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @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 vpnGateway Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a virtual wan vpn gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a virtual wan vpn gateway. + * + * @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 VpnGateway resource. + * + * @param name resource name. + * @return the first stage of the new VpnGateway definition. + */ + VpnGateway.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkBgpSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkBgpSettings.java new file mode 100644 index 0000000000000..a97f2f923108c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkBgpSettings.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.network.generated.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; + +/** BGP settings details for a link. */ +@Fluent +public final class VpnLinkBgpSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnLinkBgpSettings.class); + + /* + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /* + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /** + * Get the asn property: The BGP speaker's ASN. + * + * @return the asn value. + */ + public Long asn() { + return this.asn; + } + + /** + * Set the asn property: The BGP speaker's ASN. + * + * @param asn the asn value to set. + * @return the VpnLinkBgpSettings object itself. + */ + public VpnLinkBgpSettings withAsn(Long asn) { + this.asn = asn; + return this; + } + + /** + * Get the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. + * + * @return the bgpPeeringAddress value. + */ + public String bgpPeeringAddress() { + return this.bgpPeeringAddress; + } + + /** + * Set the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. + * + * @param bgpPeeringAddress the bgpPeeringAddress value to set. + * @return the VpnLinkBgpSettings object itself. + */ + public VpnLinkBgpSettings withBgpPeeringAddress(String bgpPeeringAddress) { + this.bgpPeeringAddress = bgpPeeringAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnectionMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnectionMode.java new file mode 100644 index 0000000000000..69f50355f5609 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnectionMode.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnLinkConnectionMode. */ +public final class VpnLinkConnectionMode extends ExpandableStringEnum { + /** Static value Default for VpnLinkConnectionMode. */ + public static final VpnLinkConnectionMode DEFAULT = fromString("Default"); + + /** Static value ResponderOnly for VpnLinkConnectionMode. */ + public static final VpnLinkConnectionMode RESPONDER_ONLY = fromString("ResponderOnly"); + + /** Static value InitiatorOnly for VpnLinkConnectionMode. */ + public static final VpnLinkConnectionMode INITIATOR_ONLY = fromString("InitiatorOnly"); + + /** + * Creates or finds a VpnLinkConnectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnLinkConnectionMode. + */ + @JsonCreator + public static VpnLinkConnectionMode fromString(String name) { + return fromString(name, VpnLinkConnectionMode.class); + } + + /** @return known VpnLinkConnectionMode values. */ + public static Collection values() { + return values(VpnLinkConnectionMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnections.java new file mode 100644 index 0000000000000..c698e19cc01aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnections.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of VpnLinkConnections. */ +public interface VpnLinkConnections { + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String getIkeSas(String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + String getIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkProviderProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkProviderProperties.java new file mode 100644 index 0000000000000..546591c7e8061 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkProviderProperties.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.network.generated.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; + +/** List of properties of a link provider. */ +@Fluent +public final class VpnLinkProviderProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnLinkProviderProperties.class); + + /* + * Name of the link provider. + */ + @JsonProperty(value = "linkProviderName") + private String linkProviderName; + + /* + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + private Integer linkSpeedInMbps; + + /** + * Get the linkProviderName property: Name of the link provider. + * + * @return the linkProviderName value. + */ + public String linkProviderName() { + return this.linkProviderName; + } + + /** + * Set the linkProviderName property: Name of the link provider. + * + * @param linkProviderName the linkProviderName value to set. + * @return the VpnLinkProviderProperties object itself. + */ + public VpnLinkProviderProperties withLinkProviderName(String linkProviderName) { + this.linkProviderName = linkProviderName; + return this; + } + + /** + * Get the linkSpeedInMbps property: Link speed. + * + * @return the linkSpeedInMbps value. + */ + public Integer linkSpeedInMbps() { + return this.linkSpeedInMbps; + } + + /** + * Set the linkSpeedInMbps property: Link speed. + * + * @param linkSpeedInMbps the linkSpeedInMbps value to set. + * @return the VpnLinkProviderProperties object itself. + */ + public VpnLinkProviderProperties withLinkSpeedInMbps(Integer linkSpeedInMbps) { + this.linkSpeedInMbps = linkSpeedInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMapping.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMapping.java new file mode 100644 index 0000000000000..3bd785248950b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMapping.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.network.generated.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; + +/** Vpn NatRule mapping. */ +@Fluent +public final class VpnNatRuleMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnNatRuleMapping.class); + + /* + * Address space for Vpn NatRule mapping. + */ + @JsonProperty(value = "addressSpace") + private String addressSpace; + + /** + * Get the addressSpace property: Address space for Vpn NatRule mapping. + * + * @return the addressSpace value. + */ + public String addressSpace() { + return this.addressSpace; + } + + /** + * Set the addressSpace property: Address space for Vpn NatRule mapping. + * + * @param addressSpace the addressSpace value to set. + * @return the VpnNatRuleMapping object itself. + */ + public VpnNatRuleMapping withAddressSpace(String addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMode.java new file mode 100644 index 0000000000000..71419ad5a0f1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMode.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnNatRuleMode. */ +public final class VpnNatRuleMode extends ExpandableStringEnum { + /** Static value EgressSnat for VpnNatRuleMode. */ + public static final VpnNatRuleMode EGRESS_SNAT = fromString("EgressSnat"); + + /** Static value IngressSnat for VpnNatRuleMode. */ + public static final VpnNatRuleMode INGRESS_SNAT = fromString("IngressSnat"); + + /** + * Creates or finds a VpnNatRuleMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnNatRuleMode. + */ + @JsonCreator + public static VpnNatRuleMode fromString(String name) { + return fromString(name, VpnNatRuleMode.class); + } + + /** @return known VpnNatRuleMode values. */ + public static Collection values() { + return values(VpnNatRuleMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleType.java new file mode 100644 index 0000000000000..eb9bc6a32f3a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnNatRuleType. */ +public final class VpnNatRuleType extends ExpandableStringEnum { + /** Static value Static for VpnNatRuleType. */ + public static final VpnNatRuleType STATIC = fromString("Static"); + + /** Static value Dynamic for VpnNatRuleType. */ + public static final VpnNatRuleType DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a VpnNatRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnNatRuleType. + */ + @JsonCreator + public static VpnNatRuleType fromString(String name) { + return fromString(name, VpnNatRuleType.class); + } + + /** @return known VpnNatRuleType values. */ + public static Collection values() { + return values(VpnNatRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStartParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStartParameters.java new file mode 100644 index 0000000000000..67abefd50777a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStartParameters.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.network.generated.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; + +/** Start packet capture parameters on virtual network gateway. */ +@Fluent +public final class VpnPacketCaptureStartParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnPacketCaptureStartParameters.class); + + /* + * Start Packet capture parameters. + */ + @JsonProperty(value = "filterData") + private String filterData; + + /** + * Get the filterData property: Start Packet capture parameters. + * + * @return the filterData value. + */ + public String filterData() { + return this.filterData; + } + + /** + * Set the filterData property: Start Packet capture parameters. + * + * @param filterData the filterData value to set. + * @return the VpnPacketCaptureStartParameters object itself. + */ + public VpnPacketCaptureStartParameters withFilterData(String filterData) { + this.filterData = filterData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStopParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStopParameters.java new file mode 100644 index 0000000000000..26d647b2cad05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStopParameters.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.network.generated.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; + +/** Stop packet capture parameters. */ +@Fluent +public final class VpnPacketCaptureStopParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnPacketCaptureStopParameters.class); + + /* + * SAS url for packet capture on virtual network gateway. + */ + @JsonProperty(value = "sasUrl") + private String sasUrl; + + /** + * Get the sasUrl property: SAS url for packet capture on virtual network gateway. + * + * @return the sasUrl value. + */ + public String sasUrl() { + return this.sasUrl; + } + + /** + * Set the sasUrl property: SAS url for packet capture on virtual network gateway. + * + * @param sasUrl the sasUrl value to set. + * @return the VpnPacketCaptureStopParameters object itself. + */ + public VpnPacketCaptureStopParameters withSasUrl(String sasUrl) { + this.sasUrl = sasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnProfileResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnProfileResponse.java new file mode 100644 index 0000000000000..a4d9b1dc51032 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnProfileResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; + +/** An immutable client-side representation of VpnProfileResponse. */ +public interface VpnProfileResponse { + /** + * Gets the profileUrl property: URL to the VPN profile. + * + * @return the profileUrl value. + */ + String profileUrl(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner object. + * + * @return the inner object. + */ + VpnProfileResponseInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java new file mode 100644 index 0000000000000..e7ffb46c6f4be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.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.network.generated.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; + +/** Properties of the Radius client root certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigRadiusClientRootCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigRadiusClientRootCertificate.class); + + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The Radius client root certificate thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Get the name property: The certificate name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The certificate name. + * + * @param name the name value to set. + * @return the VpnServerConfigRadiusClientRootCertificate object itself. + */ + public VpnServerConfigRadiusClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the thumbprint property: The Radius client root certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The Radius client root certificate thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the VpnServerConfigRadiusClientRootCertificate object itself. + */ + public VpnServerConfigRadiusClientRootCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusServerRootCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusServerRootCertificate.java new file mode 100644 index 0000000000000..f46b6d218de8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusServerRootCertificate.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.network.generated.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; + +/** Properties of Radius Server root certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigRadiusServerRootCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigRadiusServerRootCertificate.class); + + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The certificate public data. + */ + @JsonProperty(value = "publicCertData") + private String publicCertData; + + /** + * Get the name property: The certificate name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The certificate name. + * + * @param name the name value to set. + * @return the VpnServerConfigRadiusServerRootCertificate object itself. + */ + public VpnServerConfigRadiusServerRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publicCertData property: The certificate public data. + * + * @return the publicCertData value. + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the publicCertData property: The certificate public data. + * + * @param publicCertData the publicCertData value to set. + * @return the VpnServerConfigRadiusServerRootCertificate object itself. + */ + public VpnServerConfigRadiusServerRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRevokedCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRevokedCertificate.java new file mode 100644 index 0000000000000..8206f6621d2eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRevokedCertificate.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.network.generated.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; + +/** Properties of the revoked VPN client certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigVpnClientRevokedCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigVpnClientRevokedCertificate.class); + + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Get the name property: The certificate name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The certificate name. + * + * @param name the name value to set. + * @return the VpnServerConfigVpnClientRevokedCertificate object itself. + */ + public VpnServerConfigVpnClientRevokedCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the thumbprint property: The revoked VPN client certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The revoked VPN client certificate thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the VpnServerConfigVpnClientRevokedCertificate object itself. + */ + public VpnServerConfigVpnClientRevokedCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRootCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRootCertificate.java new file mode 100644 index 0000000000000..8aba32193b1ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRootCertificate.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.network.generated.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; + +/** Properties of VPN client root certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigVpnClientRootCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigVpnClientRootCertificate.class); + + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The certificate public data. + */ + @JsonProperty(value = "publicCertData") + private String publicCertData; + + /** + * Get the name property: The certificate name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The certificate name. + * + * @param name the name value to set. + * @return the VpnServerConfigVpnClientRootCertificate object itself. + */ + public VpnServerConfigVpnClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publicCertData property: The certificate public data. + * + * @return the publicCertData value. + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the publicCertData property: The certificate public data. + * + * @param publicCertData the publicCertData value to set. + * @return the VpnServerConfigVpnClientRootCertificate object itself. + */ + public VpnServerConfigVpnClientRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfiguration.java new file mode 100644 index 0000000000000..2b10f99ce3bd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfiguration.java @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VpnServerConfiguration. */ +public interface VpnServerConfiguration { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the namePropertiesName property: The name of the VpnServerConfiguration that is unique within a resource + * group. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the vpnProtocols property: VPN protocols for the VpnServerConfiguration. + * + * @return the vpnProtocols value. + */ + List vpnProtocols(); + + /** + * Gets the vpnAuthenticationTypes property: VPN authentication types for the VpnServerConfiguration. + * + * @return the vpnAuthenticationTypes value. + */ + List vpnAuthenticationTypes(); + + /** + * Gets the vpnClientRootCertificates property: VPN client root certificate of VpnServerConfiguration. + * + * @return the vpnClientRootCertificates value. + */ + List vpnClientRootCertificates(); + + /** + * Gets the vpnClientRevokedCertificates property: VPN client revoked certificate of VpnServerConfiguration. + * + * @return the vpnClientRevokedCertificates value. + */ + List vpnClientRevokedCertificates(); + + /** + * Gets the radiusServerRootCertificates property: Radius Server root certificate of VpnServerConfiguration. + * + * @return the radiusServerRootCertificates value. + */ + List radiusServerRootCertificates(); + + /** + * Gets the radiusClientRootCertificates property: Radius client root certificate of VpnServerConfiguration. + * + * @return the radiusClientRootCertificates value. + */ + List radiusClientRootCertificates(); + + /** + * Gets the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for VpnServerConfiguration. + * + * @return the vpnClientIpsecPolicies value. + */ + List vpnClientIpsecPolicies(); + + /** + * Gets the radiusServerAddress property: The radius server address property of the VpnServerConfiguration resource + * for point to site client connection. + * + * @return the radiusServerAddress value. + */ + String radiusServerAddress(); + + /** + * Gets the radiusServerSecret property: The radius secret property of the VpnServerConfiguration resource for point + * to site client connection. + * + * @return the radiusServerSecret value. + */ + String radiusServerSecret(); + + /** + * Gets the radiusServers property: Multiple Radius Server configuration for VpnServerConfiguration. + * + * @return the radiusServers value. + */ + List radiusServers(); + + /** + * Gets the aadAuthenticationParameters property: The set of aad vpn authentication parameters. + * + * @return the aadAuthenticationParameters value. + */ + AadAuthenticationParameters aadAuthenticationParameters(); + + /** + * Gets the provisioningState property: The provisioning state of the VpnServerConfiguration resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the p2SVpnGateways property: List of references to P2SVpnGateways. + * + * @return the p2SVpnGateways value. + */ + List p2SVpnGateways(); + + /** + * Gets the etagPropertiesEtag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etagPropertiesEtag value. + */ + String etagPropertiesEtag(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VpnServerConfigurationInner object. + * + * @return the inner object. + */ + VpnServerConfigurationInner innerModel(); + + /** The entirety of the VpnServerConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VpnServerConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the VpnServerConfiguration definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VpnServerConfiguration 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 VpnServerConfiguration definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VpnServerConfiguration 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.WithNamePropertiesName, + DefinitionStages.WithVpnProtocols, + DefinitionStages.WithVpnAuthenticationTypes, + DefinitionStages.WithVpnClientRootCertificates, + DefinitionStages.WithVpnClientRevokedCertificates, + DefinitionStages.WithRadiusServerRootCertificates, + DefinitionStages.WithRadiusClientRootCertificates, + DefinitionStages.WithVpnClientIpsecPolicies, + DefinitionStages.WithRadiusServerAddress, + DefinitionStages.WithRadiusServerSecret, + DefinitionStages.WithRadiusServers, + DefinitionStages.WithAadAuthenticationParameters { + /** + * Executes the create request. + * + * @return the created resource. + */ + VpnServerConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VpnServerConfiguration create(Context context); + } + /** The stage of the VpnServerConfiguration 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 VpnServerConfiguration definition allowing to specify namePropertiesName. */ + interface WithNamePropertiesName { + /** + * Specifies the namePropertiesName property: The name of the VpnServerConfiguration that is unique within a + * resource group.. + * + * @param namePropertiesName The name of the VpnServerConfiguration that is unique within a resource group. + * @return the next definition stage. + */ + WithCreate withNamePropertiesName(String namePropertiesName); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnProtocols. */ + interface WithVpnProtocols { + /** + * Specifies the vpnProtocols property: VPN protocols for the VpnServerConfiguration.. + * + * @param vpnProtocols VPN protocols for the VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnProtocols(List vpnProtocols); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnAuthenticationTypes. */ + interface WithVpnAuthenticationTypes { + /** + * Specifies the vpnAuthenticationTypes property: VPN authentication types for the VpnServerConfiguration.. + * + * @param vpnAuthenticationTypes VPN authentication types for the VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnAuthenticationTypes(List vpnAuthenticationTypes); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnClientRootCertificates. */ + interface WithVpnClientRootCertificates { + /** + * Specifies the vpnClientRootCertificates property: VPN client root certificate of VpnServerConfiguration.. + * + * @param vpnClientRootCertificates VPN client root certificate of VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnClientRootCertificates( + List vpnClientRootCertificates); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnClientRevokedCertificates. */ + interface WithVpnClientRevokedCertificates { + /** + * Specifies the vpnClientRevokedCertificates property: VPN client revoked certificate of + * VpnServerConfiguration.. + * + * @param vpnClientRevokedCertificates VPN client revoked certificate of VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnClientRevokedCertificates( + List vpnClientRevokedCertificates); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusServerRootCertificates. */ + interface WithRadiusServerRootCertificates { + /** + * Specifies the radiusServerRootCertificates property: Radius Server root certificate of + * VpnServerConfiguration.. + * + * @param radiusServerRootCertificates Radius Server root certificate of VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withRadiusServerRootCertificates( + List radiusServerRootCertificates); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusClientRootCertificates. */ + interface WithRadiusClientRootCertificates { + /** + * Specifies the radiusClientRootCertificates property: Radius client root certificate of + * VpnServerConfiguration.. + * + * @param radiusClientRootCertificates Radius client root certificate of VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withRadiusClientRootCertificates( + List radiusClientRootCertificates); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnClientIpsecPolicies. */ + interface WithVpnClientIpsecPolicies { + /** + * Specifies the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for VpnServerConfiguration.. + * + * @param vpnClientIpsecPolicies VpnClientIpsecPolicies for VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnClientIpsecPolicies(List vpnClientIpsecPolicies); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusServerAddress. */ + interface WithRadiusServerAddress { + /** + * Specifies the radiusServerAddress property: The radius server address property of the + * VpnServerConfiguration resource for point to site client connection.. + * + * @param radiusServerAddress The radius server address property of the VpnServerConfiguration resource for + * point to site client connection. + * @return the next definition stage. + */ + WithCreate withRadiusServerAddress(String radiusServerAddress); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusServerSecret. */ + interface WithRadiusServerSecret { + /** + * Specifies the radiusServerSecret property: The radius secret property of the VpnServerConfiguration + * resource for point to site client connection.. + * + * @param radiusServerSecret The radius secret property of the VpnServerConfiguration resource for point to + * site client connection. + * @return the next definition stage. + */ + WithCreate withRadiusServerSecret(String radiusServerSecret); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusServers. */ + interface WithRadiusServers { + /** + * Specifies the radiusServers property: Multiple Radius Server configuration for VpnServerConfiguration.. + * + * @param radiusServers Multiple Radius Server configuration for VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withRadiusServers(List radiusServers); + } + /** The stage of the VpnServerConfiguration definition allowing to specify aadAuthenticationParameters. */ + interface WithAadAuthenticationParameters { + /** + * Specifies the aadAuthenticationParameters property: The set of aad vpn authentication parameters.. + * + * @param aadAuthenticationParameters The set of aad vpn authentication parameters. + * @return the next definition stage. + */ + WithCreate withAadAuthenticationParameters(AadAuthenticationParameters aadAuthenticationParameters); + } + } + /** + * Begins update for the VpnServerConfiguration resource. + * + * @return the stage of resource update. + */ + VpnServerConfiguration.Update update(); + + /** The template for VpnServerConfiguration update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VpnServerConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VpnServerConfiguration apply(Context context); + } + /** The VpnServerConfiguration update stages. */ + interface UpdateStages { + /** The stage of the VpnServerConfiguration 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VpnServerConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VpnServerConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurations.java new file mode 100644 index 0000000000000..1ea4002f98c77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurations.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VpnServerConfigurations. */ +public interface VpnServerConfigurations { + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + VpnServerConfiguration getByResourceGroup(String resourceGroupName, String vpnServerConfigurationName); + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnServerConfigurationName, Context context); + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vpnServerConfigurationName); + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vpnServerConfigurationName, Context context); + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + PagedIterable list(); + + /** + * Lists all the VpnServerConfigurations 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 result of the request to list all VpnServerConfigurations. + */ + PagedIterable list(Context context); + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @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 vpnServerConfiguration Resource. + */ + VpnServerConfiguration getById(String id); + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @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 vpnServerConfiguration Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a VpnServerConfiguration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a VpnServerConfiguration. + * + * @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 VpnServerConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new VpnServerConfiguration definition. + */ + VpnServerConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsAssociatedWithVirtualWans.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsAssociatedWithVirtualWans.java new file mode 100644 index 0000000000000..2fb54d3c9fc18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsAssociatedWithVirtualWans.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; + +/** Resource collection API of VpnServerConfigurationsAssociatedWithVirtualWans. */ +public interface VpnServerConfigurationsAssociatedWithVirtualWans { + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + VpnServerConfigurationsResponse list(String resourceGroupName, String virtualWanName); + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + VpnServerConfigurationsResponse list(String resourceGroupName, String virtualWanName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsResponse.java new file mode 100644 index 0000000000000..92934fbbc3ee0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; +import java.util.List; + +/** An immutable client-side representation of VpnServerConfigurationsResponse. */ +public interface VpnServerConfigurationsResponse { + /** + * Gets the vpnServerConfigurationResourceIds property: List of VpnServerConfigurations associated with VirtualWan. + * + * @return the vpnServerConfigurationResourceIds value. + */ + List vpnServerConfigurationResourceIds(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner + * object. + * + * @return the inner object. + */ + VpnServerConfigurationsResponseInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSite.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSite.java new file mode 100644 index 0000000000000..03fbd571f2f39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSite.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VpnSite. */ +public interface VpnSite { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the virtualWan property: The VirtualWAN to which the vpnSite belongs. + * + * @return the virtualWan value. + */ + SubResource virtualWan(); + + /** + * Gets the deviceProperties property: The device properties. + * + * @return the deviceProperties value. + */ + DeviceProperties deviceProperties(); + + /** + * Gets the ipAddress property: The ip-address for the vpn-site. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the siteKey property: The key for vpn-site that can be used for connections. + * + * @return the siteKey value. + */ + String siteKey(); + + /** + * Gets the addressSpace property: The AddressSpace that contains an array of IP address ranges. + * + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * Gets the bgpProperties property: The set of bgp properties. + * + * @return the bgpProperties value. + */ + BgpSettings bgpProperties(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN site resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the isSecuritySite property: IsSecuritySite flag. + * + * @return the isSecuritySite value. + */ + Boolean isSecuritySite(); + + /** + * Gets the vpnSiteLinks property: List of all vpn site links. + * + * @return the vpnSiteLinks value. + */ + List vpnSiteLinks(); + + /** + * Gets the o365Policy property: Office365 Policy. + * + * @return the o365Policy value. + */ + O365PolicyProperties o365Policy(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.VpnSiteInner object. + * + * @return the inner object. + */ + VpnSiteInner innerModel(); + + /** The entirety of the VpnSite definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VpnSite definition stages. */ + interface DefinitionStages { + /** The first stage of the VpnSite definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VpnSite 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 VpnSite definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VpnSite 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.WithVirtualWan, + DefinitionStages.WithDeviceProperties, + DefinitionStages.WithIpAddress, + DefinitionStages.WithSiteKey, + DefinitionStages.WithAddressSpace, + DefinitionStages.WithBgpProperties, + DefinitionStages.WithIsSecuritySite, + DefinitionStages.WithVpnSiteLinks, + DefinitionStages.WithO365Policy { + /** + * Executes the create request. + * + * @return the created resource. + */ + VpnSite create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VpnSite create(Context context); + } + /** The stage of the VpnSite 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 VpnSite definition allowing to specify virtualWan. */ + interface WithVirtualWan { + /** + * Specifies the virtualWan property: The VirtualWAN to which the vpnSite belongs.. + * + * @param virtualWan The VirtualWAN to which the vpnSite belongs. + * @return the next definition stage. + */ + WithCreate withVirtualWan(SubResource virtualWan); + } + /** The stage of the VpnSite definition allowing to specify deviceProperties. */ + interface WithDeviceProperties { + /** + * Specifies the deviceProperties property: The device properties.. + * + * @param deviceProperties The device properties. + * @return the next definition stage. + */ + WithCreate withDeviceProperties(DeviceProperties deviceProperties); + } + /** The stage of the VpnSite definition allowing to specify ipAddress. */ + interface WithIpAddress { + /** + * Specifies the ipAddress property: The ip-address for the vpn-site.. + * + * @param ipAddress The ip-address for the vpn-site. + * @return the next definition stage. + */ + WithCreate withIpAddress(String ipAddress); + } + /** The stage of the VpnSite definition allowing to specify siteKey. */ + interface WithSiteKey { + /** + * Specifies the siteKey property: The key for vpn-site that can be used for connections.. + * + * @param siteKey The key for vpn-site that can be used for connections. + * @return the next definition stage. + */ + WithCreate withSiteKey(String siteKey); + } + /** The stage of the VpnSite definition allowing to specify addressSpace. */ + interface WithAddressSpace { + /** + * Specifies the addressSpace property: The AddressSpace that contains an array of IP address ranges.. + * + * @param addressSpace The AddressSpace that contains an array of IP address ranges. + * @return the next definition stage. + */ + WithCreate withAddressSpace(AddressSpace addressSpace); + } + /** The stage of the VpnSite definition allowing to specify bgpProperties. */ + interface WithBgpProperties { + /** + * Specifies the bgpProperties property: The set of bgp properties.. + * + * @param bgpProperties The set of bgp properties. + * @return the next definition stage. + */ + WithCreate withBgpProperties(BgpSettings bgpProperties); + } + /** The stage of the VpnSite definition allowing to specify isSecuritySite. */ + interface WithIsSecuritySite { + /** + * Specifies the isSecuritySite property: IsSecuritySite flag.. + * + * @param isSecuritySite IsSecuritySite flag. + * @return the next definition stage. + */ + WithCreate withIsSecuritySite(Boolean isSecuritySite); + } + /** The stage of the VpnSite definition allowing to specify vpnSiteLinks. */ + interface WithVpnSiteLinks { + /** + * Specifies the vpnSiteLinks property: List of all vpn site links.. + * + * @param vpnSiteLinks List of all vpn site links. + * @return the next definition stage. + */ + WithCreate withVpnSiteLinks(List vpnSiteLinks); + } + /** The stage of the VpnSite definition allowing to specify o365Policy. */ + interface WithO365Policy { + /** + * Specifies the o365Policy property: Office365 Policy.. + * + * @param o365Policy Office365 Policy. + * @return the next definition stage. + */ + WithCreate withO365Policy(O365PolicyProperties o365Policy); + } + } + /** + * Begins update for the VpnSite resource. + * + * @return the stage of resource update. + */ + VpnSite.Update update(); + + /** The template for VpnSite update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VpnSite apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VpnSite apply(Context context); + } + /** The VpnSite update stages. */ + interface UpdateStages { + /** The stage of the VpnSite 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VpnSite refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VpnSite refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLink.java new file mode 100644 index 0000000000000..da8cd1a2bb6a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLink.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; + +/** An immutable client-side representation of VpnSiteLink. */ +public interface VpnSiteLink { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the linkProperties property: The link provider properties. + * + * @return the linkProperties value. + */ + VpnLinkProviderProperties linkProperties(); + + /** + * Gets the ipAddress property: The ip-address for the vpn-site-link. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the fqdn property: FQDN of vpn-site-link. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the bgpProperties property: The set of bgp properties. + * + * @return the bgpProperties value. + */ + VpnLinkBgpSettings bgpProperties(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN site link resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner object. + * + * @return the inner object. + */ + VpnSiteLinkInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.java new file mode 100644 index 0000000000000..850254c8ed45d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.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.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import java.util.List; + +/** An immutable client-side representation of VpnSiteLinkConnection. */ +public interface VpnSiteLinkConnection { + /** + * 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 that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the vpnSiteLink property: Id of the connected vpn site link. + * + * @return the vpnSiteLink value. + */ + SubResource vpnSiteLink(); + + /** + * Gets the routingWeight property: Routing weight for vpn connection. + * + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * Gets the vpnLinkConnectionMode property: Vpn link connection mode. + * + * @return the vpnLinkConnectionMode value. + */ + VpnLinkConnectionMode vpnLinkConnectionMode(); + + /** + * Gets the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + VpnConnectionStatus connectionStatus(); + + /** + * Gets the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @return the vpnConnectionProtocolType value. + */ + VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType(); + + /** + * Gets the ingressBytesTransferred property: Ingress bytes transferred. + * + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * Gets the egressBytesTransferred property: Egress bytes transferred. + * + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * Gets the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @return the connectionBandwidth value. + */ + Integer connectionBandwidth(); + + /** + * Gets the sharedKey property: SharedKey for the vpn connection. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * Gets the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * Gets the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * Gets the enableRateLimiting property: EnableBgp flag. + * + * @return the enableRateLimiting value. + */ + Boolean enableRateLimiting(); + + /** + * Gets the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value. + */ + Boolean useLocalAzureIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN site link connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the ingressNatRules property: List of ingress NatRules. + * + * @return the ingressNatRules value. + */ + List ingressNatRules(); + + /** + * Gets the egressNatRules property: List of egress NatRules. + * + * @return the egressNatRules value. + */ + List egressNatRules(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner object. + * + * @return the inner object. + */ + VpnSiteLinkConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnections.java new file mode 100644 index 0000000000000..93bfdcfa94f1f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnections.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.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VpnSiteLinkConnections. */ +public interface VpnSiteLinkConnections { + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + VpnSiteLinkConnection get( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + Response getWithResponse( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinks.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinks.java new file mode 100644 index 0000000000000..a5cf08c70567e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinks.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.network.generated.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 VpnSiteLinks. */ +public interface VpnSiteLinks { + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + VpnSiteLink get(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName); + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + Response getWithResponse( + String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, Context context); + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName); + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSites.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSites.java new file mode 100644 index 0000000000000..9f771603d1220 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSites.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 VpnSites. */ +public interface VpnSites { + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + VpnSite getByResourceGroup(String resourceGroupName, String vpnSiteName); + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String vpnSiteName, Context context); + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vpnSiteName); + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vpnSiteName, Context context); + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + PagedIterable list(); + + /** + * Lists all the VpnSites 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 result of the request to list VpnSites. + */ + PagedIterable list(Context context); + + /** + * Retrieves the details of a VPN site. + * + * @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 vpnSite Resource. + */ + VpnSite getById(String id); + + /** + * Retrieves the details of a VPN site. + * + * @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 vpnSite Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a VpnSite. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a VpnSite. + * + * @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 VpnSite resource. + * + * @param name resource name. + * @return the first stage of the new VpnSite definition. + */ + VpnSite.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSitesConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSitesConfigurations.java new file mode 100644 index 0000000000000..53515b2c5e9dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSitesConfigurations.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.network.generated.models; + +import com.azure.core.util.Context; + +/** Resource collection API of VpnSitesConfigurations. */ +public interface VpnSitesConfigurations { + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void download(String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request); + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void download( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnType.java new file mode 100644 index 0000000000000..812ca2ebbe3b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnType. */ +public final class VpnType extends ExpandableStringEnum { + /** Static value PolicyBased for VpnType. */ + public static final VpnType POLICY_BASED = fromString("PolicyBased"); + + /** Static value RouteBased for VpnType. */ + public static final VpnType ROUTE_BASED = fromString("RouteBased"); + + /** + * Creates or finds a VpnType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnType. + */ + @JsonCreator + public static VpnType fromString(String name) { + return fromString(name, VpnType.class); + } + + /** @return known VpnType values. */ + public static Collection values() { + return values(VpnType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallAction.java new file mode 100644 index 0000000000000..1841fce1911dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallAction.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallAction. */ +public final class WebApplicationFirewallAction extends ExpandableStringEnum { + /** Static value Allow for WebApplicationFirewallAction. */ + public static final WebApplicationFirewallAction ALLOW = fromString("Allow"); + + /** Static value Block for WebApplicationFirewallAction. */ + public static final WebApplicationFirewallAction BLOCK = fromString("Block"); + + /** Static value Log for WebApplicationFirewallAction. */ + public static final WebApplicationFirewallAction LOG = fromString("Log"); + + /** + * Creates or finds a WebApplicationFirewallAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallAction. + */ + @JsonCreator + public static WebApplicationFirewallAction fromString(String name) { + return fromString(name, WebApplicationFirewallAction.class); + } + + /** @return known WebApplicationFirewallAction values. */ + public static Collection values() { + return values(WebApplicationFirewallAction.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallCustomRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallCustomRule.java new file mode 100644 index 0000000000000..0e2aa260b55a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallCustomRule.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.network.generated.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; + +/** Defines contents of a web application rule. */ +@Fluent +public final class WebApplicationFirewallCustomRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallCustomRule.class); + + /* + * The name of the resource that is unique within a policy. This name can + * be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Priority of the rule. Rules with a lower value will be evaluated before + * rules with a higher value. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /* + * The rule type. + */ + @JsonProperty(value = "ruleType", required = true) + private WebApplicationFirewallRuleType ruleType; + + /* + * List of match conditions. + */ + @JsonProperty(value = "matchConditions", required = true) + private List matchConditions; + + /* + * Type of Actions. + */ + @JsonProperty(value = "action", required = true) + private WebApplicationFirewallAction action; + + /** + * Get the name property: The name of the resource that is unique within a policy. This name can be used to access + * the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a policy. This name can be used to access + * the resource. + * + * @param name the name value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the priority property: Priority of the rule. Rules with a lower value will be evaluated before rules with a + * higher value. + * + * @return the priority value. + */ + public int priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the rule. Rules with a lower value will be evaluated before rules with a + * higher value. + * + * @param priority the priority value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get the ruleType property: The rule type. + * + * @return the ruleType value. + */ + public WebApplicationFirewallRuleType ruleType() { + return this.ruleType; + } + + /** + * Set the ruleType property: The rule type. + * + * @param ruleType the ruleType value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withRuleType(WebApplicationFirewallRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get the matchConditions property: List of match conditions. + * + * @return the matchConditions value. + */ + public List matchConditions() { + return this.matchConditions; + } + + /** + * Set the matchConditions property: List of match conditions. + * + * @param matchConditions the matchConditions value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withMatchConditions(List matchConditions) { + this.matchConditions = matchConditions; + return this; + } + + /** + * Get the action property: Type of Actions. + * + * @return the action value. + */ + public WebApplicationFirewallAction action() { + return this.action; + } + + /** + * Set the action property: Type of Actions. + * + * @param action the action value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withAction(WebApplicationFirewallAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleType in model WebApplicationFirewallCustomRule")); + } + if (matchConditions() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchConditions in model WebApplicationFirewallCustomRule")); + } else { + matchConditions().forEach(e -> e.validate()); + } + if (action() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model WebApplicationFirewallCustomRule")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallEnabledState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallEnabledState.java new file mode 100644 index 0000000000000..06243fd0d57f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallEnabledState.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallEnabledState. */ +public final class WebApplicationFirewallEnabledState extends ExpandableStringEnum { + /** Static value Disabled for WebApplicationFirewallEnabledState. */ + public static final WebApplicationFirewallEnabledState DISABLED = fromString("Disabled"); + + /** Static value Enabled for WebApplicationFirewallEnabledState. */ + public static final WebApplicationFirewallEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a WebApplicationFirewallEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallEnabledState. + */ + @JsonCreator + public static WebApplicationFirewallEnabledState fromString(String name) { + return fromString(name, WebApplicationFirewallEnabledState.class); + } + + /** @return known WebApplicationFirewallEnabledState values. */ + public static Collection values() { + return values(WebApplicationFirewallEnabledState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMatchVariable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMatchVariable.java new file mode 100644 index 0000000000000..eae39bd306a32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMatchVariable.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallMatchVariable. */ +public final class WebApplicationFirewallMatchVariable + extends ExpandableStringEnum { + /** Static value RemoteAddr for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REMOTE_ADDR = fromString("RemoteAddr"); + + /** Static value RequestMethod for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_METHOD = fromString("RequestMethod"); + + /** Static value QueryString for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable QUERY_STRING = fromString("QueryString"); + + /** Static value PostArgs for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable POST_ARGS = fromString("PostArgs"); + + /** Static value RequestUri for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_URI = fromString("RequestUri"); + + /** Static value RequestHeaders for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_HEADERS = fromString("RequestHeaders"); + + /** Static value RequestBody for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_BODY = fromString("RequestBody"); + + /** Static value RequestCookies for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_COOKIES = fromString("RequestCookies"); + + /** + * Creates or finds a WebApplicationFirewallMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallMatchVariable. + */ + @JsonCreator + public static WebApplicationFirewallMatchVariable fromString(String name) { + return fromString(name, WebApplicationFirewallMatchVariable.class); + } + + /** @return known WebApplicationFirewallMatchVariable values. */ + public static Collection values() { + return values(WebApplicationFirewallMatchVariable.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMode.java new file mode 100644 index 0000000000000..076445aee3133 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMode.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallMode. */ +public final class WebApplicationFirewallMode extends ExpandableStringEnum { + /** Static value Prevention for WebApplicationFirewallMode. */ + public static final WebApplicationFirewallMode PREVENTION = fromString("Prevention"); + + /** Static value Detection for WebApplicationFirewallMode. */ + public static final WebApplicationFirewallMode DETECTION = fromString("Detection"); + + /** + * Creates or finds a WebApplicationFirewallMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallMode. + */ + @JsonCreator + public static WebApplicationFirewallMode fromString(String name) { + return fromString(name, WebApplicationFirewallMode.class); + } + + /** @return known WebApplicationFirewallMode values. */ + public static Collection values() { + return values(WebApplicationFirewallMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallOperator.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallOperator.java new file mode 100644 index 0000000000000..f09ee001d67b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallOperator.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallOperator. */ +public final class WebApplicationFirewallOperator extends ExpandableStringEnum { + /** Static value IPMatch for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator IPMATCH = fromString("IPMatch"); + + /** Static value Equal for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator EQUAL = fromString("Equal"); + + /** Static value Contains for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator CONTAINS = fromString("Contains"); + + /** Static value LessThan for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator LESS_THAN = fromString("LessThan"); + + /** Static value GreaterThan for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value LessThanOrEqual for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThanOrEqual for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value BeginsWith for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value Regex for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator REGEX = fromString("Regex"); + + /** Static value GeoMatch for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator GEO_MATCH = fromString("GeoMatch"); + + /** + * Creates or finds a WebApplicationFirewallOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallOperator. + */ + @JsonCreator + public static WebApplicationFirewallOperator fromString(String name) { + return fromString(name, WebApplicationFirewallOperator.class); + } + + /** @return known WebApplicationFirewallOperator values. */ + public static Collection values() { + return values(WebApplicationFirewallOperator.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicies.java new file mode 100644 index 0000000000000..6a933145ae521 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicies.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 WebApplicationFirewallPolicies. */ +public interface WebApplicationFirewallPolicies { + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource 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 result of the request to list WebApplicationFirewallPolicies. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the WAF policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the WAF policies 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 all the WAF policies in a subscription. + */ + PagedIterable list(Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + WebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 policyName); + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 policyName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @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 defines web application firewall policy. + */ + WebApplicationFirewallPolicy getById(String id); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @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 defines web application firewall policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes Policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes Policy. + * + * @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 WebApplicationFirewallPolicy resource. + * + * @param name resource name. + * @return the first stage of the new WebApplicationFirewallPolicy definition. + */ + WebApplicationFirewallPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicy.java new file mode 100644 index 0000000000000..0442cc8ed5cb9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicy.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of WebApplicationFirewallPolicy. */ +public interface WebApplicationFirewallPolicy { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the policySettings property: The PolicySettings for policy. + * + * @return the policySettings value. + */ + PolicySettings policySettings(); + + /** + * Gets the customRules property: The custom rules inside the policy. + * + * @return the customRules value. + */ + List customRules(); + + /** + * Gets the applicationGateways property: A collection of references to application gateways. + * + * @return the applicationGateways value. + */ + List applicationGateways(); + + /** + * Gets the provisioningState property: The provisioning state of the web application firewall policy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + WebApplicationFirewallPolicyResourceState resourceState(); + + /** + * Gets the managedRules property: Describes the managedRules structure. + * + * @return the managedRules value. + */ + ManagedRulesDefinition managedRules(); + + /** + * Gets the httpListeners property: A collection of references to application gateway http listeners. + * + * @return the httpListeners value. + */ + List httpListeners(); + + /** + * Gets the pathBasedRules property: A collection of references to application gateway path rules. + * + * @return the pathBasedRules value. + */ + List pathBasedRules(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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.network.generated.fluent.models.WebApplicationFirewallPolicyInner + * object. + * + * @return the inner object. + */ + WebApplicationFirewallPolicyInner innerModel(); + + /** The entirety of the WebApplicationFirewallPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The WebApplicationFirewallPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the WebApplicationFirewallPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the WebApplicationFirewallPolicy 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 WebApplicationFirewallPolicy definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the WebApplicationFirewallPolicy 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.WithPolicySettings, + DefinitionStages.WithCustomRules, + DefinitionStages.WithManagedRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + WebApplicationFirewallPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WebApplicationFirewallPolicy create(Context context); + } + /** The stage of the WebApplicationFirewallPolicy 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 WebApplicationFirewallPolicy definition allowing to specify policySettings. */ + interface WithPolicySettings { + /** + * Specifies the policySettings property: The PolicySettings for policy.. + * + * @param policySettings The PolicySettings for policy. + * @return the next definition stage. + */ + WithCreate withPolicySettings(PolicySettings policySettings); + } + /** The stage of the WebApplicationFirewallPolicy definition allowing to specify customRules. */ + interface WithCustomRules { + /** + * Specifies the customRules property: The custom rules inside the policy.. + * + * @param customRules The custom rules inside the policy. + * @return the next definition stage. + */ + WithCreate withCustomRules(List customRules); + } + /** The stage of the WebApplicationFirewallPolicy definition allowing to specify managedRules. */ + interface WithManagedRules { + /** + * Specifies the managedRules property: Describes the managedRules structure.. + * + * @param managedRules Describes the managedRules structure. + * @return the next definition stage. + */ + WithCreate withManagedRules(ManagedRulesDefinition managedRules); + } + } + /** + * Begins update for the WebApplicationFirewallPolicy resource. + * + * @return the stage of resource update. + */ + WebApplicationFirewallPolicy.Update update(); + + /** The template for WebApplicationFirewallPolicy update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithPolicySettings, + UpdateStages.WithCustomRules, + UpdateStages.WithManagedRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WebApplicationFirewallPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WebApplicationFirewallPolicy apply(Context context); + } + /** The WebApplicationFirewallPolicy update stages. */ + interface UpdateStages { + /** The stage of the WebApplicationFirewallPolicy 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 WebApplicationFirewallPolicy update allowing to specify policySettings. */ + interface WithPolicySettings { + /** + * Specifies the policySettings property: The PolicySettings for policy.. + * + * @param policySettings The PolicySettings for policy. + * @return the next definition stage. + */ + Update withPolicySettings(PolicySettings policySettings); + } + /** The stage of the WebApplicationFirewallPolicy update allowing to specify customRules. */ + interface WithCustomRules { + /** + * Specifies the customRules property: The custom rules inside the policy.. + * + * @param customRules The custom rules inside the policy. + * @return the next definition stage. + */ + Update withCustomRules(List customRules); + } + /** The stage of the WebApplicationFirewallPolicy update allowing to specify managedRules. */ + interface WithManagedRules { + /** + * Specifies the managedRules property: Describes the managedRules structure.. + * + * @param managedRules Describes the managedRules structure. + * @return the next definition stage. + */ + Update withManagedRules(ManagedRulesDefinition managedRules); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WebApplicationFirewallPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WebApplicationFirewallPolicy refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyListResult.java new file mode 100644 index 0000000000000..4c4bf8190b517 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyListResult.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list WebApplicationFirewallPolicies. It contains a list of WebApplicationFirewallPolicy + * objects and a URL link to get the next set of results. + */ +@Immutable +public final class WebApplicationFirewallPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPolicyListResult.class); + + /* + * List of WebApplicationFirewallPolicies within a resource group. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of WebApplicationFirewallPolicy objects if there + * are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of WebApplicationFirewallPolicies within a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyResourceState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyResourceState.java new file mode 100644 index 0000000000000..d0cae19ce1e0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyResourceState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallPolicyResourceState. */ +public final class WebApplicationFirewallPolicyResourceState + extends ExpandableStringEnum { + /** Static value Creating for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState CREATING = fromString("Creating"); + + /** Static value Enabling for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState ENABLING = fromString("Enabling"); + + /** Static value Enabled for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState ENABLED = fromString("Enabled"); + + /** Static value Disabling for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState DISABLING = fromString("Disabling"); + + /** Static value Disabled for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState DISABLED = fromString("Disabled"); + + /** Static value Deleting for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a WebApplicationFirewallPolicyResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallPolicyResourceState. + */ + @JsonCreator + public static WebApplicationFirewallPolicyResourceState fromString(String name) { + return fromString(name, WebApplicationFirewallPolicyResourceState.class); + } + + /** @return known WebApplicationFirewallPolicyResourceState values. */ + public static Collection values() { + return values(WebApplicationFirewallPolicyResourceState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallRuleType.java new file mode 100644 index 0000000000000..40d8736448b09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallRuleType.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallRuleType. */ +public final class WebApplicationFirewallRuleType extends ExpandableStringEnum { + /** Static value MatchRule for WebApplicationFirewallRuleType. */ + public static final WebApplicationFirewallRuleType MATCH_RULE = fromString("MatchRule"); + + /** Static value Invalid for WebApplicationFirewallRuleType. */ + public static final WebApplicationFirewallRuleType INVALID = fromString("Invalid"); + + /** + * Creates or finds a WebApplicationFirewallRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallRuleType. + */ + @JsonCreator + public static WebApplicationFirewallRuleType fromString(String name) { + return fromString(name, WebApplicationFirewallRuleType.class); + } + + /** @return known WebApplicationFirewallRuleType values. */ + public static Collection values() { + return values(WebApplicationFirewallRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallTransform.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallTransform.java new file mode 100644 index 0000000000000..e8e38d5d9dd19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallTransform.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.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallTransform. */ +public final class WebApplicationFirewallTransform extends ExpandableStringEnum { + /** Static value Lowercase for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform LOWERCASE = fromString("Lowercase"); + + /** Static value Trim for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform TRIM = fromString("Trim"); + + /** Static value UrlDecode for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform URL_DECODE = fromString("UrlDecode"); + + /** Static value UrlEncode for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform URL_ENCODE = fromString("UrlEncode"); + + /** Static value RemoveNulls for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform REMOVE_NULLS = fromString("RemoveNulls"); + + /** Static value HtmlEntityDecode for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform HTML_ENTITY_DECODE = fromString("HtmlEntityDecode"); + + /** + * Creates or finds a WebApplicationFirewallTransform from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallTransform. + */ + @JsonCreator + public static WebApplicationFirewallTransform fromString(String name) { + return fromString(name, WebApplicationFirewallTransform.class); + } + + /** @return known WebApplicationFirewallTransform values. */ + public static Collection values() { + return values(WebApplicationFirewallTransform.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebCategories.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebCategories.java new file mode 100644 index 0000000000000..3de1670fb716b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebCategories.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.network.generated.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 WebCategories. */ +public interface WebCategories { + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + AzureWebCategory get(String name); + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + Response getWithResponse(String name, String expand, Context context); + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Azure Web Categories 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 all the Azure Web Categories in a subscription. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/package-info.java new file mode 100644 index 0000000000000..4b076d6d32e46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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 NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.models; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java new file mode 100644 index 0000000000000..adbbe4531ffac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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 NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..ffb4499d26afb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/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.network.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.network.generated; + exports com.azure.resourcemanager.network.generated.fluent; + exports com.azure.resourcemanager.network.generated.fluent.models; + exports com.azure.resourcemanager.network.generated.models; + + opens com.azure.resourcemanager.network.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.network.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/network/ci.yml b/sdk/network/ci.yml new file mode 100644 index 0000000000000..1ce77588aab27 --- /dev/null +++ b/sdk/network/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/network/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: network + Artifacts: + - name: azure-resourcemanager-network-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagernetworkgenerated diff --git a/sdk/network/pom.xml b/sdk/network/pom.xml new file mode 100644 index 0000000000000..8c3d987e170df --- /dev/null +++ b/sdk/network/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-network-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-network-generated + + + +